Registered Member
|
Hello,
i have Problems with Eigen using STL Containers. First, i followed this Eigen tutorial: http://eigen.tuxfamily.org/dox/TopicStlContainers.html. But it don't work for me. If i debug my code step by step, at the position, where i declare the vector, my programm crash with an debug error. Console entry: assertion failed: rows >= 0 && <RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows>... In release mode i get an unhandled exception. I try the 2 described ways in the Eigen documentation. 1. std::vector<Eigen::Vector3d,Eigen::aligned_allocator<Eigen::Vector3d> > x; 2. #include <Eigen\StdVector> EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Vector3d) ..... vector<Vector3d> x; Nothing work for me. I have no idea why . I use Windows 8 x64, Visual Studio 2010 and i tried Eigen 3.1.1, 3.1.2. I hope someone can help me . Thanks, luensel
Last edited by luensel on Wed Nov 07, 2012 4:37 pm, edited 1 time in total.
|
Registered Member
|
Your Vector3d is not a fixed-size aligned type! : http://eigen.tuxfamily.org/dox/TopicFix ... zable.html
So no need to care about the STL Container and its Allocator! You could use also a class
std::vector<Data> a; And everything works fine I think Because every "a" is aligned in a class! I use this often, this should work, Could somebody tell me if this is correct :-? Thanks a lot! |
Registered Member
|
Hello Gabyx,
I think your solution didn't work for me. My little sample looks like:
|
Registered Member
|
You can just
use std::vector<Vector3d> : Vector3d is a fixed size vector which is not a multiple of 16 bytes and is there fore not aligned in memory! Am I wrong? And ehm, your program does not crash by me. It works with Eigen 3.2.1 and Ubuntu and GCC 4.4 |
Registered Member
|
Yes i knew that it must work. I think there is something wrong with my Visual Studio 2010 or Windows 8 64x, but i don't know what.
At runtime with debug mode i get this failure: "Debug Error" and the following console entry: "assertion failed: rows >= 0 && <RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows>..." In release mode i get an unhandled exception. But when i compile my Program, everything is fine. I hope someone can help me |
Registered Member
|
Hi luensel,
your code is working over here. I tried with Eigen Hg revision 4938 (be5e3923d925) and MSVC 2010 Version 10.0.40219.1 SP1 Rel. Which version are you using? Regards, Hauke |
Registered Member
|
Hi Hauke,
i use the same Visual Studio Version like you. Greetings, luensel |
Registered Member
|
Hey,
i found my mistake . I forgot a comma in the row before Thanks all ^^. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]