Registered Member
|
Hi,
I wanted to store a dynamic MatrixXd in a std::vector. I tried this: std::vector<Eigen::MatrixXd,Eigen::aligned_allocator<Eigen::MatrixXd> > mat; Eigen::MatrixXd m(9,1); for(int i = 0; i < 8; ++i) { m(0,0) = val; m(1,0) = val; ................. mat.pushback(m); } when I am checking the size of mat I am getting 16 instead of 8. and when I am printing mat.at(0) it doesn't print anything. Please help me with this soon. Thanks in advance. |
Moderator
|
I don't understand your issue, here is a simple working example:
btw, aligned_allocator is needed for fixed size types only. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]