Registered Member
|
I have a triangular matrix with the data on the main diagonal and above and I need to obtain a symmetric view of this matrix, i.e. perform something like selfadjointView but without calculating complex conjugates (my matrix is complex).
The best way I can find is
Is there more efficient or more concise way to solve this task? Will I get into aliasing in the code above? Btw, there is an old topic about almost same task, but I'm not sure it is viewtopic.php?f=74&t=88405 |
Moderator
|
We indeed plane to support symmetricView in the future. Currently what you do is the best way to achieve this, though you can make it simpler since .triangularView<> on the left hand side behave like a write-mask:
m1.triangularView<Eigen::StrictlyLower>() = m1.transpose(); No aliasing issue here. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]