* extended the cache friendly products to support C = alpha * A * M and C += alpha * A * B

* this allows to optimize xpr like C -= lazy_product, still have to catch "scalar_product_of_lazy_product"
* started to support conjugate in cache friendly products (very useful to evaluate A * B.adjoint() without
  evaluating B.adjoint() into a temporary
* compilation fix
This commit is contained in:
Gael Guennebaud
2009-07-07 11:39:19 +02:00
parent 544888e342
commit 92a35c93b2
8 changed files with 204 additions and 118 deletions

View File

@@ -315,7 +315,7 @@ template<typename Derived> class SparseMatrixBase
operator*(const DiagonalBase<OtherDerived> &other) const;
// diagonal * sparse
template<typename OtherDerived> friend
template<typename OtherDerived> friend
const SparseDiagonalProduct<OtherDerived,Derived>
operator*(const DiagonalBase<OtherDerived> &lhs, const SparseMatrixBase& rhs)
{ return SparseDiagonalProduct<OtherDerived,Derived>(lhs.derived(), rhs.derived()); }
@@ -451,14 +451,14 @@ template<typename Derived> class SparseMatrixBase
// Derived& setRandom();
// Derived& setIdentity();
/** \internal use operator= */
template<typename DenseDerived>
void evalToDense(MatrixBase<DenseDerived>& dst)
void evalToDense(MatrixBase<DenseDerived>& dst) const
{
dst.resize(rows(),cols());
dst.setZero();
for (int j=0; j<outerSize(); ++j)
for (typename Derived::InnerIterator i(derived(),j); i; ++i)
res.coeffRef(i.row(),i.col()) = i.value();
dst.coeffRef(i.row(),i.col()) = i.value();
}
Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime> toDense() const