Registered Member
|
Hi,
I know that there is this problem with the std::vector and Eigen Lib. Thus I am using the Eigen/StdVector header. This works fine. However, when I plug the vector into a std::priority_queue I get '_Val': formal parameter with __declspec(align('16')) won't be aligned C:\Programme\Microsoft Visual Studio 9.0\VC\include\vector'. std::priority_queue<Frame, std::vector<Frame>, FrameComparator> _framePQ; wheras Frame is struct containing Eigen::Matrices Is there anything I forgot to consider? Sorry if it is a newbie problem. Regards, Tassilo
Last edited by TJKlein on Wed Jul 01, 2009 7:11 am, edited 1 time in total.
|
Registered Member
|
What version of Eigen?
Try replacing
by
everywhere in your code (including inside the priority_queue). If that doesn't solve the problem, I don't know. A quick look at priority_queue, here with G++ 4.4, doesn't reveal any value_type being passed by value (which is the meaning of your compiler error message). Maybe you could post here as code the content of your priority_queue header.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Ah, and also, make sure to include Eigen/StdVector BEFORE including any relevant standard headers (like priority_queue).
|
Registered Member
|
Thanks a lot. I am now at least a little step further - it compiles. Unfortunately it fails an assertion and redirects me to that web-site: http://eigen.tuxfamily.org/dox/Unaligne ... ssert.html
But I checked everything that's on there and adapted it. But when pushing more than one element on the priority queue it fails that assertion.
Regards, Tassilo |
Registered Member
|
I'm going to be away for a few days. Hope that someone else can help you. Don't forget to tell us your Eigen version. Also:
as a temporary workaround, you can replace Eigen::Matrix4f by
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Okay, thanks. Concerning the version, it is Eigen 2.0.3.
Regards, Tassilo |
Registered Member
|
ok. Another useful thing is if you can produce a good back-trace from your crash (the failed assert). It'd be interesting to see which function in which std container causes the crash (that will be a function taking a Frame by value). Is it std::vector::resize() ?
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Okay a trace back: the assertion failed in MatrixStorage.h, Line 44
1)_framePQ.push(_tempFrame); 2) push_heap(c.begin(), c.end(), comp); @ <queue> - Line: 212 3) std::_Push_heap_0(_CHECKED_BASE(_First), _CHECKED_BASE(--_Last), _Pred, _Dist_type(_First), _Val_type(_First)); @ <algorithm> - Line: 2045 4) std::_Push_heap(_First, _Count, _Diff(0), _Ty(*_Last), _Pred); @ <algorithm> - Line: 2033 => Assertion failed. |
Registered Member
|
aaah great So what is the prototype of this std::_Push_heap function at algorithm:2033 ? Does it take a Frame by value? If yes, that's another flaw in the STL (either in the standard or in the MSVC implementation). The next most useful thing is if you can produce a self-contained test-case so that we can reproduce at home.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Moderator
|
I tried that with MSVC 2008 and I cannot reproduce the issue.
here is what I tried: http://pastebin.com/d73eb61a7 |
Registered Member
|
Okay, I will try to build a test case. So far I am working fine with the quick hack workaround.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]