* update sparse module wrt new diagonal matrix impl

* fix a bug is SparseMatrix
This commit is contained in:
Gael Guennebaud
2009-07-04 11:16:27 +02:00
parent 2de9b7f537
commit 08e419dcb1
8 changed files with 75 additions and 44 deletions

View File

@@ -1,7 +1,7 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
// Copyright (C) 2008-2009 Gael Guennebaud <g.gael@free.fr>
//
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,9 @@
*
*/
template<typename Derived> class SparseMatrixBase
#ifndef EIGEN_PARSED_BY_DOXYGEN
: public MultiplierBase<Derived>
#endif // not EIGEN_PARSED_BY_DOXYGEN
{
public:
@@ -301,10 +304,22 @@ template<typename Derived> class SparseMatrixBase
{ return matrix*scalar; }
// sparse * sparse
template<typename OtherDerived>
const typename SparseProductReturnType<Derived,OtherDerived>::Type
operator*(const SparseMatrixBase<OtherDerived> &other) const;
// sparse * diagonal
template<typename OtherDerived>
const SparseDiagonalProduct<Derived,OtherDerived>
operator*(const DiagonalBase<OtherDerived> &other) const;
// diagonal * sparse
template<typename OtherDerived> friend
const SparseDiagonalProduct<OtherDerived,Derived>
operator*(const DiagonalBase<OtherDerived> &lhs, const SparseMatrixBase& rhs)
{ return SparseDiagonalProduct<OtherDerived,Derived>(lhs.derived(), rhs.derived()); }
// dense * sparse (return a dense object)
template<typename OtherDerived> friend
const typename SparseProductReturnType<OtherDerived,Derived>::Type