Registered Member
|
Hello,
I want to allocate a symmetric double matrix hoping that only half the entries are stored. How do I do that? Say I have a symmetric 5x5 matrix A and I do A(1,2)=3.0; What then happens? Does it remain symmetric (i.e A(2,1)=3.0; automatically) or does it cease to be symmetric and then allocates a full rectangular array? As an aside, if you really store only half the entries in a symmetric matrix you will have to probably do something like return (i<j)? data[i][j]:data[j][i]; in the definition of the entry accessor operator. Does this slow down the accessor significantly, or is there a better solution? |
Moderator
|
Hi,
so far there is no compact symmetric storage. You have to use a square dense matrix, and then use the selfadjointView<>() method to operate on one half of the matrix. Compact storage will come later on. Probably for 3.1. See this entry: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=42 to follow the discussions and progress. |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient