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 () | |
![]() | |
const CwiseBinaryOp < CustomBinaryOp, const DynamicSparseMatrix< _Scalar, _Options, _Index >, const OtherDerived > | binaryExpr (const Eigen::SparseMatrixBase< OtherDerived > &other, const CustomBinaryOp &func=CustomBinaryOp()) const |
internal::cast_return_type < DynamicSparseMatrix< _Scalar, _Options, _Index >, const CwiseUnaryOp < internal::scalar_cast_op < typename internal::traits < DynamicSparseMatrix< _Scalar, _Options, _Index > >::Scalar, NewType >, const DynamicSparseMatrix< _Scalar, _Options, _Index > > >::type | cast () const |
const SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, 1 > | col (Index j) const |
SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, 1 > | col (Index j) |
Index | cols () const |
ConjugateReturnType | conjugate () const |
const CwiseUnaryOp < internal::scalar_abs_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index > > | cwiseAbs () const |
const CwiseUnaryOp < internal::scalar_abs2_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index > > | cwiseAbs2 () const |
const CwiseBinaryOp < std::equal_to< Scalar > , const DynamicSparseMatrix < _Scalar, _Options, _Index > , const OtherDerived > | cwiseEqual (const Eigen::SparseMatrixBase< OtherDerived > &other) const |
const CwiseUnaryOp < std::binder1st < std::equal_to< Scalar > >, const DynamicSparseMatrix < _Scalar, _Options, _Index > > | cwiseEqual (const Scalar &s) const |
const CwiseUnaryOp < internal::scalar_inverse_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index > > | cwiseInverse () const |
const CwiseBinaryOp < internal::scalar_max_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index >, const OtherDerived > | cwiseMax (const Eigen::SparseMatrixBase< OtherDerived > &other) const |
const CwiseBinaryOp < internal::scalar_max_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index >, const ConstantReturnType > | cwiseMax (const Scalar &other) const |
const CwiseBinaryOp < internal::scalar_min_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index >, const OtherDerived > | cwiseMin (const Eigen::SparseMatrixBase< OtherDerived > &other) const |
const CwiseBinaryOp < internal::scalar_min_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index >, const ConstantReturnType > | cwiseMin (const Scalar &other) const |
const CwiseBinaryOp < std::not_equal_to< Scalar > , const DynamicSparseMatrix < _Scalar, _Options, _Index > , const OtherDerived > | cwiseNotEqual (const Eigen::SparseMatrixBase< OtherDerived > &other) const |
const CwiseBinaryOp < internal::scalar_quotient_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index >, const OtherDerived > | cwiseQuotient (const Eigen::SparseMatrixBase< OtherDerived > &other) const |
const CwiseUnaryOp < internal::scalar_sqrt_op < Scalar >, const DynamicSparseMatrix< _Scalar, _Options, _Index > > | cwiseSqrt () const |
DynamicSparseMatrix< _Scalar, _Options, _Index > & | derived () |
const DynamicSparseMatrix < _Scalar, _Options, _Index > & | derived () const |
const | EIGEN_CWISE_PRODUCT_RETURN_TYPE (DynamicSparseMatrix< _Scalar, _Options, _Index >, OtherDerived) cwiseProduct(const Eigen |
const internal::eval < DynamicSparseMatrix< _Scalar, _Options, _Index > >::type | eval () const |
const ImagReturnType | imag () const |
NonConstImagReturnType | imag () |
Index | innerSize () const |
SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, 1 > | innerVector (Index outer) |
const SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, 1 > | innerVector (Index outer) const |
SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, Dynamic > | innerVectors (Index outerStart, Index outerSize) |
const SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, Dynamic > | innerVectors (Index outerStart, Index outerSize) const |
bool | isVector () const |
const SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, Dynamic > | middleCols (Index start, Index size) const |
SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, Dynamic > | middleCols (Index start, Index size) |
SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, Dynamic > | middleRows (Index start, Index size) |
const SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, Dynamic > | middleRows (Index start, Index size) const |
Index | nonZeros () const |
const CwiseUnaryOp < internal::scalar_multiple2_op < Scalar, std::complex< Scalar > >, const DynamicSparseMatrix < _Scalar, _Options, _Index > > | operator* (const std::complex< Scalar > &scalar) const |
const ScalarMultipleReturnType | operator* (const Scalar &scalar) const |
const SparseSparseProductReturnType < DynamicSparseMatrix< _Scalar, _Options, _Index > , OtherDerived >::Type | operator* (const SparseMatrixBase< OtherDerived > &other) const |
const SparseDenseProductReturnType < DynamicSparseMatrix< _Scalar, _Options, _Index > , OtherDerived >::Type | operator* (const MatrixBase< OtherDerived > &other) const |
const CwiseUnaryOp < internal::scalar_opposite_op < typename internal::traits < DynamicSparseMatrix< _Scalar, _Options, _Index > >::Scalar > , const DynamicSparseMatrix < _Scalar, _Options, _Index > > | operator- () const |
const CwiseUnaryOp < internal::scalar_quotient1_op < typename internal::traits < DynamicSparseMatrix< _Scalar, _Options, _Index > >::Scalar > , const DynamicSparseMatrix < _Scalar, _Options, _Index > > | operator/ (const Scalar &scalar) const |
Index | outerSize () const |
NonConstRealReturnType | real () |
RealReturnType | real () const |
SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, 1 > | row (Index i) |
const SparseInnerVectorSet < DynamicSparseMatrix< _Scalar, _Options, _Index >, 1 > | row (Index i) const |
Index | rows () const |
Index | size () const |
SparseSymmetricPermutationProduct < DynamicSparseMatrix< _Scalar, _Options, _Index >, Upper|Lower > | twistedBy (const PermutationMatrix< Dynamic, Dynamic, Index > &perm) const |
const CwiseUnaryOp < CustomUnaryOp, const DynamicSparseMatrix< _Scalar, _Options, _Index > > | unaryExpr (const CustomUnaryOp &func=CustomUnaryOp()) const |
const CwiseUnaryView < CustomViewOp, const DynamicSparseMatrix< _Scalar, _Options, _Index > > | unaryViewExpr (const CustomViewOp &func=CustomViewOp()) const |
![]() | |
Index | cols () const |
Derived & | derived () |
const Derived & | derived () const |
Index | rows () const |
Index | size () const |
Protected Types | |
typedef DynamicSparseMatrix < Scalar,(Flags &~RowMajorBit)|(IsRowMajor?RowMajorBit:0)> | TransposedSparseMatrix |
Protected Attributes | |
std::vector < internal::CompressedStorage < Scalar, Index > > | m_data |
Index | m_innerSize |
Additional Inherited Members | |
![]() | |
CoeffReadCost | |
ColsAtCompileTime | |
Flags | |
IsVectorAtCompileTime | |
RowsAtCompileTime | |
SizeAtCompileTime | |
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.
|
inline |
The class DynamicSparseMatrix is deprectaed
|
inline |
The class DynamicSparseMatrix is deprectaed
References DynamicSparseMatrix< _Scalar, _Options, _Index >::resize().
|
inlineexplicit |
The class DynamicSparseMatrix is deprectaed
References SparseMatrixBase< Derived >::derived().
|
inline |
Destructor
|
inline |
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::col(), and SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::row().
|
inline |
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::col(), and SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::row().
|
inline |
|
inline |
|
inline |
|
inline |
Does nothing: provided for compatibility with SparseMatrix
|
inline |
References DynamicSparseMatrix< _Scalar, _Options, _Index >::insertBackByOuterInner().
Referenced by DynamicSparseMatrix< _Scalar, _Options, _Index >::fill().
|
inline |
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::size().
Referenced by DynamicSparseMatrix< _Scalar, _Options, _Index >::insertBack().
|
inline |
References SparseMatrixBase< DynamicSparseMatrix< _Scalar, _Options, _Index > >::size().
|
inline |
Suppress all nonzeros which are smaller than reference under the tolerence epsilon
|
inline |
Resize the matrix without preserving the data (the matrix is set to zero)
Referenced by DynamicSparseMatrix< _Scalar, _Options, _Index >::DynamicSparseMatrix().
|
inline |
|
inline |
Does nothing: provided for compatibility with SparseMatrix