Add support for non trivial scalar factor in sparse selfadjoint * dense products, and enable +=/-= assignement for such products.

This changeset also improves the performance by working on column of the result at once.
This commit is contained in:
Gael Guennebaud
2016-08-24 13:06:34 +02:00
parent 8132a12625
commit 441b7eaab2
2 changed files with 47 additions and 30 deletions

View File

@@ -292,6 +292,10 @@ template<typename SparseMatrixType> void sparse_product()
VERIFY_IS_APPROX(x=mUp.template selfadjointView<Upper>()*b, refX=refS*b);
VERIFY_IS_APPROX(x=mLo.template selfadjointView<Lower>()*b, refX=refS*b);
VERIFY_IS_APPROX(x=mS.template selfadjointView<Upper|Lower>()*b, refX=refS*b);
VERIFY_IS_APPROX(x.noalias()+=mUp.template selfadjointView<Upper>()*b, refX+=refS*b);
VERIFY_IS_APPROX(x.noalias()-=mLo.template selfadjointView<Lower>()*b, refX-=refS*b);
VERIFY_IS_APPROX(x.noalias()+=mS.template selfadjointView<Upper|Lower>()*b, refX+=refS*b);
// sparse selfadjointView with sparse matrices
SparseMatrixType mSres(rows,rows);