Registered Member
|
Hi, I decided to use Eigen2 to solve a particular problem I am working on and came across issues with aliasing. I'm using the latest version 2.0.5. Here's the code saved as eigenbug.cc:
Output:
It looks like the line
causes aliasing. I can fix it by using an eval() before assignment but I thought that the default behaviour should take care of that. Is this expected behaviour or a bug? This also occurs when I use any of the other corners (TopRight, BottomLeft, BottomLeft), general blocks using the block() method, or if I copy a column to a row. Thanks in advance! Raman |
Registered Member
|
This is expected behaviour. I agree that it's terrible, but there simply is no way to make this work automatically, without giving up the benefit of expression templates in other use cases, and without adding a permanent performance overhead. The only way forward is to make sure that the user knows about these issues and how to deal with them. Since you had the idea of using eval() there, which is exactly the right thing to do, I'm afraid I don't have anything more to teach you
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]