I am trying to traverse Eigen::MatrixXd matrix
. However, there does not seem to be a function that returns the columns size nor the row size. Does anybody have an idea on how to do this?
This should work...
#include <Eigen/Dense>
int main()
{
Eigen::MatrixXd matrix(3, 4);
int r = matrix.rows();
int c = matrix.cols();
for (int i = 0; i < r; ++i)
{
for (int j = 0; j < c; ++j)
{
std::cout << matrix(i,j);
}
}
return 0;
}