I have an Eigen::Matrix<double, Dynamic, Dynamic>
, and I need to check if any of its elements is different from 0.
I tried the following code:
Matrix<double, Dynamic, Dynamic> m;
bool f = (m != 0.0).any();
But I got a compiler error.
Invalid operands to binary expression ('const Eigen::Matrix' and 'double')
(abs(m) < eps)
– Anguish