bug #650: fix dense += sparse_row_major * dense

This commit is contained in:
Gael Guennebaud 2015-06-09 18:03:38 +02:00
parent 97119f854f
commit 554356b034

View File

@ -177,7 +177,7 @@ struct sparse_time_dense_product_impl<SparseLhsType,DenseRhsType,DenseResType, R
Index n = lhs.outerSize();
for(Index j=0; j<n; ++j)
{
typename Res::Scalar tmp(0);
typename Res::Scalar tmp(res.coeffRef(j,c));
for(LhsInnerIterator it(lhs,j); it ;++it)
tmp += it.value() * rhs.coeff(it.index(),c);
res.coeffRef(j,c) = alpha * tmp;