Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CompressedStorage< Scalar > Class Template Reference

Public Member Functions

std::size_t allocatedSize () const
 
void append (const Scalar &v, int i)
 
Scalar at (int key, Scalar defaultValue=Scalar(0)) const
 
Scalar atInRange (std::size_t start, std::size_t end, int key, Scalar defaultValue=Scalar(0)) const
 
Scalar & atWithInsertion (int key, Scalar defaultValue=Scalar(0))
 
void clear ()
 
 CompressedStorage (std::size_t size)
 
 CompressedStorage (const CompressedStorage &other)
 
int & index (std::size_t i)
 
const int & index (std::size_t i) const
 
CompressedStorageoperator= (const CompressedStorage &other)
 
void prune (Scalar reference, RealScalar epsilon=precision< RealScalar >())
 
void reserve (std::size_t size)
 
void resize (std::size_t size, float reserveSizeFactor=0)
 
int searchLowerIndex (int key) const
 
int searchLowerIndex (std::size_t start, std::size_t end, int key) const
 
std::size_t size () const
 
void squeeze ()
 
void swap (CompressedStorage &other)
 
Scalar & value (std::size_t i)
 
const Scalar & value (std::size_t i) const
 

Static Public Member Functions

static CompressedStorage Map (int *indices, Scalar *values, std::size_t size)
 

Protected Member Functions

void reallocate (std::size_t size)
 

Protected Attributes

std::size_t m_allocatedSize
 
int * m_indices
 
std::size_t m_size
 
Scalar * m_values
 

Detailed Description

template<typename Scalar>
class Eigen::CompressedStorage< Scalar >

Stores a sparse set of values as a list of values and a list of indices.

Member Function Documentation

Scalar at ( int  key,
Scalar  defaultValue = Scalar(0) 
) const
inline
Returns
the stored value at index key If the value does not exist, then the value defaultValue is returned without any insertion.
Scalar atInRange ( std::size_t  start,
std::size_t  end,
int  key,
Scalar  defaultValue = Scalar(0) 
) const
inline

Like at(), but the search is performed in the range [start,end)

Scalar& atWithInsertion ( int  key,
Scalar  defaultValue = Scalar(0) 
)
inline
Returns
a reference to the value at index key If the value does not exist, then the value defaultValue is inserted such that the keys are sorted.
int searchLowerIndex ( int  key) const
inline
Returns
the largest k such that for all j in [0,k) index[j]<key
int searchLowerIndex ( std::size_t  start,
std::size_t  end,
int  key 
) const
inline
Returns
the largest k in [start,end) such that for all j in [start,k) index[j]<key

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