Hi, I'm trying to debug my cost function and would like to print intermediate values to console. I'm using Eigen to wrap the pointer-to-T arrays as Eigen matrices of type T, thus I'm doing:
std::cout << residual << std::endl;
where residual is of type Eigen::Matrix<T,3,1>. However, I'm getting:
/usr/include/eigen3/Eigen/src/Core/MathFunctions.h:365:34: error: invalid static_cast from type ‘const ceres::Jet<double, 13>’ to type ‘int’
return static_cast<NewType>(x);
It would seem that Eigen is trying to cast the elements to numbers for display and thus it does not call the stream operator directly on its elements (which I assume is implemented on ceres side). How could I print my residual in this case?
Best,
Matias