mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-07 21:39:04 +08:00
add specialization ei_ref_selector for sparse matrix types
This commit is contained in:
parent
e6c560aedf
commit
b2a5fb874f
@ -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>
|
template<typename _Scalar, int _Flags>
|
||||||
class DynamicSparseMatrix
|
class DynamicSparseMatrix
|
||||||
: public SparseMatrixBase<DynamicSparseMatrix<_Scalar, _Flags> >
|
: public SparseMatrixBase<DynamicSparseMatrix<_Scalar, _Flags> >
|
||||||
|
@ -85,8 +85,7 @@ class SparseDiagonalProduct
|
|||||||
typedef ei_sparse_diagonal_product_inner_iterator_selector
|
typedef ei_sparse_diagonal_product_inner_iterator_selector
|
||||||
<_LhsNested,_RhsNested,SparseDiagonalProduct,LhsMode,RhsMode> InnerIterator;
|
<_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)
|
: m_lhs(lhs), m_rhs(rhs)
|
||||||
{
|
{
|
||||||
ei_assert(lhs.cols() == rhs.rows() && "invalid sparse matrix * diagonal matrix product");
|
ei_assert(lhs.cols() == rhs.rows() && "invalid sparse matrix * diagonal matrix product");
|
||||||
|
@ -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>
|
template<typename _Scalar, int _Options>
|
||||||
class SparseMatrix
|
class SparseMatrix
|
||||||
: public SparseMatrixBase<SparseMatrix<_Scalar, _Options> >
|
: public SparseMatrixBase<SparseMatrix<_Scalar, _Options> >
|
||||||
|
@ -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>
|
template<typename _Scalar, int _Options>
|
||||||
class SparseVector
|
class SparseVector
|
||||||
: public SparseMatrixBase<SparseVector<_Scalar, _Options> >
|
: public SparseMatrixBase<SparseVector<_Scalar, _Options> >
|
||||||
|
Loading…
x
Reference in New Issue
Block a user