Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Friends | List of all members
Eigen::SparseCompressedBase Class Reference

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

#include <SparseCompressedBase.h>

Classes

class  InnerIterator
 
class  ReverseInnerIterator
 

Public Types

typedef SparseMatrixBase< Derived > Base
 

Public Member Functions

Map< Array< Scalar, Dynamic, 1 > > coeffs ()
 
const Map< const Array< Scalar, Dynamic, 1 > > coeffs () const
 
StorageIndex * innerIndexPtr ()
 
const StorageIndex * innerIndexPtr () const
 
StorageIndex * innerNonZeroPtr ()
 
const StorageIndex * innerNonZeroPtr () const
 
bool isCompressed () const
 
Index nonZeros () const
 
Derived & operator= (const Derived &other)
 
template<typename Derived >
Derived & operator= (const Derived &other)
 
template<typename OtherDerived >
Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const SparseMatrixBase< OtherDerived > &other)
 
StorageIndex * outerIndexPtr ()
 
const StorageIndex * outerIndexPtr () const
 
ScalarvaluePtr ()
 
const ScalarvaluePtr () const
 

Protected Types

typedef Base::IndexVector IndexVector
 

Protected Member Functions

Eigen::Map< IndexVectorinnerNonZeros ()
 
const Eigen::Map< const IndexVectorinnerNonZeros () const
 
internal::LowerBoundIndex lower_bound (Index row, Index col) const
 
 SparseCompressedBase ()
 

Private Member Functions

template<typename OtherDerived >
 SparseCompressedBase (const SparseCompressedBase< OtherDerived > &)
 

Friends

struct internal::evaluator< SparseCompressedBase< Derived > >
 

Detailed Description

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:

Definition at line 15 of file SparseCompressedBase.h.

Member Typedef Documentation

◆ Base

Definition at line 40 of file SparseCompressedBase.h.

◆ IndexVector

Definition at line 46 of file SparseCompressedBase.h.

Constructor & Destructor Documentation

◆ SparseCompressedBase() [1/2]

Eigen::SparseCompressedBase::SparseCompressedBase ( )
inlineprotected

Default constructor. Do nothing.

Definition at line 130 of file SparseCompressedBase.h.

◆ SparseCompressedBase() [2/2]

template<typename OtherDerived >
Eigen::SparseCompressedBase::SparseCompressedBase ( const SparseCompressedBase< OtherDerived > &  )
explicitprivate

Member Function Documentation

◆ coeffs() [1/2]

Map<Array<Scalar,Dynamic,1> > Eigen::SparseCompressedBase::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:

SparseMatrix<double> A(3,3);
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;

and the output is:

See also
valuePtr(), isCompressed()

Definition at line 126 of file SparseCompressedBase.h.

◆ coeffs() [2/2]

const Map<const Array<Scalar,Dynamic,1> > Eigen::SparseCompressedBase::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()

Definition at line 114 of file SparseCompressedBase.h.

◆ innerIndexPtr() [1/2]

StorageIndex* Eigen::SparseCompressedBase::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()

Definition at line 84 of file SparseCompressedBase.h.

◆ innerIndexPtr() [2/2]

const StorageIndex* Eigen::SparseCompressedBase::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()

Definition at line 80 of file SparseCompressedBase.h.

◆ innerNonZeroPtr() [1/2]

StorageIndex* Eigen::SparseCompressedBase::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

Definition at line 104 of file SparseCompressedBase.h.

◆ innerNonZeroPtr() [2/2]

const StorageIndex* Eigen::SparseCompressedBase::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

Definition at line 100 of file SparseCompressedBase.h.

◆ innerNonZeros() [1/2]

Eigen::Map<IndexVector> Eigen::SparseCompressedBase::innerNonZeros ( )
inlineprotected

Definition at line 50 of file SparseCompressedBase.h.

◆ innerNonZeros() [2/2]

const Eigen::Map<const IndexVector> Eigen::SparseCompressedBase::innerNonZeros ( ) const
inlineprotected

Definition at line 51 of file SparseCompressedBase.h.

◆ isCompressed()

bool Eigen::SparseCompressedBase::isCompressed ( ) const
inline
Returns
whether *this is in compressed form.

Definition at line 107 of file SparseCompressedBase.h.

◆ lower_bound()

internal::LowerBoundIndex Eigen::SparseCompressedBase::lower_bound ( Index  row,
Index  col 
) const
inlineprotected

Definition at line 135 of file SparseCompressedBase.h.

◆ nonZeros()

Index Eigen::SparseCompressedBase::nonZeros ( ) const
inline
Returns
the number of non zero coefficients

Definition at line 56 of file SparseCompressedBase.h.

◆ operator=() [1/5]

Derived& Eigen::SparseMatrixBase::operator=
inline

◆ operator=() [2/5]

template<typename Derived >
Derived& Eigen::SparseMatrixBase::operator= ( typename Derived  )
inline

Definition at line 43 of file SparseAssign.h.

◆ operator=() [3/5]

template<typename OtherDerived >
Derived & Eigen::SparseMatrixBase::operator= ( typename OtherDerived  )

Definition at line 17 of file SparseAssign.h.

◆ operator=() [4/5]

template<typename OtherDerived >
Derived & Eigen::SparseMatrixBase::operator= ( typename OtherDerived  )

Definition at line 25 of file SparseAssign.h.

◆ operator=() [5/5]

template<typename OtherDerived >
Derived & Eigen::SparseMatrixBase::operator= ( typename OtherDerived  )
inline

Definition at line 34 of file SparseAssign.h.

◆ outerIndexPtr() [1/2]

StorageIndex* Eigen::SparseCompressedBase::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()

Definition at line 95 of file SparseCompressedBase.h.

◆ outerIndexPtr() [2/2]

const StorageIndex* Eigen::SparseCompressedBase::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()

Definition at line 90 of file SparseCompressedBase.h.

◆ valuePtr() [1/2]

Scalar* Eigen::SparseCompressedBase::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()

Definition at line 75 of file SparseCompressedBase.h.

◆ valuePtr() [2/2]

const Scalar* Eigen::SparseCompressedBase::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()

Definition at line 71 of file SparseCompressedBase.h.

Friends And Related Function Documentation

◆ internal::evaluator< SparseCompressedBase< Derived > >

friend struct internal::evaluator< SparseCompressedBase< Derived > >
friend

Definition at line 151 of file SparseCompressedBase.h.


The documentation for this class was generated from the following file:
A
Definition: test_numpy_dtypes.cpp:298


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:12:00