I want to map from a C-type array to a Column majored Eigen matrix.
The mapping itself is using the RowMajor type,
so I tried
std::vector<double> a(9);
double *p= a.data();
Eigen::MatrixXd M=Eigen::Map<Eigen::Matrix<double, 3, 3, Eigen::RowMajor>>(p)
I got what I expected(the order of M.data()), however, if the dimension(3) in the template is not known at compile time, this method doesn't work... any solution?
typedef
forEigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>
to improve readability. – Vazquez