This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Symmetric view

Tags: symmetric, view symmetric, view symmetric, view
(comma "," separated)
User avatar
sapien2
Registered Member
Posts
4
Karma
0
OS

Symmetric view

Wed Nov 28, 2012 6:58 pm
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
Code: Select all
m1.triangularView<Eigen::StrictlyLower>() = m1.triangularView<Eigen::StrictlyUpper>().transpose();

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
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Symmetric view  Topic is solved

Thu Nov 29, 2012 2:53 pm
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.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]