Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes | Private Types | Static Private Member Functions | List of all members
Eigen::DynamicSparseMatrix Class Reference

A sparse matrix class designed for matrix assembly purpose. More...

#include <SparseUtil.h>

Classes

class  InnerIterator
 
class  ReverseInnerIterator
 

Public Types

enum  { Options = _Options }
 
typedef MappedSparseMatrix< Scalar, Flags > Map
 

Public Member Functions

std::vector< internal::CompressedStorage< Scalar, StorageIndex > > & _data ()
 
const std::vector< internal::CompressedStorage< Scalar, StorageIndex > > & _data () const
 
Scalar coeff (Index row, Index col) const
 
ScalarcoeffRef (Index row, Index col)
 
Index cols () const
 
EIGEN_DEPRECATED DynamicSparseMatrix ()
 
 DynamicSparseMatrix (const DynamicSparseMatrix &other)
 
template<typename OtherDerived >
EIGEN_DEPRECATED DynamicSparseMatrix (const SparseMatrixBase< OtherDerived > &other)
 
EIGEN_DEPRECATED DynamicSparseMatrix (Index rows, Index cols)
 
EIGEN_DEPRECATED void endFill ()
 
EIGEN_DEPRECATED Scalarfill (Index row, Index col)
 
EIGEN_DEPRECATED Scalarfillrand (Index row, Index col)
 
void finalize ()
 
Index innerNonZeros (Index j) const
 
Index innerSize () const
 
Scalarinsert (Index row, Index col)
 
ScalarinsertBack (Index row, Index col)
 
ScalarinsertBackByOuterInner (Index outer, Index inner)
 
Index nonZeros () const
 
Derived & operator= (const Derived &other)
 
template<typename Derived >
Derived & operator= (const Derived &other)
 
DynamicSparseMatrixoperator= (const DynamicSparseMatrix &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)
 
Index outerSize () const
 
void prune (Scalar reference, RealScalar epsilon=NumTraits< RealScalar >::dummy_precision())
 
void reserve (Index reserveSize=1000)
 
void resize (Index rows, Index cols)
 
void resizeAndKeepData (Index rows, Index cols)
 
Index rows () const
 
void setZero ()
 
EIGEN_DEPRECATED void startFill (Index reserveSize=1000)
 
void startVec (Index)
 
void swap (DynamicSparseMatrix &other)
 
 ~DynamicSparseMatrix ()
 

Protected Types

typedef DynamicSparseMatrix< Scalar,(Flags &~RowMajorBit)|(IsRowMajor?RowMajorBit:0), StorageIndex > TransposedSparseMatrix
 

Protected Attributes

std::vector< internal::CompressedStorage< Scalar, StorageIndex > > m_data
 
Index m_innerSize
 

Private Types

typedef SparseMatrixBase< DynamicSparseMatrixBase
 

Static Private Member Functions

static StorageIndex convert_index (const Index idx)
 

Detailed Description

A sparse matrix class designed for matrix assembly purpose.

Deprecated:
use a SparseMatrix in an uncompressed mode
Parameters
_Scalarthe scalar type, i.e. the type of the coefficients

Unlike SparseMatrix, this class provides a much higher degree of flexibility. In particular, it allows random read/write accesses in log(rho*outer_size) where rho is the probability that a coefficient is nonzero and outer_size is the number of columns if the matrix is column-major and the number of rows otherwise.

Internally, the data are stored as a std::vector of compressed vector. The performances of random writes might decrease as the number of nonzeros per inner-vector increase. In practice, we observed very good performance till about 100 nonzeros/vector, and the performance remains relatively good till 500 nonzeros/vectors.

See also
SparseMatrix

Definition at line 53 of file SparseUtil.h.

Member Typedef Documentation

◆ Base

Definition at line 59 of file DynamicSparseMatrix.h.

◆ Map

Definition at line 66 of file DynamicSparseMatrix.h.

◆ TransposedSparseMatrix

typedef DynamicSparseMatrix<Scalar,(Flags&~RowMajorBit)|(IsRowMajor?RowMajorBit:0), StorageIndex> Eigen::DynamicSparseMatrix::TransposedSparseMatrix
protected

Definition at line 75 of file DynamicSparseMatrix.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Options 

Definition at line 69 of file DynamicSparseMatrix.h.

Constructor & Destructor Documentation

◆ DynamicSparseMatrix() [1/4]

EIGEN_DEPRECATED Eigen::DynamicSparseMatrix::DynamicSparseMatrix ( )
inline

The class DynamicSparseMatrix is deprecated

Definition at line 228 of file DynamicSparseMatrix.h.

◆ DynamicSparseMatrix() [2/4]

EIGEN_DEPRECATED Eigen::DynamicSparseMatrix::DynamicSparseMatrix ( Index  rows,
Index  cols 
)
inline

The class DynamicSparseMatrix is deprecated

Definition at line 238 of file DynamicSparseMatrix.h.

◆ DynamicSparseMatrix() [3/4]

template<typename OtherDerived >
EIGEN_DEPRECATED Eigen::DynamicSparseMatrix::DynamicSparseMatrix ( const SparseMatrixBase< OtherDerived > &  other)
inlineexplicit

The class DynamicSparseMatrix is deprecated

Definition at line 249 of file DynamicSparseMatrix.h.

◆ DynamicSparseMatrix() [4/4]

Eigen::DynamicSparseMatrix::DynamicSparseMatrix ( const DynamicSparseMatrix other)
inline

Definition at line 258 of file DynamicSparseMatrix.h.

◆ ~DynamicSparseMatrix()

Eigen::DynamicSparseMatrix::~DynamicSparseMatrix ( )
inline

Destructor

Definition at line 290 of file DynamicSparseMatrix.h.

Member Function Documentation

◆ _data() [1/2]

std::vector<internal::CompressedStorage<Scalar,StorageIndex> >& Eigen::DynamicSparseMatrix::_data ( )
inline

Definition at line 88 of file DynamicSparseMatrix.h.

◆ _data() [2/2]

const std::vector<internal::CompressedStorage<Scalar,StorageIndex> >& Eigen::DynamicSparseMatrix::_data ( ) const
inline

Definition at line 89 of file DynamicSparseMatrix.h.

◆ coeff()

Scalar Eigen::DynamicSparseMatrix::coeff ( Index  row,
Index  col 
) const
inline
Returns
the coefficient value at given position row, col This operation involes a log(rho*outer_size) binary search.

Definition at line 94 of file DynamicSparseMatrix.h.

◆ coeffRef()

Scalar& Eigen::DynamicSparseMatrix::coeffRef ( Index  row,
Index  col 
)
inline
Returns
a reference to the coefficient value at given position row, col This operation involes a log(rho*outer_size) binary search. If the coefficient does not exist yet, then a sorted insertion into a sequential buffer is performed.

Definition at line 105 of file DynamicSparseMatrix.h.

◆ cols()

Index Eigen::DynamicSparseMatrix::cols ( ) const
inline

Definition at line 83 of file DynamicSparseMatrix.h.

◆ convert_index()

static StorageIndex Eigen::SparseMatrixBase::convert_index
inlinestaticprivate

Definition at line 389 of file SparseMatrixBase.h.

◆ endFill()

EIGEN_DEPRECATED void Eigen::DynamicSparseMatrix::endFill ( )
inline
Deprecated:
use finalize() Does nothing. Provided for compatibility with SparseMatrix.

Definition at line 330 of file DynamicSparseMatrix.h.

◆ fill()

EIGEN_DEPRECATED Scalar& Eigen::DynamicSparseMatrix::fill ( Index  row,
Index  col 
)
inline
Deprecated:
use insert() inserts a nonzero coefficient at given coordinates row, col and returns its reference assuming that: 1 - the coefficient does not exist yet 2 - this the coefficient with greater inner coordinate for the given outer coordinate. In other words, assuming *this is column-major, then there must not exists any nonzero coefficient of coordinates i x col such that i >= row. Otherwise the matrix is invalid.
See also
fillrand(), coeffRef()

Definition at line 311 of file DynamicSparseMatrix.h.

◆ fillrand()

EIGEN_DEPRECATED Scalar& Eigen::DynamicSparseMatrix::fillrand ( Index  row,
Index  col 
)
inline
Deprecated:
use insert() Like fill() but with random inner coordinates. Compared to the generic coeffRef(), the unique limitation is that we assume the coefficient does not exist yet.

Definition at line 323 of file DynamicSparseMatrix.h.

◆ finalize()

void Eigen::DynamicSparseMatrix::finalize ( )
inline

Does nothing: provided for compatibility with SparseMatrix

Definition at line 188 of file DynamicSparseMatrix.h.

◆ innerNonZeros()

Index Eigen::DynamicSparseMatrix::innerNonZeros ( Index  j) const
inline

Definition at line 86 of file DynamicSparseMatrix.h.

◆ innerSize()

Index Eigen::DynamicSparseMatrix::innerSize ( ) const
inline

Definition at line 84 of file DynamicSparseMatrix.h.

◆ insert()

Scalar& Eigen::DynamicSparseMatrix::insert ( Index  row,
Index  col 
)
inline

Definition at line 167 of file DynamicSparseMatrix.h.

◆ insertBack()

Scalar& Eigen::DynamicSparseMatrix::insertBack ( Index  row,
Index  col 
)
inline
Returns
a reference to the non zero coefficient at position row, col assuming that:
  • the nonzero does not already exist
  • the new coefficient is the last one of the given inner vector.
See also
insert, insertBackByOuterInner

Definition at line 152 of file DynamicSparseMatrix.h.

◆ insertBackByOuterInner()

Scalar& Eigen::DynamicSparseMatrix::insertBackByOuterInner ( Index  outer,
Index  inner 
)
inline
See also
insertBack

Definition at line 158 of file DynamicSparseMatrix.h.

◆ nonZeros()

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

Definition at line 122 of file DynamicSparseMatrix.h.

◆ operator=() [1/6]

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

Definition at line 43 of file SparseAssign.h.

◆ operator=() [2/6]

Derived& Eigen::SparseMatrixBase::operator=
inline

◆ operator=() [3/6]

DynamicSparseMatrix& Eigen::DynamicSparseMatrix::operator= ( const DynamicSparseMatrix other)
inline

Definition at line 275 of file DynamicSparseMatrix.h.

◆ operator=() [4/6]

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

Definition at line 17 of file SparseAssign.h.

◆ operator=() [5/6]

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

Definition at line 25 of file SparseAssign.h.

◆ operator=() [6/6]

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

Definition at line 34 of file SparseAssign.h.

◆ outerSize()

Index Eigen::DynamicSparseMatrix::outerSize ( ) const
inline

Definition at line 85 of file DynamicSparseMatrix.h.

◆ prune()

void Eigen::DynamicSparseMatrix::prune ( Scalar  reference,
RealScalar  epsilon = NumTraits<RealScalar>::dummy_precision() 
)
inline

Suppress all nonzeros which are smaller than reference under the tolerance epsilon

Definition at line 191 of file DynamicSparseMatrix.h.

◆ reserve()

void Eigen::DynamicSparseMatrix::reserve ( Index  reserveSize = 1000)
inline

Definition at line 132 of file DynamicSparseMatrix.h.

◆ resize()

void Eigen::DynamicSparseMatrix::resize ( Index  rows,
Index  cols 
)
inline

Resize the matrix without preserving the data (the matrix is set to zero)

Definition at line 199 of file DynamicSparseMatrix.h.

◆ resizeAndKeepData()

void Eigen::DynamicSparseMatrix::resizeAndKeepData ( Index  rows,
Index  cols 
)
inline

Definition at line 210 of file DynamicSparseMatrix.h.

◆ rows()

Index Eigen::DynamicSparseMatrix::rows ( ) const
inline

Definition at line 82 of file DynamicSparseMatrix.h.

◆ setZero()

void Eigen::DynamicSparseMatrix::setZero ( )
inline

Definition at line 115 of file DynamicSparseMatrix.h.

◆ startFill()

EIGEN_DEPRECATED void Eigen::DynamicSparseMatrix::startFill ( Index  reserveSize = 1000)
inline
Deprecated:
Set the matrix to zero and reserve the memory for reserveSize nonzero coefficients.

Definition at line 296 of file DynamicSparseMatrix.h.

◆ startVec()

void Eigen::DynamicSparseMatrix::startVec ( Index  )
inline

Does nothing: provided for compatibility with SparseMatrix

Definition at line 145 of file DynamicSparseMatrix.h.

◆ swap()

void Eigen::DynamicSparseMatrix::swap ( DynamicSparseMatrix other)
inline

Definition at line 267 of file DynamicSparseMatrix.h.

Member Data Documentation

◆ m_data

std::vector<internal::CompressedStorage<Scalar,StorageIndex> > Eigen::DynamicSparseMatrix::m_data
protected

Definition at line 78 of file DynamicSparseMatrix.h.

◆ m_innerSize

Index Eigen::DynamicSparseMatrix::m_innerSize
protected

Definition at line 77 of file DynamicSparseMatrix.h.


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


gtsam
Author(s):
autogenerated on Sat Jun 1 2024 03:09:32