From b2a5fb874f6b2d60d497180cf83e0f0ac6ae0cc8 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 1 Dec 2009 06:21:29 +0100 Subject: add specialization ei_ref_selector for sparse matrix types --- Eigen/src/Sparse/DynamicSparseMatrix.h | 7 +++++++ Eigen/src/Sparse/SparseDiagonalProduct.h | 3 +-- Eigen/src/Sparse/SparseMatrix.h | 7 +++++++ Eigen/src/Sparse/SparseVector.h | 7 +++++++ 4 files changed, 22 insertions(+), 2 deletions(-) (limited to 'Eigen') diff --git a/Eigen/src/Sparse/DynamicSparseMatrix.h b/Eigen/src/Sparse/DynamicSparseMatrix.h index 15135f9db..189a56bd0 100644 --- a/Eigen/src/Sparse/DynamicSparseMatrix.h +++ b/Eigen/src/Sparse/DynamicSparseMatrix.h @@ -57,6 +57,13 @@ struct ei_traits > }; }; +template +struct ei_ref_selector< DynamicSparseMatrix<_Scalar, _Options> > +{ + typedef DynamicSparseMatrix<_Scalar, _Options> MatrixType; + typedef MatrixType const& type; +}; + template class DynamicSparseMatrix : public SparseMatrixBase > diff --git a/Eigen/src/Sparse/SparseDiagonalProduct.h b/Eigen/src/Sparse/SparseDiagonalProduct.h index 5fb149a2c..f12ccb929 100644 --- a/Eigen/src/Sparse/SparseDiagonalProduct.h +++ b/Eigen/src/Sparse/SparseDiagonalProduct.h @@ -85,8 +85,7 @@ class SparseDiagonalProduct typedef ei_sparse_diagonal_product_inner_iterator_selector <_LhsNested,_RhsNested,SparseDiagonalProduct,LhsMode,RhsMode> InnerIterator; - template - 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"); diff --git a/Eigen/src/Sparse/SparseMatrix.h b/Eigen/src/Sparse/SparseMatrix.h index 7010602b7..36fa123fb 100644 --- a/Eigen/src/Sparse/SparseMatrix.h +++ b/Eigen/src/Sparse/SparseMatrix.h @@ -56,6 +56,13 @@ struct ei_traits > }; }; +template +struct ei_ref_selector > +{ + typedef SparseMatrix<_Scalar, _Options> MatrixType; + typedef MatrixType const& type; +}; + template class SparseMatrix : public SparseMatrixBase > diff --git a/Eigen/src/Sparse/SparseVector.h b/Eigen/src/Sparse/SparseVector.h index 8c8728b87..1fa1980b2 100644 --- a/Eigen/src/Sparse/SparseVector.h +++ b/Eigen/src/Sparse/SparseVector.h @@ -51,6 +51,13 @@ struct ei_traits > }; }; +template +struct ei_ref_selector< SparseVector<_Scalar, _Options> > +{ + typedef SparseVector<_Scalar, _Options> MatrixType; + typedef MatrixType const& type; +}; + template class SparseVector : public SparseMatrixBase > -- cgit v1.2.3