Path Tracer
Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
Eigen::SparseVector< _Scalar, _Options, _StorageIndex > Class Template Reference

a sparse vector class More...

#include <SparseVector.h>

Public Types

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

Public Member Functions

EIGEN_STRONG_INLINE Index rows () const
 
EIGEN_STRONG_INLINE Index cols () const
 
EIGEN_STRONG_INLINE Index innerSize () const
 
EIGEN_STRONG_INLINE Index outerSize () const
 
EIGEN_STRONG_INLINE const Scalar * valuePtr () const
 
EIGEN_STRONG_INLINE Scalar * valuePtr ()
 
EIGEN_STRONG_INLINE const StorageIndex * innerIndexPtr () const
 
EIGEN_STRONG_INLINE StorageIndex * innerIndexPtr ()
 
const StorageIndex * outerIndexPtr () const
 
StorageIndex * outerIndexPtr ()
 
const StorageIndex * innerNonZeroPtr () const
 
StorageIndex * innerNonZeroPtr ()
 
Storagedata ()
 
const Storagedata () const
 
Scalar coeff (Index row, Index col) const
 
Scalar coeff (Index i) const
 
Scalar & coeffRef (Index row, Index col)
 
Scalar & coeffRef (Index i)
 
void setZero ()
 
Index nonZeros () const
 
void startVec (Index outer)
 
Scalar & insertBackByOuterInner (Index outer, Index inner)
 
Scalar & insertBack (Index i)
 
Scalar & insertBackByOuterInnerUnordered (Index outer, Index inner)
 
Scalar & insertBackUnordered (Index i)
 
Scalar & insert (Index row, Index col)
 
Scalar & insert (Index i)
 
void reserve (Index reserveSize)
 
void finalize ()
 
void prune (const Scalar &reference, const RealScalar &epsilon=NumTraits< RealScalar >::dummy_precision())
 
void resize (Index rows, Index cols)
 
void resize (Index newSize)
 
void conservativeResize (Index newSize)
 
void resizeNonZeros (Index size)
 
 SparseVector (Index size)
 
 SparseVector (Index rows, Index cols)
 
template<typename OtherDerived >
 SparseVector (const SparseMatrixBase< OtherDerived > &other)
 
 SparseVector (const SparseVector &other)
 
void swap (SparseVector &other)
 
template<int OtherOptions>
void swap (SparseMatrix< Scalar, OtherOptions, StorageIndex > &other)
 
SparseVectoroperator= (const SparseVector &other)
 
template<typename OtherDerived >
SparseVectoroperator= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename Lhs , typename Rhs >
SparseVectoroperator= (const SparseSparseProduct< Lhs, Rhs > &product)
 
 ~SparseVector ()
 
Scalar sum () const
 
EIGEN_DEPRECATED void startFill (Index reserve)
 
EIGEN_DEPRECATED Scalar & fill (Index r, Index c)
 
EIGEN_DEPRECATED Scalar & fill (Index i)
 
EIGEN_DEPRECATED Scalar & fillrand (Index r, Index c)
 
EIGEN_DEPRECATED Scalar & fillrand (Index i)
 
EIGEN_DEPRECATED void endFill ()
 
EIGEN_DEPRECATED Storage_data ()
 
EIGEN_DEPRECATED const Storage_data () const
 

Static Protected Member Functions

static void check_template_parameters ()
 

Protected Attributes

Storage m_data
 
Index m_size
 

Friends

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

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 TopicCustomizing_Plugins by defining the preprocessor symbol EIGEN_SPARSEVECTOR_PLUGIN.

Constructor & Destructor Documentation

◆ ~SparseVector()

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

Destructor

Member Function Documentation

◆ coeffRef()

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.

◆ conservativeResize()

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()

◆ nonZeros()

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

◆ prune()

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 tolerance epsilon

◆ resize() [1/2]

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()

◆ resize() [2/2]

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)

◆ sum()

template<typename _Scalar , int _Options, typename _Index >
internal::traits< SparseVector< _Scalar, _Options, _Index > >::Scalar Eigen::SparseVector< _Scalar, _Options, _Index >::sum

Overloaded for performance

◆ swap()

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 swapping pointers and attributes only.

See also
SparseMatrixBase::swap()

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