add specialization ei_ref_selector for sparse matrix types

This commit is contained in:
Gael Guennebaud 2009-12-01 06:21:29 +01:00
parent e6c560aedf
commit b2a5fb874f
4 changed files with 22 additions and 2 deletions

View File

@ -57,6 +57,13 @@ struct ei_traits<DynamicSparseMatrix<_Scalar, _Flags> >
};
};
template<typename _Scalar, int _Options>
struct ei_ref_selector< DynamicSparseMatrix<_Scalar, _Options> >
{
typedef DynamicSparseMatrix<_Scalar, _Options> MatrixType;
typedef MatrixType const& type;
};
template<typename _Scalar, int _Flags>
class DynamicSparseMatrix
: public SparseMatrixBase<DynamicSparseMatrix<_Scalar, _Flags> >

View File

@ -85,8 +85,7 @@ class SparseDiagonalProduct
typedef ei_sparse_diagonal_product_inner_iterator_selector
<_LhsNested,_RhsNested,SparseDiagonalProduct,LhsMode,RhsMode> InnerIterator;
template<typename _Lhs, typename _Rhs>
EIGEN_STRONG_INLINE SparseDiagonalProduct(const _Lhs& lhs, const _Rhs& rhs)
EIGEN_STRONG_INLINE SparseDiagonalProduct(const Lhs& lhs, const Rhs& rhs)
: m_lhs(lhs), m_rhs(rhs)
{
ei_assert(lhs.cols() == rhs.rows() && "invalid sparse matrix * diagonal matrix product");

View File

@ -56,6 +56,13 @@ struct ei_traits<SparseMatrix<_Scalar, _Options> >
};
};
template<typename _Scalar, int _Options>
struct ei_ref_selector<SparseMatrix<_Scalar, _Options> >
{
typedef SparseMatrix<_Scalar, _Options> MatrixType;
typedef MatrixType const& type;
};
template<typename _Scalar, int _Options>
class SparseMatrix
: public SparseMatrixBase<SparseMatrix<_Scalar, _Options> >

View File

@ -51,6 +51,13 @@ struct ei_traits<SparseVector<_Scalar, _Options> >
};
};
template<typename _Scalar, int _Options>
struct ei_ref_selector< SparseVector<_Scalar, _Options> >
{
typedef SparseVector<_Scalar, _Options> MatrixType;
typedef MatrixType const& type;
};
template<typename _Scalar, int _Options>
class SparseVector
: public SparseMatrixBase<SparseVector<_Scalar, _Options> >