Let say I have an ArrayXXf
(or MatrixXf
) m
. In each iteration of a for loop, I want to fill m
row-wise with a VectorXf
.
Eigen::ArrayXXf m(5, 5);
for (int i = 0; i < 5; i++)
{
Eigen::VectorXf vec(5);
vec << i, i + 1, i + 2, i+3, i+4;
//fill m row wise
// in matlab I will do something like m(i,:) = vec;
// in numpy this will looks like m[i:] = vec;
// that means when i is 0 m looks like
// [ 0 1 2 3 4 5
// - - - - - -
// - - - - - -
// - - - - - -
// - - - - - -]
}
How can I achieve that in Eigen?