diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-12-01 06:21:29 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-12-01 06:21:29 +0100 |
commit | b2a5fb874f6b2d60d497180cf83e0f0ac6ae0cc8 (patch) | |
tree | d2c6d57426f9c7cf7d8d6ef41598bde796dd446d /Eigen | |
parent | e6c560aedfff176cbc6df40eedd4c5cf343b0fa6 (diff) |
add specialization ei_ref_selector for sparse matrix types
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Sparse/DynamicSparseMatrix.h | 7 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseDiagonalProduct.h | 3 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseMatrix.h | 7 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseVector.h | 7 |
4 files changed, 22 insertions, 2 deletions
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<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> > 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<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"); 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 @@ -57,6 +57,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> > { 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 @@ -52,6 +52,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> > { |