Registered Member
|
Hi!
I have a question to 'new' operator on structs including Matrix4f matrices. Here is my code:
It works fine for Matrix3f but fails on Matrix4f. Any idea why so? Regards |
Registered Member
|
Hi, (just to give you a quick but not neccessarily profund answer)
Matrix4f is a fixed size defined matrix ("typedef Matrix< float , 4 , 4 > Matrix4f") MatrixX3f is a dynamic size defined matrix ("typedef Matrix< float , Dynamic, 3 > MatrixX3f") (please note the extra "X" in the type name) Cheers |
Registered Member
|
Hi! Yea, i know the "X" denotes a dynamic Matrix. The app does not hang because of the pointer MatrixX3f*! Reduced (also crashing) code:
It seems to be strange! Because the storage for Matrix4f should be IMHO also known at compile-time. I can not see a problem in this case?!? I'm using Visual Studio 10 and newest Eigen-lib. |
Moderator
|
Read this page:
http://eigen.tuxfamily.org/dox-devel/To ... mbers.html in short you need to add EIGEN_MAKE_ALIGNED_OPERATOR_NEW in the body of your class. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell