Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Friends | List of all members
Eigen::SparseVector Class Reference

a sparse vector class More...

#include <SparseUtil.h>

Public Types

enum  { IsColVector = internal::traits<SparseVector>::IsColVector }
 
enum  { Options = _Options }
 
typedef Base::InnerIterator InnerIterator
 
typedef Base::ReverseInnerIterator ReverseInnerIterator
 
typedef internal::CompressedStorage< Scalar, StorageIndex > Storage
 

Public Member Functions

EIGEN_DEPRECATED Storage_data ()
 
const EIGEN_DEPRECATED Storage_data () const
 
Scalar coeff (Index i) const
 
Scalar coeff (Index row, Index col) const
 
ScalarcoeffRef (Index i)
 
ScalarcoeffRef (Index row, Index col)
 
EIGEN_STRONG_INLINE Index cols () const
 
void conservativeResize (Index newSize)
 
Storagedata ()
 
const Storagedata () const
 
EIGEN_DEPRECATED void endFill ()
 
EIGEN_DEPRECATED Scalarfill (Index i)
 
EIGEN_DEPRECATED Scalarfill (Index r, Index c)
 
EIGEN_DEPRECATED Scalarfillrand (Index i)
 
EIGEN_DEPRECATED Scalarfillrand (Index r, Index c)
 
void finalize ()
 
EIGEN_STRONG_INLINE StorageIndex * innerIndexPtr ()
 
const EIGEN_STRONG_INLINE StorageIndex * innerIndexPtr () const
 
StorageIndex * innerNonZeroPtr ()
 
const StorageIndex * innerNonZeroPtr () const
 
EIGEN_STRONG_INLINE Index innerSize () const
 
Scalarinsert (Index i)
 
Scalarinsert (Index row, Index col)
 
ScalarinsertBack (Index i)
 
ScalarinsertBackByOuterInner (Index outer, Index inner)
 
ScalarinsertBackByOuterInnerUnordered (Index outer, Index inner)
 
ScalarinsertBackUnordered (Index i)
 
Index nonZeros () const
 
template<typename OtherDerived >
SparseVectoroperator= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename Lhs , typename Rhs >
SparseVectoroperator= (const SparseSparseProduct< Lhs, Rhs > &product)
 
SparseVectoroperator= (const SparseVector &other)
 
StorageIndex * outerIndexPtr ()
 
const StorageIndex * outerIndexPtr () const
 
EIGEN_STRONG_INLINE Index outerSize () const
 
void prune (const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision())
 
void reserve (Index reserveSize)
 
void resize (Index newSize)
 
void resize (Index rows, Index cols)
 
void resizeNonZeros (Index size)
 
EIGEN_STRONG_INLINE Index rows () const
 
void setZero ()
 
 SparseVector ()
 
template<typename OtherDerived >
 SparseVector (const SparseMatrixBase< OtherDerived > &other)
 
 SparseVector (const SparseVector &other)
 
 SparseVector (Index rows, Index cols)
 
 SparseVector (Index size)
 
EIGEN_DEPRECATED void startFill (Index reserve)
 
void startVec (Index outer)
 
Scalar sum () const
 
template<int OtherOptions>
void swap (SparseMatrix< Scalar, OtherOptions, StorageIndex > &other)
 
void swap (SparseVector &other)
 
EIGEN_STRONG_INLINE ScalarvaluePtr ()
 
const EIGEN_STRONG_INLINE ScalarvaluePtr () const
 
 ~SparseVector ()
 

Static Protected Member Functions

static void check_template_parameters ()
 

Protected Attributes

Storage m_data
 
Index m_size
 

Private Types

typedef SparseCompressedBase< SparseVectorBase
 

Friends

std::ostream & operator<< (std::ostream &s, const SparseVector &m)
 

Detailed Description

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.

Definition at line 54 of file SparseUtil.h.

Member Typedef Documentation

◆ Base

Definition at line 67 of file SparseVector.h.

◆ InnerIterator

Definition at line 134 of file SparseVector.h.

◆ ReverseInnerIterator

Definition at line 135 of file SparseVector.h.

◆ Storage

Definition at line 74 of file SparseVector.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
IsColVector 

Definition at line 75 of file SparseVector.h.

◆ anonymous enum

anonymous enum
Enumerator
Options 

Definition at line 77 of file SparseVector.h.

Constructor & Destructor Documentation

◆ SparseVector() [1/5]

Eigen::SparseVector::SparseVector ( )
inline

Definition at line 259 of file SparseVector.h.

◆ SparseVector() [2/5]

Eigen::SparseVector::SparseVector ( Index  size)
inlineexplicit

Definition at line 261 of file SparseVector.h.

◆ SparseVector() [3/5]

Eigen::SparseVector::SparseVector ( Index  rows,
Index  cols 
)
inline

Definition at line 263 of file SparseVector.h.

◆ SparseVector() [4/5]

template<typename OtherDerived >
Eigen::SparseVector::SparseVector ( const SparseMatrixBase< OtherDerived > &  other)
inline

Definition at line 266 of file SparseVector.h.

◆ SparseVector() [5/5]

Eigen::SparseVector::SparseVector ( const SparseVector other)
inline

Definition at line 276 of file SparseVector.h.

◆ ~SparseVector()

Eigen::SparseVector::~SparseVector ( )
inline

Destructor

Definition at line 341 of file SparseVector.h.

Member Function Documentation

◆ _data() [1/2]

EIGEN_DEPRECATED Storage& Eigen::SparseVector::_data ( )
inline

Definition at line 387 of file SparseVector.h.

◆ _data() [2/2]

const EIGEN_DEPRECATED Storage& Eigen::SparseVector::_data ( ) const
inline

Definition at line 389 of file SparseVector.h.

◆ check_template_parameters()

static void Eigen::SparseVector::check_template_parameters ( )
inlinestaticprotected

Definition at line 397 of file SparseVector.h.

◆ coeff() [1/2]

Scalar Eigen::SparseVector::coeff ( Index  i) const
inline

Definition at line 107 of file SparseVector.h.

◆ coeff() [2/2]

Scalar Eigen::SparseVector::coeff ( Index  row,
Index  col 
) const
inline

Definition at line 102 of file SparseVector.h.

◆ coeffRef() [1/2]

Scalar& Eigen::SparseVector::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.

Definition at line 125 of file SparseVector.h.

◆ coeffRef() [2/2]

Scalar& Eigen::SparseVector::coeffRef ( Index  row,
Index  col 
)
inline

Definition at line 113 of file SparseVector.h.

◆ cols()

EIGEN_STRONG_INLINE Index Eigen::SparseVector::cols ( ) const
inline

Definition at line 82 of file SparseVector.h.

◆ conservativeResize()

void Eigen::SparseVector::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()

Definition at line 246 of file SparseVector.h.

◆ data() [1/2]

Storage& Eigen::SparseVector::data ( )
inline

Definition at line 98 of file SparseVector.h.

◆ data() [2/2]

const Storage& Eigen::SparseVector::data ( ) const
inline

Definition at line 100 of file SparseVector.h.

◆ endFill()

EIGEN_DEPRECATED void Eigen::SparseVector::endFill ( )
inline

Definition at line 383 of file SparseVector.h.

◆ fill() [1/2]

EIGEN_DEPRECATED Scalar& Eigen::SparseVector::fill ( Index  i)
inline

Definition at line 363 of file SparseVector.h.

◆ fill() [2/2]

EIGEN_DEPRECATED Scalar& Eigen::SparseVector::fill ( Index  r,
Index  c 
)
inline

Definition at line 356 of file SparseVector.h.

◆ fillrand() [1/2]

EIGEN_DEPRECATED Scalar& Eigen::SparseVector::fillrand ( Index  i)
inline

Definition at line 377 of file SparseVector.h.

◆ fillrand() [2/2]

EIGEN_DEPRECATED Scalar& Eigen::SparseVector::fillrand ( Index  r,
Index  c 
)
inline

Definition at line 370 of file SparseVector.h.

◆ finalize()

void Eigen::SparseVector::finalize ( )
inline

Definition at line 207 of file SparseVector.h.

◆ innerIndexPtr() [1/2]

EIGEN_STRONG_INLINE StorageIndex* Eigen::SparseVector::innerIndexPtr ( )
inline

Definition at line 90 of file SparseVector.h.

◆ innerIndexPtr() [2/2]

const EIGEN_STRONG_INLINE StorageIndex* Eigen::SparseVector::innerIndexPtr ( ) const
inline

Definition at line 89 of file SparseVector.h.

◆ innerNonZeroPtr() [1/2]

StorageIndex* Eigen::SparseVector::innerNonZeroPtr ( )
inline

Definition at line 95 of file SparseVector.h.

◆ innerNonZeroPtr() [2/2]

const StorageIndex* Eigen::SparseVector::innerNonZeroPtr ( ) const
inline

Definition at line 94 of file SparseVector.h.

◆ innerSize()

EIGEN_STRONG_INLINE Index Eigen::SparseVector::innerSize ( ) const
inline

Definition at line 83 of file SparseVector.h.

◆ insert() [1/2]

Scalar& Eigen::SparseVector::insert ( Index  i)
inline

Definition at line 182 of file SparseVector.h.

◆ insert() [2/2]

Scalar& Eigen::SparseVector::insert ( Index  row,
Index  col 
)
inline

Definition at line 172 of file SparseVector.h.

◆ insertBack()

Scalar& Eigen::SparseVector::insertBack ( Index  i)
inline

Definition at line 154 of file SparseVector.h.

◆ insertBackByOuterInner()

Scalar& Eigen::SparseVector::insertBackByOuterInner ( Index  outer,
Index  inner 
)
inline

Definition at line 148 of file SparseVector.h.

◆ insertBackByOuterInnerUnordered()

Scalar& Eigen::SparseVector::insertBackByOuterInnerUnordered ( Index  outer,
Index  inner 
)
inline

Definition at line 160 of file SparseVector.h.

◆ insertBackUnordered()

Scalar& Eigen::SparseVector::insertBackUnordered ( Index  i)
inline

Definition at line 166 of file SparseVector.h.

◆ nonZeros()

Index Eigen::SparseVector::nonZeros ( ) const
inline
Returns
the number of non zero coefficients

Definition at line 140 of file SparseVector.h.

◆ operator=() [1/3]

template<typename OtherDerived >
SparseVector& Eigen::SparseVector::operator= ( const SparseMatrixBase< OtherDerived > &  other)
inline

Definition at line 316 of file SparseVector.h.

◆ operator=() [2/3]

template<typename Lhs , typename Rhs >
SparseVector& Eigen::SparseVector::operator= ( const SparseSparseProduct< Lhs, Rhs > &  product)
inline

Definition at line 326 of file SparseVector.h.

◆ operator=() [3/3]

SparseVector& Eigen::SparseVector::operator= ( const SparseVector other)
inline

Definition at line 301 of file SparseVector.h.

◆ outerIndexPtr() [1/2]

StorageIndex* Eigen::SparseVector::outerIndexPtr ( )
inline

Definition at line 93 of file SparseVector.h.

◆ outerIndexPtr() [2/2]

const StorageIndex* Eigen::SparseVector::outerIndexPtr ( ) const
inline

Definition at line 92 of file SparseVector.h.

◆ outerSize()

EIGEN_STRONG_INLINE Index Eigen::SparseVector::outerSize ( ) const
inline

Definition at line 84 of file SparseVector.h.

◆ prune()

void Eigen::SparseVector::prune ( const Scalar reference,
const RealScalar epsilon = NumTraits<RealScalar>::dummy_precision() 
)
inline

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

Definition at line 210 of file SparseVector.h.

◆ reserve()

void Eigen::SparseVector::reserve ( Index  reserveSize)
inline

Definition at line 204 of file SparseVector.h.

◆ resize() [1/2]

void Eigen::SparseVector::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()

Definition at line 233 of file SparseVector.h.

◆ resize() [2/2]

void Eigen::SparseVector::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)

Definition at line 223 of file SparseVector.h.

◆ resizeNonZeros()

void Eigen::SparseVector::resizeNonZeros ( Index  size)
inline

Definition at line 257 of file SparseVector.h.

◆ rows()

EIGEN_STRONG_INLINE Index Eigen::SparseVector::rows ( ) const
inline

Definition at line 81 of file SparseVector.h.

◆ setZero()

void Eigen::SparseVector::setZero ( )
inline

Definition at line 137 of file SparseVector.h.

◆ startFill()

EIGEN_DEPRECATED void Eigen::SparseVector::startFill ( Index  reserve)
inline

Definition at line 349 of file SparseVector.h.

◆ startVec()

void Eigen::SparseVector::startVec ( Index  outer)
inline

Definition at line 142 of file SparseVector.h.

◆ sum()

internal::traits< SparseVector< _Scalar, _Options, _Index > >::Scalar Eigen::SparseVector::sum ( ) const

Overloaded for performance

Definition at line 41 of file SparseRedux.h.

◆ swap() [1/2]

template<int OtherOptions>
void Eigen::SparseVector::swap ( SparseMatrix< Scalar, OtherOptions, StorageIndex > &  other)
inline

Definition at line 294 of file SparseVector.h.

◆ swap() [2/2]

void Eigen::SparseVector::swap ( SparseVector other)
inline

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

See also
SparseMatrixBase::swap()

Definition at line 287 of file SparseVector.h.

◆ valuePtr() [1/2]

EIGEN_STRONG_INLINE Scalar* Eigen::SparseVector::valuePtr ( )
inline

Definition at line 87 of file SparseVector.h.

◆ valuePtr() [2/2]

const EIGEN_STRONG_INLINE Scalar* Eigen::SparseVector::valuePtr ( ) const
inline

Definition at line 86 of file SparseVector.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const SparseVector m 
)
friend

Definition at line 332 of file SparseVector.h.

Member Data Documentation

◆ m_data

Storage Eigen::SparseVector::m_data
protected

Definition at line 403 of file SparseVector.h.

◆ m_size

Index Eigen::SparseVector::m_size
protected

Definition at line 404 of file SparseVector.h.


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


gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:46:40