Registered Member
|
I have a vector of structure's, and each struct holds 9 double values. I want to Map it to a MatrixXd, where each row is an element in the vector. Is this possible? And how do I do it? I thought it was something like:
But apparently I'm way off base here.I am failing on the assertion "YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX". Any help is greatly appreciated. |
Moderator
|
hm, this should work, except that by default MatrixXd is column major, so you should use:
Map<Matrix<double,Dynamic,9,RowMajor> > mymap(&(myVector[0].station), myVector.size(), 9); if not, please post the precise error message with precise code. |
Registered Member
|
Yep this worked as expected. Thanks for the response. |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]