Sparse linear algebra » Reference » SparseCore module module

Contents

This module provides a sparse matrix representation, and basic associated matrix manipulations and operations.

See the Sparse tutorial

#include <Eigen/SparseCore>

This module depends on: Core.

Classes

template<typename SparseMatrixType>
class Eigen::Map<SparseMatrixType>
Specialization of class Map for SparseMatrix-like storage.
template<typename SparseMatrixType, int Options>
class Eigen::Ref<SparseMatrixType, Options>
A sparse matrix expression referencing an existing sparse expression.
template<typename SparseVectorType>
class Eigen::Ref<SparseVectorType>
A sparse vector expression referencing an existing sparse vector expression.
template<typename Derived>
class Eigen::SparseCompressedBase
Common base class for sparse [compressed]-{row|column}-storage format.
template<typename Derived>
class Eigen::SparseMapBase<Derived, ReadOnlyAccessors>
Common base class for Map and Ref instance of sparse matrix and vector.
template<typename Derived>
class Eigen::SparseMapBase<Derived, WriteAccessors>
Common base class for writable Map and Ref instance of sparse matrix and vector.
template<typename _Scalar, int _Options, typename _StorageIndex>
class Eigen::SparseMatrix
A versatible sparse matrix representation.
template<typename Derived>
class Eigen::SparseMatrixBase
Base class of any sparse matrices or sparse expressions.
template<typename MatrixType, unsigned int _Mode>
class Eigen::SparseSelfAdjointView
Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.
template<typename Derived>
class Eigen::SparseSolverBase
A base class for sparse solvers.
template<typename _Scalar, int _Options, typename _StorageIndex>
class Eigen::SparseVector
a sparse vector class
template<typename MatrixType>
class Eigen::SparseView
Expression of a dense or sparse matrix with zero or too small values removed.
template<typename MatrixType, unsigned int Mode>
class Eigen::TriangularViewImpl<MatrixType, Mode, Sparse>
Base class for a triangular part in a sparse matrix.
template<typename Scalar, typename StorageIndex = typename SparseMatrix<Scalar>::StorageIndex>
class Eigen::Triplet
A small structure to hold a non zero as a triplet (i,j,value).

Functions

auto sparseView(const Scalar& m_reference = Scalar(0), const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const -> const SparseView<Derived>

Function documentation

const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0), const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const

Returns a sparse expression of the dense expression *this with values smaller than reference * epsilon removed.

This method is typically used when prototyping to convert a quickly assembled dense Matrix D to a SparseMatrix S:

MatrixXd D(n,m);
SparseMatrix<double> S;
S = D.sparseView();             // suppress numerical zeros (exact)
S = D.sparseView(reference);
S = D.sparseView(reference,epsilon);

where reference is a meaningful non zero reference value, and epsilon is a tolerance factor defaulting to NumTraits<Scalar>::dummy_precision().