[Feature request] more functions for the selfadjointView class
Submitted by Elisa Friebel
Assigned to Nobody
Link to original bugzilla bug (#602)
Description
Dear Eigen developers,
First, I want to emphasise the benefit of a class for symmetric matrices as proposed in http://eigen.tuxfamily.org/bz/show_bug.cgi?id=42. But I need not only for dense but also for sparse matrices.
Second, as a temporary alternative it would be useful to add some features for the selfadjointView class.
For example for sparse matrices the expression
sm2.selfadjointView<Lower>() = sm1.selfadjointView<Upper>(); //copies the upper triangular part to the lower triangular
is possible while the same code with dense matrices gives compiler errors. The line
m.triangularView()=m2;
works. It would be nice if that was available in the selfadjointView class, too.
On the other hand the selfadjointView class combined with the operator () only works for dense matrices: The line
m.selfadjointViewEigen::Upper()(0,2)=11;
compiles but with a SparseMatrix sm
sm.selfadjointViewEigen::Upper()(0,2)=11
it does not.
In my opinion it makes sense that the call
m.selfadjointViewEigen::Upper()(1,0)
evaluates to the the entry (0,1) in m because we're looking at its selfadjoint.In the current implementation this code leads to a range check error.