Sparse module:

* improved performance of mat*=scalar
* bug fix in cwise*
This commit is contained in:
Gael Guennebaud
2009-01-14 21:27:54 +00:00
parent f5741d4277
commit 2d53466fa9
7 changed files with 98 additions and 191 deletions

View File

@@ -162,14 +162,20 @@ template<typename Derived>
EIGEN_STRONG_INLINE Derived&
SparseMatrixBase<Derived>::operator*=(const Scalar& other)
{
return *this = *this * other;
for (int j=0; j<outerSize(); ++j)
for (typename Derived::InnerIterator i(derived(),j); i; ++i)
i.valueRef() *= other;
return derived();
}
template<typename Derived>
EIGEN_STRONG_INLINE Derived&
SparseMatrixBase<Derived>::operator/=(const Scalar& other)
{
return *this = *this / other;
for (int j=0; j<outerSize(); ++j)
for (typename Derived::InnerIterator i(derived(),j); i; ++i)
i.valueRef() /= other;
return derived();
}
#endif // EIGEN_SPARSE_CWISE_UNARY_OP_H