Registered Member
|
Hi,
Is there a good reason why taking array() of SparseMatrix::diagonal() does not work?
At the moment the compilation of this code gives the warning "returning reference to temporary [enabled by default]". The executed result from last cout also is corrupt. I can get around it by copying the diagonal to a vector first, but just wondering why there is a limitation here. |
Moderator
|
Works for me with 3.3 or 3.2, and gcc or clang:
|
Registered Member
|
OK, perhaps this is a compiler-dependent problem.
I am on Ubuntu 12.04 using gcc 4.6.3 and Eigen 3.3.2. I had the same problem in Eigen 3.3.1. I will check on OSX as well. |
Registered Member
|
Just in case, here is the warning message I get when compiling. I hope this might give you a hint.
|
Moderator
|
ah, that warning. Fixed there: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1381 will be part of 3.3.3
|
Registered Member
|
OK, good to know it is already taken care of. Thanks!
|
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]