![]() Registered Member ![]()
|
Hi all,
Why does the following code allocate temporary memory in Eigen?
But this works without temporary allocation:
Does this mean that I should avoid assignments at all cost when writing code? Thanks! |
![]() Moderator ![]()
|
All the details are here: http://eigen.tuxfamily.org/dox/TopicLazyEvaluation.html
Basically, dense matrix (and vector) products are the only two exceptions where we assume aliasing by default. Solution: U.noalias() = m1 * m2; |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]