A sparse matrix class designed for matrix assembly purpose. More...
#include <DynamicSparseMatrix.h>
Public Types | |
enum | { Options } |
typedef MappedSparseMatrix < Scalar, Flags > | Map |
Public Member Functions | |
std::vector < internal::CompressedStorage < Scalar, Index > > & | _data () |
const std::vector < internal::CompressedStorage < Scalar, Index > > & | _data () const |
Scalar | coeff (Index row, Index col) const |
Scalar & | coeffRef (Index row, Index col) |
Index | cols () const |
EIGEN_DEPRECATED | DynamicSparseMatrix () |
EIGEN_DEPRECATED | DynamicSparseMatrix (Index rows, Index cols) |
template<typename OtherDerived > | |
EIGEN_DEPRECATED | DynamicSparseMatrix (const SparseMatrixBase< OtherDerived > &other) |
DynamicSparseMatrix (const DynamicSparseMatrix &other) | |
EIGEN_DEPRECATED void | endFill () |
EIGEN_DEPRECATED Scalar & | fill (Index row, Index col) |
EIGEN_DEPRECATED Scalar & | fillrand (Index row, Index col) |
void | finalize () |
Index | innerNonZeros (Index j) const |
Index | innerSize () const |
Scalar & | insert (Index row, Index col) |
Scalar & | insertBack (Index row, Index col) |
Scalar & | insertBackByOuterInner (Index outer, Index inner) |
Index | nonZeros () const |
DynamicSparseMatrix & | operator= (const DynamicSparseMatrix &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)> | TransposedSparseMatrix |
Protected Attributes | |
std::vector < internal::CompressedStorage < Scalar, Index > > | m_data |
Index | m_innerSize |
A sparse matrix class designed for matrix assembly purpose.
_Scalar | the 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.
EIGEN_DEPRECATED DynamicSparseMatrix | ( | ) | [inline] |
The class DynamicSparseMatrix is deprectaed
References EIGEN_DEPRECATED.
EIGEN_DEPRECATED DynamicSparseMatrix | ( | Index | rows, |
Index | cols | ||
) | [inline] |
The class DynamicSparseMatrix is deprectaed
References EIGEN_DEPRECATED, and DynamicSparseMatrix< _Scalar, _Options, _Index >::resize().
EIGEN_DEPRECATED DynamicSparseMatrix | ( | const SparseMatrixBase< OtherDerived > & | other | ) | [inline, explicit] |
The class DynamicSparseMatrix is deprectaed
References SparseMatrixBase< Derived >::derived(), and EIGEN_DEPRECATED.
~DynamicSparseMatrix | ( | ) | [inline] |
Destructor
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::col(), SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::IsRowMajor, and SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::row().
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::col(), SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::IsRowMajor, and SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::row().
EIGEN_DEPRECATED void endFill | ( | ) | [inline] |
References EIGEN_DEPRECATED.
EIGEN_DEPRECATED Scalar& fill | ( | Index | row, |
Index | col | ||
) | [inline] |
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::col(), EIGEN_DEPRECATED, DynamicSparseMatrix< _Scalar, _Options, _Index >::insertBack(), SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::IsRowMajor, and SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::row().
EIGEN_DEPRECATED Scalar& fillrand | ( | Index | row, |
Index | col | ||
) | [inline] |
References EIGEN_DEPRECATED.
void finalize | ( | ) | [inline] |
Does nothing: provided for compatibility with SparseMatrix
Scalar& insertBack | ( | Index | row, |
Index | col | ||
) | [inline] |
References DynamicSparseMatrix< _Scalar, _Options, _Index >::insertBackByOuterInner(), and SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::IsRowMajor.
Referenced by DynamicSparseMatrix< _Scalar, _Options, _Index >::fill().
Scalar& insertBackByOuterInner | ( | Index | outer, |
Index | inner | ||
) | [inline] |
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::size().
Referenced by DynamicSparseMatrix< _Scalar, _Options, _Index >::insertBack().
Reimplemented from SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >.
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::size().
void prune | ( | Scalar | reference, |
RealScalar | epsilon = NumTraits<RealScalar>::dummy_precision() |
||
) | [inline] |
Suppress all nonzeros which are smaller than reference under the tolerence epsilon
Resize the matrix without preserving the data (the matrix is set to zero)
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::IsRowMajor.
Referenced by DynamicSparseMatrix< _Scalar, _Options, _Index >::DynamicSparseMatrix().
EIGEN_DEPRECATED void startFill | ( | Index | reserveSize = 1000 | ) | [inline] |
References EIGEN_DEPRECATED.
Does nothing: provided for compatibility with SparseMatrix