SparseMatrix< _Scalar, _Options, _Index > Class Template Reference
[Sparse module]
The main sparse matrix class.
More...
List of all members.
Detailed Description
template<typename _Scalar, int _Options, typename _Index>
class Eigen::SparseMatrix< _Scalar, _Options, _Index >
The main sparse matrix class.
This class implements a sparse matrix using the very common compressed row/column storage scheme.
- Template Parameters:
-
| _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
.
Constructor & Destructor Documentation
Default constructor yielding an empty 0
x
0
matrix
Constructs a rows x
cols empty matrix
Constructs a sparse matrix from the sparse expression other
Member Function Documentation
Index cols |
( |
void |
|
) |
const [inline] |
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] |
Must be called after inserting a set of non zero entries.
Index innerSize |
( |
|
) |
const [inline] |
EIGEN_DONT_INLINE Scalar& insert |
( |
Index |
row, |
|
|
Index |
col | |
|
) |
| | [inline] |
- Returns:
- a reference to a novel non zero coefficient with coordinates row x col. The non zero coefficient must not already exist.
- Warning:
- This function can be extremely slow if the non zero coefficients are not inserted in a coherent order.
After an insertion session, you should call the finalize() function.
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 according to the storage order
Before filling a given inner vector you must call the statVec(Index) function.
After an insertion session, you should call the finalize() function.
- See also:
- insert, insertBackByOuterInner, startVec
Scalar& insertBackByOuterInner |
( |
Index |
outer, |
|
|
Index |
inner | |
|
) |
| | [inline] |
Scalar& insertBackByOuterInnerUnordered |
( |
Index |
outer, |
|
|
Index |
inner | |
|
) |
| | [inline] |
- Warning:
- use it only if you know what you are doing
Index nonZeros |
( |
|
) |
const [inline] |
Index outerSize |
( |
|
) |
const [inline] |
void 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:
bool operator() (const Index& row, const Index& col, const Scalar& value) const;
- See also:
- prune(Scalar,RealScalar)
void prune |
( |
Scalar |
reference, |
|
|
RealScalar |
epsilon = NumTraits<RealScalar>::dummy_precision() | |
|
) |
| | [inline] |
Suppress all nonzeros which are smaller than reference under the tolerence epsilon
void reserve |
( |
Index |
reserveSize |
) |
[inline] |
Preallocates reserveSize non zeros
void resize |
( |
Index |
rows, |
|
|
Index |
cols | |
|
) |
| | [inline] |
void resizeNonZeros |
( |
Index |
size |
) |
[inline] |
Low level API Resize the nonzero vector to size
Index rows |
( |
void |
|
) |
const [inline] |
void setZero |
( |
|
) |
[inline] |
EIGEN_DEPRECATED void startFill |
( |
Index |
reserveSize = 1000 |
) |
[inline] |
- Parameters:
-
| reserveSize | approximate number of nonzeros Note that the matrix *this is zero-ed. |
void startVec |
( |
Index |
outer |
) |
[inline] |
internal::traits< SparseMatrix< _Scalar, _Options, _Index > >::Scalar sum |
( |
|
) |
const [inline] |
void swap |
( |
SparseMatrix< _Scalar, _Options, _Index > & |
other |
) |
[inline] |
Swap the content of two sparse matrices of same type (optimization)
The documentation for this class was generated from the following file: