Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

CompressedStorage< _Scalar, _Index > Class Template Reference

#include <CompressedStorage.h>

List of all members.

Public Types

typedef _Scalar Scalar
typedef _Index Index

Public Member Functions

 CompressedStorage ()
 CompressedStorage (size_t size)
 CompressedStorage (const CompressedStorage &other)
CompressedStorageoperator= (const CompressedStorage &other)
void swap (CompressedStorage &other)
 ~CompressedStorage ()
void reserve (size_t size)
void squeeze ()
void resize (size_t size, float reserveSizeFactor=0)
void append (const Scalar &v, Index i)
size_t size () const
size_t allocatedSize () const
void clear ()
Scalarvalue (size_t i)
const Scalarvalue (size_t i) const
Indexindex (size_t i)
const Indexindex (size_t i) const
Index searchLowerIndex (Index key) const
Index searchLowerIndex (size_t start, size_t end, Index key) const
Scalar at (Index key, Scalar defaultValue=Scalar(0)) const
Scalar atInRange (size_t start, size_t end, Index key, Scalar defaultValue=Scalar(0)) const
ScalaratWithInsertion (Index key, Scalar defaultValue=Scalar(0))
void prune (Scalar reference, RealScalar epsilon=NumTraits< RealScalar >::dummy_precision())

Static Public Member Functions

static CompressedStorage Map (Index *indices, Scalar *values, size_t size)

Protected Types

typedef NumTraits< Scalar >::Real RealScalar

Protected Member Functions

void reallocate (size_t size)

Protected Attributes

Scalarm_values
Indexm_indices
size_t m_size
size_t m_allocatedSize

Detailed Description

template<typename _Scalar, typename _Index>
class CompressedStorage< _Scalar, _Index >

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


Member Typedef Documentation

template<typename _Scalar, typename _Index>
typedef _Index CompressedStorage< _Scalar, _Index >::Index
template<typename _Scalar, typename _Index>
typedef NumTraits<Scalar>::Real CompressedStorage< _Scalar, _Index >::RealScalar [protected]
template<typename _Scalar, typename _Index>
typedef _Scalar CompressedStorage< _Scalar, _Index >::Scalar

Constructor & Destructor Documentation

template<typename _Scalar, typename _Index>
CompressedStorage< _Scalar, _Index >::CompressedStorage (  )  [inline]
template<typename _Scalar, typename _Index>
CompressedStorage< _Scalar, _Index >::CompressedStorage ( size_t  size  )  [inline]
template<typename _Scalar, typename _Index>
CompressedStorage< _Scalar, _Index >::CompressedStorage ( const CompressedStorage< _Scalar, _Index > &  other  )  [inline]
template<typename _Scalar, typename _Index>
CompressedStorage< _Scalar, _Index >::~CompressedStorage (  )  [inline]

Member Function Documentation

template<typename _Scalar, typename _Index>
size_t CompressedStorage< _Scalar, _Index >::allocatedSize (  )  const [inline]
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::append ( const Scalar v,
Index  i 
) [inline]
template<typename _Scalar, typename _Index>
Scalar CompressedStorage< _Scalar, _Index >::at ( Index  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.
template<typename _Scalar, typename _Index>
Scalar CompressedStorage< _Scalar, _Index >::atInRange ( size_t  start,
size_t  end,
Index  key,
Scalar  defaultValue = Scalar(0) 
) const [inline]

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

template<typename _Scalar, typename _Index>
Scalar& CompressedStorage< _Scalar, _Index >::atWithInsertion ( Index  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.
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::clear (  )  [inline]
template<typename _Scalar, typename _Index>
Index& CompressedStorage< _Scalar, _Index >::index ( size_t  i  )  [inline]
template<typename _Scalar, typename _Index>
const Index& CompressedStorage< _Scalar, _Index >::index ( size_t  i  )  const [inline]
template<typename _Scalar, typename _Index>
static CompressedStorage CompressedStorage< _Scalar, _Index >::Map ( Index indices,
Scalar values,
size_t  size 
) [inline, static]
template<typename _Scalar, typename _Index>
CompressedStorage& CompressedStorage< _Scalar, _Index >::operator= ( const CompressedStorage< _Scalar, _Index > &  other  )  [inline]
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::prune ( Scalar  reference,
RealScalar  epsilon = NumTraits<RealScalar>::dummy_precision() 
) [inline]
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::reallocate ( size_t  size  )  [inline, protected]
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::reserve ( size_t  size  )  [inline]
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::resize ( size_t  size,
float  reserveSizeFactor = 0 
) [inline]
template<typename _Scalar, typename _Index>
Index CompressedStorage< _Scalar, _Index >::searchLowerIndex ( size_t  start,
size_t  end,
Index  key 
) const [inline]
Returns:
the largest k in [start,end) such that for all j in [start,k) index[j]<key
template<typename _Scalar, typename _Index>
Index CompressedStorage< _Scalar, _Index >::searchLowerIndex ( Index  key  )  const [inline]
Returns:
the largest k such that for all j in [0,k) index[j]<key
template<typename _Scalar, typename _Index>
size_t CompressedStorage< _Scalar, _Index >::size (  )  const [inline]
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::squeeze (  )  [inline]
template<typename _Scalar, typename _Index>
void CompressedStorage< _Scalar, _Index >::swap ( CompressedStorage< _Scalar, _Index > &  other  )  [inline]
template<typename _Scalar, typename _Index>
Scalar& CompressedStorage< _Scalar, _Index >::value ( size_t  i  )  [inline]
template<typename _Scalar, typename _Index>
const Scalar& CompressedStorage< _Scalar, _Index >::value ( size_t  i  )  const [inline]

Member Data Documentation

template<typename _Scalar, typename _Index>
size_t CompressedStorage< _Scalar, _Index >::m_allocatedSize [protected]
template<typename _Scalar, typename _Index>
Index* CompressedStorage< _Scalar, _Index >::m_indices [protected]
template<typename _Scalar, typename _Index>
size_t CompressedStorage< _Scalar, _Index >::m_size [protected]
template<typename _Scalar, typename _Index>
Scalar* CompressedStorage< _Scalar, _Index >::m_values [protected]

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