paulbanton paulbanton - 1 year ago 65
C++ Question

An equivalent of exponential in C++

i would like to know if there is an equivalent of Matlab in C++ with the Eigen library. I mean if i have this vector in Matlab :

A = [1 2 5]

And i ask to Matlab to return exp(A) Matlab will answer me this :

exp(A) = [exp(1) exp(2) exp(5)]

Do you know if there is something of equivalent in C++ with the Eigen library ?

Thank you.

Answer Source
Eigen::Vector3f v(1, 2, 5);
v = v.array().exp();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download