[eigen] lazy evaluation in sparse matrix multiply

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


in trying out some of the Eigen sparse-matrix functionality, I noticed, that unlike dense matrix multiplication, sparse matrices appear to default to lazy evaluation of matrix multiplication.

This causes an expression of the type

 M = M * M;

to yield a zero matrix when used with sparse matrices.

Forced evaluation as in

 M = (M * M).eval();

on the other hand, has the desired effect.

I suggest setting the evaluate-before-assigning flag for sparse matrix-product expressions.


P.S.: What is the current status of complex Hermitian sparse (or block tridiagonal) eigenproblems in Eigen?

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/