|
| Index | rows () const |
| |
| Index | cols () const |
| |
| Index | innerSize () const |
| |
| Index | outerSize () const |
| |
| const Scalar * | valuePtr () const |
| |
| Scalar * | valuePtr () |
| |
| const StorageIndex * | innerIndexPtr () const |
| |
| StorageIndex * | innerIndexPtr () |
| |
| const StorageIndex * | outerIndexPtr () const |
| |
| StorageIndex * | outerIndexPtr () |
| |
| const StorageIndex * | innerNonZeroPtr () const |
| |
| StorageIndex * | innerNonZeroPtr () |
| |
| Storage & | data () |
| |
| const Storage & | data () const |
| |
| Scalar | coeff (Index row, Index col) const |
| |
| Scalar & | coeffRef (Index row, Index col) |
| |
| Scalar & | insert (Index row, Index col) |
| |
| void | setZero () |
| |
| void | reserve (Index reserveSize) |
| |
| template<class SizesType > |
| void | reserve (const SizesType &reserveSizes, const typename SizesType::value_type &enableif=typename SizesType::value_type()) |
| |
| Scalar & | insertBack (Index row, Index col) |
| |
| Scalar & | insertBackByOuterInner (Index outer, Index inner) |
| |
| Scalar & | insertBackByOuterInnerUnordered (Index outer, Index inner) |
| |
| void | startVec (Index outer) |
| |
| void | finalize () |
| |
| template<typename InputIterators > |
| void | setFromTriplets (const InputIterators &begin, const InputIterators &end) |
| |
| template<typename InputIterators , typename DupFunctor > |
| void | setFromTriplets (const InputIterators &begin, const InputIterators &end, DupFunctor dup_func) |
| |
| void | sumupDuplicates () |
| |
| template<typename DupFunctor > |
| void | collapseDuplicates (DupFunctor dup_func=DupFunctor()) |
| |
| Scalar & | insertByOuterInner (Index j, Index i) |
| |
| void | makeCompressed () |
| |
| void | uncompress () |
| |
| void | prune (const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision()) |
| |
| template<typename KeepFunc > |
| void | prune (const KeepFunc &keep=KeepFunc()) |
| |
| void | conservativeResize (Index rows, Index cols) |
| |
| void | resize (Index rows, Index cols) |
| |
| void | resizeNonZeros (Index size) |
| |
| const ConstDiagonalReturnType | diagonal () const |
| |
| DiagonalReturnType | diagonal () |
| |
| | SparseMatrix () |
| |
| | SparseMatrix (Index rows, Index cols) |
| |
| template<typename OtherDerived > |
| | SparseMatrix (const SparseMatrixBase< OtherDerived > &other) |
| |
| template<typename OtherDerived , unsigned int UpLo> |
| | SparseMatrix (const SparseSelfAdjointView< OtherDerived, UpLo > &other) |
| |
| | SparseMatrix (const SparseMatrix &other) |
| |
| template<typename OtherDerived > |
| | SparseMatrix (const ReturnByValue< OtherDerived > &other) |
| | Copy constructor with in-place evaluation.
|
| |
| template<typename OtherDerived > |
| | SparseMatrix (const DiagonalBase< OtherDerived > &other) |
| | Copy constructor with in-place evaluation.
|
| |
| void | swap (SparseMatrix &other) |
| |
| void | setIdentity () |
| |
| SparseMatrix & | operator= (const SparseMatrix &other) |
| |
| template<typename OtherDerived > |
| SparseMatrix & | operator= (const EigenBase< OtherDerived > &other) |
| |
| template<typename Lhs , typename Rhs > |
| SparseMatrix & | operator= (const Product< Lhs, Rhs, AliasFreeProduct > &other) |
| |
| template<typename OtherDerived > |
| EIGEN_DONT_INLINE SparseMatrix & | operator= (const SparseMatrixBase< OtherDerived > &other) |
| |
| | ~SparseMatrix () |
| |
| Scalar | sum () const |
| |
| EIGEN_STRONG_INLINE Scalar & | insertBackUncompressed (Index row, Index col) |
| |
| template<typename OtherDerived > |
| EIGEN_DONT_INLINE SparseMatrix< Scalar, _Options, _StorageIndex > & | operator= (const SparseMatrixBase< OtherDerived > &other) |
| |
| template<typename Lhs , typename Rhs > |
| SparseMatrix< Scalar, _Options, _StorageIndex > & | operator= (const Product< Lhs, Rhs, AliasFreeProduct > &src) |
| |
| bool | isCompressed () const |
| |
| Index | nonZeros () const |
| |
| Index | nonZeros () const |
| |
| const Scalar * | valuePtr () const |
| |
| Scalar * | valuePtr () |
| |
| const StorageIndex * | innerIndexPtr () const |
| |
| StorageIndex * | innerIndexPtr () |
| |
| const StorageIndex * | outerIndexPtr () const |
| |
| StorageIndex * | outerIndexPtr () |
| |
| const StorageIndex * | innerNonZeroPtr () const |
| |
| StorageIndex * | innerNonZeroPtr () |
| |
| bool | isCompressed () const |
| |
| const Map< const Array< Scalar, Dynamic, 1 > > | coeffs () const |
| |
| Map< Array< Scalar, Dynamic, 1 > > | coeffs () |
| |
| SparseMatrix< _Scalar, _Options, _StorageIndex > & | operator= (const EigenBase< OtherDerived > &other) |
| |
| SparseMatrix< _Scalar, _Options, _StorageIndex > & | operator= (const ReturnByValue< OtherDerived > &other) |
| |
| SparseMatrix< _Scalar, _Options, _StorageIndex > & | operator= (const SparseMatrixBase< OtherDerived > &other) |
| |
| SparseMatrix< _Scalar, _Options, _StorageIndex > & | operator= (const SparseMatrix< _Scalar, _Options, _StorageIndex > &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator= (const EigenBase< OtherDerived > &other) |
| |
| const Derived & | derived () const |
| |
| Derived & | derived () |
| |
| Derived & | const_cast_derived () const |
| |
| Index | rows () const |
| |
| Index | cols () const |
| |
| Index | size () const |
| |
| bool | isVector () const |
| |
| Index | outerSize () const |
| |
| Index | innerSize () const |
| |
| bool | isRValue () const |
| |
| Derived & | markAsRValue () |
| |
| | SparseMatrixBase () |
| |
| template<typename OtherDerived > |
| Derived & | operator= (const ReturnByValue< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator= (const SparseMatrixBase< OtherDerived > &other) |
| |
| Derived & | operator= (const Derived &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator+= (const SparseMatrixBase< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator-= (const SparseMatrixBase< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator+= (const DiagonalBase< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator-= (const DiagonalBase< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator+= (const EigenBase< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| Derived & | operator-= (const EigenBase< OtherDerived > &other) |
| |
| Derived & | operator*= (const Scalar &other) |
| |
| Derived & | operator/= (const Scalar &other) |
| |
| template<typename OtherDerived > |
| EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type | cwiseProduct (const MatrixBase< OtherDerived > &other) const |
| |
| template<typename OtherDerived > |
| const Product< Derived, OtherDerived > | operator* (const DiagonalBase< OtherDerived > &other) const |
| |
| template<typename OtherDerived > |
| const Product< Derived, OtherDerived, AliasFreeProduct > | operator* (const SparseMatrixBase< OtherDerived > &other) const |
| |
| template<typename OtherDerived > |
| const Product< Derived, OtherDerived > | operator* (const MatrixBase< OtherDerived > &other) const |
| |
| SparseSymmetricPermutationProduct< Derived, Upper|Lower > | twistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const |
| |
| template<typename OtherDerived > |
| Derived & | operator*= (const SparseMatrixBase< OtherDerived > &other) |
| |
| template<int Mode> |
| const TriangularView< const Derived, Mode > | triangularView () const |
| |
| template<unsigned int UpLo> |
| ConstSelfAdjointViewReturnType< UpLo >::Type | selfadjointView () const |
| |
| template<unsigned int UpLo> |
| SelfAdjointViewReturnType< UpLo >::Type | selfadjointView () |
| |
| template<typename OtherDerived > |
| Scalar | dot (const MatrixBase< OtherDerived > &other) const |
| |
| template<typename OtherDerived > |
| Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
| |
| RealScalar | squaredNorm () const |
| |
| RealScalar | norm () const |
| |
| RealScalar | blueNorm () const |
| |
| TransposeReturnType | transpose () |
| |
| const ConstTransposeReturnType | transpose () const |
| |
| const AdjointReturnType | adjoint () const |
| |
| DenseMatrixType | toDense () const |
| |
| template<typename OtherDerived > |
| bool | isApprox (const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
| |
| template<typename OtherDerived > |
| bool | isApprox (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
| |
| const internal::eval< Derived >::type | eval () const |
| |
| Scalar | sum () const |
| |
| const SparseView< Derived > | pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const |
| |
| template<typename OtherDerived > |
| EIGEN_STRONG_INLINE Derived & | operator-= (const SparseMatrixBase< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| EIGEN_STRONG_INLINE Derived & | operator+= (const SparseMatrixBase< OtherDerived > &other) |
| |
| template<typename OtherDerived > |
| EIGEN_STRONG_INLINE const SparseMatrixBase< Derived >::template CwiseProductDenseReturnType< OtherDerived >::Type | cwiseProduct (const MatrixBase< OtherDerived > &other) const |
| |
| template<typename OtherDerived > |
| internal::traits< Derived >::Scalar | dot (const MatrixBase< OtherDerived > &other) const |
| |
| template<typename OtherDerived > |
| internal::traits< Derived >::Scalar | dot (const SparseMatrixBase< OtherDerived > &other) const |
| |
| template<unsigned int UpLo> |
| SparseMatrixBase< Derived >::template ConstSelfAdjointViewReturnType< UpLo >::Type | selfadjointView () const |
| |
| template<unsigned int UpLo> |
| SparseMatrixBase< Derived >::template SelfAdjointViewReturnType< UpLo >::Type | selfadjointView () |
| |
| EIGEN_DEVICE_FUNC Derived & | derived () |
| |
| EIGEN_DEVICE_FUNC const Derived & | derived () const |
| |
| EIGEN_DEVICE_FUNC Derived & | const_cast_derived () const |
| |
| EIGEN_DEVICE_FUNC const Derived & | const_derived () const |
| |
| EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
| |
| EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
| |
| EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
| |
| template<typename Dest > |
| EIGEN_DEVICE_FUNC void | evalTo (Dest &dst) const |
| |
| template<typename Dest > |
| EIGEN_DEVICE_FUNC void | addTo (Dest &dst) const |
| |
| template<typename Dest > |
| EIGEN_DEVICE_FUNC void | subTo (Dest &dst) const |
| |
| template<typename Dest > |
| EIGEN_DEVICE_FUNC void | applyThisOnTheRight (Dest &dst) const |
| |
| template<typename Dest > |
| EIGEN_DEVICE_FUNC void | applyThisOnTheLeft (Dest &dst) const |
| |
template<typename _Scalar,
int _Options, typename _StorageIndex>
class Eigen::SparseMatrix< _Scalar, _Options, _StorageIndex >
A versatible sparse matrix representation.
This class implements a more versatile variants of the common compressed row/column storage format. Each colmun's (resp. row) non zeros are stored as a pair of value with associated row (resp. colmiun) index. All the non zeros are stored in a single large buffer. Unlike the compressed format, there might be extra space in between the nonzeros of two successive colmuns (resp. rows) such that insertion of new non-zero can be done with limited memory reallocation and copies.
A call to the function makeCompressed() turns the matrix into the standard compressed format compatible with many library.
More details on this storage sceheme are given in the manual pages.
- Template Parameters
-
| _Scalar | the scalar type, i.e. the type of the coefficients |
| _Options | Union of bit flags controlling the storage scheme. Currently the only possibility is ColMajor or RowMajor. The default is 0 which means column-major. |
| _StorageIndex | the type of the indices. It has to be a signed type (e.g., short, int, std::ptrdiff_t). Default is int. |
- Warning
- In Eigen 3.2, the undocumented type
SparseMatrix::Index was improperly defined as the storage index type (e.g., int), whereas it is now (starting from Eigen 3.3) deprecated and always defined as Eigen::Index. Codes making use of SparseMatrix::Index, might thus likely have to be changed to use SparseMatrix::StorageIndex instead.
This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_SPARSEMATRIX_PLUGIN.