Reputation: 639
I am working with Eigen in order to obtain the exponential and the logarithm of a matrix. I do not understand why the following code gives me a compilation error. The code is:
Eigen::Matrix4d speedT = Eigen::Matrix4d::Identity();
//some other operations with speedT
Eigen::Matrix4d v = speedT.log();
The error is: Error 17 error C2440: 'type cast' : cannot convert from 'const Eigen::MatrixExponentialReturnValue' to 'Eigen::Matrix4d'
Error 16 error C2027: use of undefined type 'Eigen::MatrixExponentialReturnValue'
For the exponential function (exp) the same issue appears. I have tried different variations of it also make a type cast (Eigen::Matrix4d) speedT.log(); however the result was the same... The version of eigen is Eigen 3.2.8
Upvotes: 2
Views: 1898
Reputation: 4718
I think this error shows up if you forget to
#include <unsupported/Eigen/MatrixFunctions>
Upvotes: 6