是否存在用于对本征矩阵进行元素求逆的函数
#include <eigen3/Eigen/Dense> const auto mat = Eigen::MatrixXd::Constant(3, 3, 5); std::cout << mat; 5 5 5 5 5 5 5 5 5
我的预期结果是:
1/5 1/5 1/5 1/5 1/5 1/5 1/5 1/5 1/5
除了使用for循环以外,还有其他方法吗? (此外,与矩阵运算相比,将本征矩阵上的for循环用于标量运算会更慢)
已解决此问题。只是放在这里以防其他人遇到此问题
mat.cwiseInverse()
Link to all co-efficient wise functions for eigen