The main sparse matrix class. More...
#include <SparseMatrix.h>
The main sparse matrix class.
This class implements a sparse matrix using the very common compressed row/column storage scheme.
_Scalar | the scalar type, i.e. the type of the coefficients |
_Options | Union of bit flags controlling the storage scheme. Currently the only possibility is RowMajor. The default is 0 which means column-major. |
_Index | the type of the indices. Default is int . |
See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme.
This class can be extended with the help of the plugin mechanism described on the page Customizing/Extending Eigen by defining the preprocessor symbol EIGEN_SPARSEMATRIX_PLUGIN
.
Definition at line 70 of file SparseMatrix.h.
typedef MappedSparseMatrix<Scalar,Flags> SparseMatrix< _Scalar, _Options, _Index >::Map |
Definition at line 82 of file SparseMatrix.h.
typedef CompressedStorage<Scalar,Index> SparseMatrix< _Scalar, _Options, _Index >::Storage |
Definition at line 84 of file SparseMatrix.h.
typedef SparseMatrix<Scalar,(Flags&~RowMajorBit)|(IsRowMajor?RowMajorBit:0)> SparseMatrix< _Scalar, _Options, _Index >::TransposedSparseMatrix [protected] |
Definition at line 91 of file SparseMatrix.h.
anonymous enum |
Definition at line 85 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Options, _Index >::SparseMatrix | ( | ) | [inline] |
Default constructor yielding an empty 0
x
0
matrix
Definition at line 399 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Options, _Index >::SparseMatrix | ( | Index | rows, |
Index | cols | ||
) | [inline] |
Constructs a rows x
cols empty matrix
Definition at line 406 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Options, _Index >::SparseMatrix | ( | const SparseMatrixBase< OtherDerived > & | other | ) | [inline] |
Constructs a sparse matrix from the sparse expression other
Definition at line 414 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Options, _Index >::SparseMatrix | ( | const SparseMatrix< _Scalar, _Options, _Index > & | other | ) | [inline] |
Copy constructor
Definition at line 421 of file SparseMatrix.h.
SparseMatrix< _Scalar, _Options, _Index >::~SparseMatrix | ( | ) | [inline] |
Destructor
Definition at line 544 of file SparseMatrix.h.
const Index* SparseMatrix< _Scalar, _Options, _Index >::_innerIndexPtr | ( | ) | const [inline] |
Definition at line 110 of file SparseMatrix.h.
Index* SparseMatrix< _Scalar, _Options, _Index >::_innerIndexPtr | ( | ) | [inline] |
Definition at line 111 of file SparseMatrix.h.
const Index* SparseMatrix< _Scalar, _Options, _Index >::_outerIndexPtr | ( | ) | const [inline] |
Definition at line 113 of file SparseMatrix.h.
Index* SparseMatrix< _Scalar, _Options, _Index >::_outerIndexPtr | ( | ) | [inline] |
Definition at line 114 of file SparseMatrix.h.
const Scalar* SparseMatrix< _Scalar, _Options, _Index >::_valuePtr | ( | ) | const [inline] |
Definition at line 107 of file SparseMatrix.h.
Scalar* SparseMatrix< _Scalar, _Options, _Index >::_valuePtr | ( | ) | [inline] |
Definition at line 108 of file SparseMatrix.h.
Scalar SparseMatrix< _Scalar, _Options, _Index >::coeff | ( | Index | row, |
Index | col | ||
) | const [inline] |
Definition at line 119 of file SparseMatrix.h.
Scalar& SparseMatrix< _Scalar, _Options, _Index >::coeffRef | ( | Index | row, |
Index | col | ||
) | [inline] |
Definition at line 126 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::cols | ( | void | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 101 of file SparseMatrix.h.
Storage& SparseMatrix< _Scalar, _Options, _Index >::data | ( | ) | [inline] |
Definition at line 116 of file SparseMatrix.h.
const Storage& SparseMatrix< _Scalar, _Options, _Index >::data | ( | ) | const [inline] |
Definition at line 117 of file SparseMatrix.h.
EIGEN_DEPRECATED void SparseMatrix< _Scalar, _Options, _Index >::endFill | ( | ) | [inline] |
Definition at line 605 of file SparseMatrix.h.
EIGEN_DEPRECATED Scalar& SparseMatrix< _Scalar, _Options, _Index >::fill | ( | Index | row, |
Index | col | ||
) | [inline] |
Definition at line 575 of file SparseMatrix.h.
EIGEN_DEPRECATED Scalar& SparseMatrix< _Scalar, _Options, _Index >::fillrand | ( | Index | row, |
Index | col | ||
) | [inline] |
Definition at line 568 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::finalize | ( | ) | [inline] |
Must be called after inserting a set of non zero entries.
Definition at line 323 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::innerNonZeros | ( | Index | j | ) | const [inline] |
Definition at line 105 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::innerSize | ( | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 103 of file SparseMatrix.h.
EIGEN_DONT_INLINE Scalar& SparseMatrix< _Scalar, _Options, _Index >::insert | ( | Index | row, |
Index | col | ||
) | [inline] |
After an insertion session, you should call the finalize() function.
Definition at line 214 of file SparseMatrix.h.
Scalar& SparseMatrix< _Scalar, _Options, _Index >::insertBack | ( | Index | row, |
Index | col | ||
) | [inline] |
Before filling a given inner vector you must call the statVec(Index) function.
After an insertion session, you should call the finalize() function.
Definition at line 171 of file SparseMatrix.h.
Scalar& SparseMatrix< _Scalar, _Options, _Index >::insertBackByOuterInner | ( | Index | outer, |
Index | inner | ||
) | [inline] |
Definition at line 177 of file SparseMatrix.h.
Scalar& SparseMatrix< _Scalar, _Options, _Index >::insertBackByOuterInnerUnordered | ( | Index | outer, |
Index | inner | ||
) | [inline] |
Definition at line 188 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::nonZeros | ( | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 152 of file SparseMatrix.h.
SparseMatrix& SparseMatrix< _Scalar, _Options, _Index >::operator= | ( | const SparseMatrix< _Scalar, _Options, _Index > & | other | ) | [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 437 of file SparseMatrix.h.
SparseMatrix& SparseMatrix< _Scalar, _Options, _Index >::operator= | ( | const SparseSparseProduct< Lhs, Rhs > & | product | ) | [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 455 of file SparseMatrix.h.
SparseMatrix& SparseMatrix< _Scalar, _Options, _Index >::operator= | ( | const ReturnByValue< OtherDerived > & | other | ) | [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 459 of file SparseMatrix.h.
SparseMatrix& SparseMatrix< _Scalar, _Options, _Index >::operator= | ( | const EigenBase< OtherDerived > & | other | ) | [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 463 of file SparseMatrix.h.
EIGEN_DONT_INLINE SparseMatrix& SparseMatrix< _Scalar, _Options, _Index >::operator= | ( | const SparseMatrixBase< OtherDerived > & | other | ) | [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 468 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::outerSize | ( | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 104 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::prune | ( | Scalar | reference, |
RealScalar | epsilon = NumTraits<RealScalar>::dummy_precision() |
||
) | [inline] |
Suppress all nonzeros which are smaller than reference under the tolerence epsilon
Definition at line 339 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::prune | ( | const KeepFunc & | keep = KeepFunc() | ) | [inline] |
Suppress all nonzeros which do not satisfy the predicate keep. The functor type KeepFunc must implement the following function:
Definition at line 352 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::reserve | ( | Index | reserveSize | ) | [inline] |
Preallocates reserveSize non zeros
Definition at line 155 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::resize | ( | Index | rows, |
Index | cols | ||
) | [inline] |
Resizes the matrix to a rows x cols matrix and initializes it to zero
Definition at line 377 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::resizeNonZeros | ( | Index | size | ) | [inline] |
Low level API Resize the nonzero vector to size
Definition at line 393 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::rows | ( | void | ) | const [inline] |
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 100 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::setZero | ( | ) | [inline] |
Removes all non zeros
Definition at line 145 of file SparseMatrix.h.
EIGEN_DEPRECATED void SparseMatrix< _Scalar, _Options, _Index >::startFill | ( | Index | reserveSize = 1000 | ) | [inline] |
*this
. reserveSize | approximate number of nonzeros Note that the matrix *this is zero-ed. |
Definition at line 559 of file SparseMatrix.h.
void SparseMatrix< _Scalar, _Options, _Index >::startVec | ( | Index | outer | ) | [inline] |
Definition at line 197 of file SparseMatrix.h.
internal::traits< SparseMatrix< _Scalar, _Options, _Index > >::Scalar SparseMatrix< _Scalar, _Options, _Index >::sum | ( | ) | const |
Overloaded for performance
Reimplemented from SparseMatrixBase< SparseMatrix< _Scalar, _Options, _Index > >.
Definition at line 42 of file SparseRedux.h.
void SparseMatrix< _Scalar, _Options, _Index >::swap | ( | SparseMatrix< _Scalar, _Options, _Index > & | other | ) | [inline] |
Swap the content of two sparse matrices of same type (optimization)
Definition at line 428 of file SparseMatrix.h.
std::ostream& operator<< | ( | std::ostream & | s, |
const SparseMatrix< _Scalar, _Options, _Index > & | m | ||
) | [friend] |
Definition at line 521 of file SparseMatrix.h.
CompressedStorage<Scalar,Index> SparseMatrix< _Scalar, _Options, _Index >::m_data [protected] |
Definition at line 96 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::m_innerSize [protected] |
Definition at line 94 of file SparseMatrix.h.
Index* SparseMatrix< _Scalar, _Options, _Index >::m_outerIndex [protected] |
Definition at line 95 of file SparseMatrix.h.
Index SparseMatrix< _Scalar, _Options, _Index >::m_outerSize [protected] |
Definition at line 93 of file SparseMatrix.h.