Public Member Functions
DynamicSparseMatrix< _Scalar, _Options, _Index > Class Template Reference

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

Inheritance diagram for DynamicSparseMatrix< _Scalar, _Options, _Index >:

List of all members.

Public Member Functions

Scalar coeff (Index row, Index col) const
Scalar & coeffRef (Index row, Index col)
Index cols () const
EIGEN_DEPRECATED void endFill ()
EIGEN_DEPRECATED Scalar & fill (Index row, Index col)
EIGEN_DEPRECATED Scalar & fillrand (Index row, Index col)
void finalize ()
Index innerSize () const
Scalar & insertBack (Index row, Index col)
Scalar & insertBackByOuterInner (Index outer, Index inner)
Index nonZeros () const
Index outerSize () const
void prune (Scalar reference, RealScalar epsilon=NumTraits< RealScalar >::dummy_precision())
void resize (Index rows, Index cols)
Index rows () const
EIGEN_DEPRECATED void startFill (Index reserveSize=1000)
void startVec (Index)
 ~DynamicSparseMatrix ()

Detailed Description

template<typename _Scalar, int _Options, typename _Index>
class Eigen::DynamicSparseMatrix< _Scalar, _Options, _Index >

A sparse matrix class designed for matrix assembly purpose.

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

Constructor & Destructor Documentation

~DynamicSparseMatrix ( ) [inline]

Destructor


Member Function Documentation

Scalar 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.
Scalar& 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.
Index cols ( void  ) const [inline]
Returns:
the number of columns.
See also:
rows(), ColsAtCompileTime

Reimplemented from SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >.

EIGEN_DEPRECATED void endFill ( ) [inline]
EIGEN_DEPRECATED Scalar& fill ( Index  row,
Index  col 
) [inline]
EIGEN_DEPRECATED Scalar& fillrand ( Index  row,
Index  col 
) [inline]
void finalize ( ) [inline]

Does nothing: provided for compatibility with SparseMatrix

Index innerSize ( ) const [inline]
Returns:
the size of the inner dimension according to the storage order, i.e., the number of rows for a columns major matrix, and the number of cols otherwise

Reimplemented from SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >.

Scalar& 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
Scalar& insertBackByOuterInner ( Index  outer,
Index  inner 
) [inline]
See also:
insertBack
Index nonZeros ( ) const [inline]
Returns:
the number of non zero coefficients

Reimplemented from SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >.

Index outerSize ( ) const [inline]
Returns:
the size of the storage major dimension, i.e., the number of columns for a columns major matrix, and the number of rows otherwise

Reimplemented from SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >.

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

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

void resize ( Index  rows,
Index  cols 
) [inline]

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

Index rows ( void  ) const [inline]
Returns:
the number of rows.
See also:
cols(), RowsAtCompileTime

Reimplemented from SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >.

EIGEN_DEPRECATED void startFill ( Index  reserveSize = 1000) [inline]
void startVec ( Index  ) [inline]

Does nothing: provided for compatibility with SparseMatrix


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