Eigen  3.3.3
Eigen::SparseVector< _Scalar, _Options, _StorageIndex > Class Template Reference

Detailed Description

template<typename _Scalar, int _Options, typename _StorageIndex>
class Eigen::SparseVector< _Scalar, _Options, _StorageIndex >

a sparse vector class

Template Parameters:
_Scalarthe scalar type, i.e. the type of the coefficients

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 Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_SPARSEVECTOR_PLUGIN.

+ Inheritance diagram for Eigen::SparseVector< _Scalar, _Options, _StorageIndex >:

List of all members.

Public Member Functions

Scalar & coeffRef (Index i)
Index cols () const
void conservativeResize (Index newSize)
const StorageIndexinnerIndexPtr () const
StorageIndexinnerIndexPtr ()
const StorageIndexinnerNonZeroPtr () const
StorageIndexinnerNonZeroPtr ()
Index innerSize () const
Index nonZeros () const
const StorageIndexouterIndexPtr () const
StorageIndexouterIndexPtr ()
Index outerSize () const
void prune (const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision())
void resize (Index rows, Index cols)
void resize (Index newSize)
Index rows () const
Scalar sum () const
void swap (SparseVector &other)
const Scalar * valuePtr () const
Scalar * valuePtr ()
 ~SparseVector ()

Constructor & Destructor Documentation

template<typename _Scalar, int _Options, typename _StorageIndex>
Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::~SparseVector ( ) [inline]

Destructor


Member Function Documentation

template<typename _Scalar, int _Options, typename _StorageIndex>
Scalar& Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::coeffRef ( Index  i) [inline]
Returns:
a reference to the coefficient value at given index i This operation involes a log(rho*size) binary search. If the coefficient does not exist yet, then a sorted insertion into a sequential buffer is performed.

This insertion might be very costly if the number of nonzeros above i is large.

template<typename _Scalar, int _Options, typename _StorageIndex>
Index Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::cols ( void  ) const [inline]
Returns:
the number of columns.
See also:
rows()

Reimplemented from Eigen::SparseMatrixBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
void Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::conservativeResize ( Index  newSize) [inline]

Resizes the sparse vector to newSize, while leaving old values untouched.

If the size of the vector is decreased, then the storage of the out-of bounds coefficients is kept and reserved. Call .data().squeeze() to free extra memory.

See also:
reserve(), setZero()
template<typename _Scalar, int _Options, typename _StorageIndex>
const StorageIndex* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::innerIndexPtr ( ) const [inline]
Returns:
a const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
See also:
valuePtr(), outerIndexPtr()

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
StorageIndex* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::innerIndexPtr ( ) [inline]
Returns:
a non-const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
See also:
valuePtr(), outerIndexPtr()

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
const StorageIndex* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::innerNonZeroPtr ( ) const [inline]
Returns:
a const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
Warning:
it returns the null pointer 0 in compressed mode

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
StorageIndex* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::innerNonZeroPtr ( ) [inline]
Returns:
a non-const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
Warning:
it returns the null pointer 0 in compressed mode

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
Index Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::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

Reimplemented from Eigen::SparseMatrixBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
Index Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::nonZeros ( ) const [inline]
Returns:
the number of non zero coefficients

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
const StorageIndex* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::outerIndexPtr ( ) const [inline]
Returns:
a const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
Warning:
it returns the null pointer 0 for SparseVector
See also:
valuePtr(), innerIndexPtr()

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
StorageIndex* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::outerIndexPtr ( ) [inline]
Returns:
a non-const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
Warning:
it returns the null pointer 0 for SparseVector
See also:
valuePtr(), innerIndexPtr()

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
Index Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::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

Reimplemented from Eigen::SparseMatrixBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
void Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::prune ( const Scalar &  reference,
const RealScalar &  epsilon = NumTraits<RealScalar>::dummy_precision() 
) [inline]

Suppresses all nonzeros which are much smaller than reference under the tolerence epsilon

template<typename _Scalar, int _Options, typename _StorageIndex>
void Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::resize ( Index  rows,
Index  cols 
) [inline]

Resizes the sparse vector to rows x cols

This method is provided for compatibility with matrices. For a column vector, cols must be equal to 1. For a row vector, rows must be equal to 1.

See also:
resize(Index)
template<typename _Scalar, int _Options, typename _StorageIndex>
void Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::resize ( Index  newSize) [inline]

Resizes the sparse vector to newSize This method deletes all entries, thus leaving an empty sparse vector

See also:
conservativeResize(), setZero()
template<typename _Scalar, int _Options, typename _StorageIndex>
Index Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::rows ( void  ) const [inline]
Returns:
the number of rows.
See also:
cols()

Reimplemented from Eigen::SparseMatrixBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar , int _Options, typename _Index >
internal::traits< SparseVector< _Scalar, _Options, _Index > >::Scalar Eigen::SparseVector< _Scalar, _Options, _Index >::sum ( ) const
template<typename _Scalar, int _Options, typename _StorageIndex>
void Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::swap ( SparseVector< _Scalar, _Options, _StorageIndex > &  other) [inline]

Swaps the values of *this and other. Overloaded for performance: this version performs a shallow swap by swaping pointers and attributes only.

See also:
SparseMatrixBase::swap()
template<typename _Scalar, int _Options, typename _StorageIndex>
const Scalar* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::valuePtr ( ) const [inline]
Returns:
a const pointer to the array of values. This function is aimed at interoperability with other libraries.
See also:
innerIndexPtr(), outerIndexPtr()

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.

template<typename _Scalar, int _Options, typename _StorageIndex>
Scalar* Eigen::SparseVector< _Scalar, _Options, _StorageIndex >::valuePtr ( ) [inline]
Returns:
a non-const pointer to the array of values. This function is aimed at interoperability with other libraries.
See also:
innerIndexPtr(), outerIndexPtr()

Reimplemented from Eigen::SparseCompressedBase< SparseVector< _Scalar, _Options, _StorageIndex > >.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends