W3cubDocs

/Eigen3

Eigen::SparseMatrixBase

template<typename Derived>
class Eigen::SparseMatrixBase< Derived >

Base class of any sparse matrices or sparse expressions.

Template Parameters
Derived is the derived type, e.g. a sparse matrix type, or an expression, etc.

This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_SPARSEMATRIXBASE_PLUGIN.

enum {
RowsAtCompileTime ,
ColsAtCompileTime ,
SizeAtCompileTime ,
MaxRowsAtCompileTime ,
MaxColsAtCompileTime ,
MaxSizeAtCompileTime ,
IsVectorAtCompileTime ,
NumDimensions ,
Flags ,
IsRowMajor ,
InnerSizeAtCompileTime
}
typedef internal::traits< Derived >::StorageIndex StorageIndex
typedef Scalar value_type
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
The interface type of indices. More...
Index cols () const
const internal::eval< Derived >::type eval () const
Index innerSize () const
bool isVector () const
template<typename OtherDerived >
const Product< Derived, OtherDerived, AliasFreeProduct > operator* (const SparseMatrixBase< OtherDerived > &other) const
Index outerSize () const
const SparseView< Derived > pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
Index rows () const
Index size () const
SparseSymmetricPermutationProduct< Derived, Upper|Lower > twistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
- Public Member Functions inherited from Eigen::EigenBase< Derived >
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
Derived & derived ()
const Derived & derived () const
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT

StorageIndex

template<typename Derived >
typedef internal::traits<Derived>::StorageIndex Eigen::SparseMatrixBase< Derived >::StorageIndex

The integer type used to store indices within a SparseMatrix. For a SparseMatrix<Scalar,Options,IndexType> it an alias of the third template parameter IndexType.

value_type

template<typename Derived >
typedef Scalar Eigen::SparseMatrixBase< Derived >::value_type

The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc.

It is an alias for the Scalar type

anonymous enum

template<typename Derived >
anonymous enum
Enumerator
RowsAtCompileTime

The number of rows at compile-time. This is just a copy of the value provided by the Derived type. If a value is not known at compile-time, it is set to the Dynamic constant.

See also
MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime
ColsAtCompileTime

The number of columns at compile-time. This is just a copy of the value provided by the Derived type. If a value is not known at compile-time, it is set to the Dynamic constant.

See also
MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime
SizeAtCompileTime

This is equal to the number of coefficients, i.e. the number of rows times the number of columns, or to Dynamic if this is not known at compile-time.

See also
RowsAtCompileTime, ColsAtCompileTime
IsVectorAtCompileTime

This is set to true if either the number of rows or the number of columns is known at compile-time to be equal to 1. Indeed, in that case, we are dealing with a column-vector (if there is only one column) or with a row-vector (if there is only one row).

NumDimensions

This value is equal to Tensor::NumDimensions, i.e. 0 for scalars, 1 for vectors, and 2 for matrices.

Flags

This stores expression Flags flags which may or may not be inherited by new expressions constructed from this one. See the list of flags.

cols()

template<typename Derived >
Index Eigen::SparseMatrixBase< Derived >::cols ( void ) const
inline
Returns
the number of columns.
See also
rows()

eval()

template<typename Derived >
const internal::eval<Derived>::type Eigen::SparseMatrixBase< Derived >::eval ( ) const
inline
Returns
the matrix or vector obtained by evaluating this expression.

Notice that in the case of a plain matrix or vector (not an expression) this function just returns a const reference, in order to avoid a useless copy.

innerSize()

template<typename Derived >
Index Eigen::SparseMatrixBase< Derived >::innerSize ( ) const
inline
Returns
the size of the inner dimension according to the storage order, i.e., the number of rows for a columns major matrix, and the number of cols otherwise

isVector()

template<typename Derived >
bool Eigen::SparseMatrixBase< Derived >::isVector ( ) const
inline
Returns
true if either the number of rows or the number of columns is equal to 1. In other words, this function returns
rows()==1 || cols()==1 
See also
rows(), cols(), IsVectorAtCompileTime.

operator*()

template<typename Derived >
template<typename OtherDerived >
const Product< Derived, OtherDerived, AliasFreeProduct > Eigen::SparseMatrixBase< Derived >::operator* ( const SparseMatrixBase< OtherDerived > & other ) const
inline
Returns
an expression of the product of two sparse matrices. By default a conservative product preserving the symbolic non zeros is performed. The automatic pruning of the small values can be achieved by calling the pruned() function in which case a totally different product algorithm is employed:
C = (A*B).pruned();             // suppress numerical zeros (exact)
C = (A*B).pruned(ref);
C = (A*B).pruned(ref,epsilon);
where ref is a meaningful non zero reference value.

outerSize()

template<typename Derived >
Index Eigen::SparseMatrixBase< Derived >::outerSize ( ) const
inline
Returns
the size of the storage major dimension, i.e., the number of columns for a columns major matrix, and the number of rows otherwise

pruned()

template<typename Derived >
const SparseView< Derived > Eigen::SparseMatrixBase< Derived >::pruned ( const Scalar & reference = Scalar(0),
const RealScalar & epsilon = NumTraits<Scalar>::dummy_precision()
) const
inline
Returns
an expression of *this with values smaller than reference * epsilon removed.

This method is typically used in conjunction with the product of two sparse matrices to automatically prune the smallest values as follows:

C = (A*B).pruned();             // suppress numerical zeros (exact)
C = (A*B).pruned(ref);
C = (A*B).pruned(ref,epsilon);

where ref is a meaningful non zero reference value.

rows()

template<typename Derived >
Index Eigen::SparseMatrixBase< Derived >::rows ( void ) const
inline
Returns
the number of rows.
See also
cols()

size()

template<typename Derived >
Index Eigen::SparseMatrixBase< Derived >::size ( ) const
inline
Returns
the number of coefficients, which is rows()*cols().
See also
rows(), cols().

twistedBy()

template<typename Derived >
SparseSymmetricPermutationProduct<Derived,Upper|Lower> Eigen::SparseMatrixBase< Derived >::twistedBy ( const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & perm ) const
inline
Returns
an expression of P H P^-1 where H is the matrix represented by *this

The documentation for this class was generated from the following files: