Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
Eigen::SparseCompressedBase< Derived > Class Template Reference

Detailed Description

template<typename Derived>
class Eigen::SparseCompressedBase< Derived >

Common base class for sparse [compressed]-{row|column}-storage format.

This class defines the common interface for all derived classes implementing the compressed sparse storage format, such as:

+ Inheritance diagram for Eigen::SparseCompressedBase< Derived >:

Public Member Functions

Map< Array< Scalar, Dynamic, 1 > > coeffs ()
 
const Map< const Array< Scalar, Dynamic, 1 > > coeffs () const
 
StorageIndexinnerIndexPtr ()
 
const StorageIndexinnerIndexPtr () const
 
template<class Comp = std::less<>>
Index innerIndicesAreSorted () const
 
template<class Comp = std::less<>>
Index innerIndicesAreSorted (Index begin, Index end) const
 
StorageIndexinnerNonZeroPtr ()
 
const StorageIndexinnerNonZeroPtr () const
 
bool isCompressed () const
 
Index nonZeros () const
 
StorageIndexouterIndexPtr ()
 
const StorageIndexouterIndexPtr () const
 
template<class Comp = std::less<>>
void sortInnerIndices ()
 
template<class Comp = std::less<>>
void sortInnerIndices (Index begin, Index end)
 
Scalar * valuePtr ()
 
const Scalar * valuePtr () const
 
- Public Member Functions inherited from Eigen::SparseMatrixBase< Derived >
Index cols () const
 
const internal::eval< Derived >::type eval () const
 
Index innerSize () const
 
bool isVector () const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived, AliasFreeProduct > operator* (const SparseMatrixBase< OtherDerived > &other) const
 
Index outerSize () const
 
const SparseView< Derived > pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
 
Index rows () const
 
Index size () const
 
SparseSymmetricPermutationProduct< Derived, Upper|LowertwistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
Derived & derived ()
 
const Derived & derived () const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 

Protected Member Functions

 SparseCompressedBase ()
 

Additional Inherited Members

- Public Types inherited from Eigen::SparseMatrixBase< Derived >
enum  {
  RowsAtCompileTime ,
  ColsAtCompileTime ,
  SizeAtCompileTime ,
  MaxRowsAtCompileTime ,
  MaxColsAtCompileTime ,
  MaxSizeAtCompileTime ,
  IsVectorAtCompileTime ,
  NumDimensions ,
  Flags ,
  IsRowMajor ,
  InnerSizeAtCompileTime
}
 
typedef internal::traits< Derived >::StorageIndex StorageIndex
 
typedef Scalar value_type
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices.
 

Constructor & Destructor Documentation

◆ SparseCompressedBase()

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::SparseCompressedBase ( )
inlineprotected

Default constructor. Do nothing.

Member Function Documentation

◆ coeffs() [1/2]

template<typename Derived >
Map< Array< Scalar, Dynamic, 1 > > Eigen::SparseCompressedBase< Derived >::coeffs ( )
inline
Returns
a read-write view of the stored coefficients as a 1D array expression
Warning
this method is for compressed storage only, and it will trigger an assertion otherwise.

Here is an example:

A.insert(1, 2) = 0;
A.insert(0, 1) = 1;
A.insert(2, 0) = 2;
A.makeCompressed();
cout << "The matrix A is:" << endl << MatrixXd(A) << endl;
cout << "it has " << A.nonZeros() << " stored non zero coefficients that are: " << A.coeffs().transpose() << endl;
A.coeffs() += 10;
cout << "After adding 10 to every stored non zero coefficient, the matrix A is:" << endl << MatrixXd(A) << endl;
TransposeReturnType transpose()
Definition Transpose.h:160
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:186
A versatible sparse matrix representation.
Definition SparseUtil.h:47

and the output is:

See also
valuePtr(), isCompressed()

◆ coeffs() [2/2]

template<typename Derived >
const Map< const Array< Scalar, Dynamic, 1 > > Eigen::SparseCompressedBase< Derived >::coeffs ( ) const
inline
Returns
a read-only view of the stored coefficients as a 1D array expression.
Warning
this method is for compressed storage only, and it will trigger an assertion otherwise.
See also
valuePtr(), isCompressed()

◆ innerIndexPtr() [1/2]

template<typename Derived >
StorageIndex * Eigen::SparseCompressedBase< Derived >::innerIndexPtr ( )
inline
Returns
a non-const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
See also
valuePtr(), outerIndexPtr()

◆ innerIndexPtr() [2/2]

template<typename Derived >
const StorageIndex * Eigen::SparseCompressedBase< Derived >::innerIndexPtr ( ) const
inline
Returns
a const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
See also
valuePtr(), outerIndexPtr()

◆ innerIndicesAreSorted() [1/2]

template<typename Derived >
template<class Comp = std::less<>>
Index Eigen::SparseCompressedBase< Derived >::innerIndicesAreSorted ( ) const
inline
Returns
the index of the first inner vector in the range [0,outerSize) that is not sorted with respect to Comp, or outerSize if the range is fully sorted
See also
sortInnerIndices()

◆ innerIndicesAreSorted() [2/2]

template<typename Derived >
template<class Comp = std::less<>>
Index Eigen::SparseCompressedBase< Derived >::innerIndicesAreSorted ( Index begin,
Index end ) const
inline
Returns
the index of the first inner vector in the range [begin,end) that is not sorted with respect to Comp, or end if the range is fully sorted
See also
sortInnerIndices()

◆ innerNonZeroPtr() [1/2]

template<typename Derived >
StorageIndex * Eigen::SparseCompressedBase< Derived >::innerNonZeroPtr ( )
inline
Returns
a non-const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 in compressed mode

◆ innerNonZeroPtr() [2/2]

template<typename Derived >
const StorageIndex * Eigen::SparseCompressedBase< Derived >::innerNonZeroPtr ( ) const
inline
Returns
a const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 in compressed mode

◆ isCompressed()

template<typename Derived >
bool Eigen::SparseCompressedBase< Derived >::isCompressed ( ) const
inline
Returns
whether *this is in compressed form.

◆ nonZeros()

template<typename Derived >
Index Eigen::SparseCompressedBase< Derived >::nonZeros ( ) const
inline
Returns
the number of non zero coefficients

◆ outerIndexPtr() [1/2]

template<typename Derived >
StorageIndex * Eigen::SparseCompressedBase< Derived >::outerIndexPtr ( )
inline
Returns
a non-const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 for SparseVector
See also
valuePtr(), innerIndexPtr()

◆ outerIndexPtr() [2/2]

template<typename Derived >
const StorageIndex * Eigen::SparseCompressedBase< Derived >::outerIndexPtr ( ) const
inline
Returns
a const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 for SparseVector
See also
valuePtr(), innerIndexPtr()

◆ sortInnerIndices() [1/2]

template<typename Derived >
template<class Comp = std::less<>>
void Eigen::SparseCompressedBase< Derived >::sortInnerIndices ( )
inline

sorts the inner vectors in the range [0,outerSize) with respect to Comp

See also
innerIndicesAreSorted()

◆ sortInnerIndices() [2/2]

template<typename Derived >
template<class Comp = std::less<>>
void Eigen::SparseCompressedBase< Derived >::sortInnerIndices ( Index begin,
Index end )
inline

sorts the inner vectors in the range [begin,end) with respect to Comp

See also
innerIndicesAreSorted()

◆ valuePtr() [1/2]

template<typename Derived >
Scalar * Eigen::SparseCompressedBase< Derived >::valuePtr ( )
inline
Returns
a non-const pointer to the array of values. This function is aimed at interoperability with other libraries.
See also
innerIndexPtr(), outerIndexPtr()

◆ valuePtr() [2/2]

template<typename Derived >
const Scalar * Eigen::SparseCompressedBase< Derived >::valuePtr ( ) const
inline
Returns
a const pointer to the array of values. This function is aimed at interoperability with other libraries.
See also
innerIndexPtr(), outerIndexPtr()

The documentation for this class was generated from the following file: