CompressedStorage< Scalar > Class Template Reference

#include <CompressedStorage.h>

List of all members.

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 (const CompressedStorage &other)
 CompressedStorage (std::size_t size)
 CompressedStorage ()
const int & index (std::size_t i) const
int & index (std::size_t i)
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 (std::size_t start, std::size_t end, int key) const
int searchLowerIndex (int key) const
std::size_t size () const
void squeeze ()
void swap (CompressedStorage &other)
const Scalar & value (std::size_t i) const
Scalar & value (std::size_t i)
 ~CompressedStorage ()

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

Private Types

typedef NumTraits< Scalar >::Real RealScalar

Detailed Description

template<typename Scalar>
class CompressedStorage< Scalar >

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

Definition at line 32 of file CompressedStorage.h.


Member Typedef Documentation

template<typename Scalar>
typedef NumTraits<Scalar>::Real CompressedStorage< Scalar >::RealScalar [private]

Definition at line 34 of file CompressedStorage.h.


Constructor & Destructor Documentation

template<typename Scalar>
CompressedStorage< Scalar >::CompressedStorage (  )  [inline]

Definition at line 36 of file CompressedStorage.h.

template<typename Scalar>
CompressedStorage< Scalar >::CompressedStorage ( std::size_t  size  )  [inline]

Definition at line 40 of file CompressedStorage.h.

template<typename Scalar>
CompressedStorage< Scalar >::CompressedStorage ( const CompressedStorage< Scalar > &  other  )  [inline]

Definition at line 46 of file CompressedStorage.h.

template<typename Scalar>
CompressedStorage< Scalar >::~CompressedStorage (  )  [inline]

Definition at line 68 of file CompressedStorage.h.


Member Function Documentation

template<typename Scalar>
std::size_t CompressedStorage< Scalar >::allocatedSize (  )  const [inline]

Definition at line 103 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::append ( const Scalar &  v,
int  i 
) [inline]

Definition at line 94 of file CompressedStorage.h.

template<typename Scalar>
Scalar CompressedStorage< 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.

Definition at line 143 of file CompressedStorage.h.

template<typename Scalar>
Scalar CompressedStorage< 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)

Definition at line 156 of file CompressedStorage.h.

template<typename Scalar>
Scalar& CompressedStorage< 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.

Definition at line 171 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::clear (  )  [inline]

Definition at line 104 of file CompressedStorage.h.

template<typename Scalar>
const int& CompressedStorage< Scalar >::index ( std::size_t  i  )  const [inline]

Definition at line 110 of file CompressedStorage.h.

template<typename Scalar>
int& CompressedStorage< Scalar >::index ( std::size_t  i  )  [inline]

Definition at line 109 of file CompressedStorage.h.

template<typename Scalar>
static CompressedStorage CompressedStorage< Scalar >::Map ( int *  indices,
Scalar *  values,
std::size_t  size 
) [inline, static]

Definition at line 112 of file CompressedStorage.h.

template<typename Scalar>
CompressedStorage& CompressedStorage< Scalar >::operator= ( const CompressedStorage< Scalar > &  other  )  [inline]

Definition at line 52 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::prune ( Scalar  reference,
RealScalar  epsilon = precision<RealScalar>() 
) [inline]

Definition at line 188 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::reallocate ( std::size_t  size  )  [inline, protected]

Definition at line 206 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::reserve ( std::size_t  size  )  [inline]

Definition at line 74 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::resize ( std::size_t  size,
float  reserveSizeFactor = 0 
) [inline]

Definition at line 87 of file CompressedStorage.h.

template<typename Scalar>
int CompressedStorage< Scalar >::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

Definition at line 128 of file CompressedStorage.h.

template<typename Scalar>
int CompressedStorage< Scalar >::searchLowerIndex ( int  key  )  const [inline]
Returns:
the largest k such that for all j in [0,k) index[j]<key

Definition at line 122 of file CompressedStorage.h.

template<typename Scalar>
std::size_t CompressedStorage< Scalar >::size (  )  const [inline]

Definition at line 102 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::squeeze (  )  [inline]

Definition at line 81 of file CompressedStorage.h.

template<typename Scalar>
void CompressedStorage< Scalar >::swap ( CompressedStorage< Scalar > &  other  )  [inline]

Definition at line 60 of file CompressedStorage.h.

template<typename Scalar>
const Scalar& CompressedStorage< Scalar >::value ( std::size_t  i  )  const [inline]

Definition at line 107 of file CompressedStorage.h.

template<typename Scalar>
Scalar& CompressedStorage< Scalar >::value ( std::size_t  i  )  [inline]

Definition at line 106 of file CompressedStorage.h.


Member Data Documentation

template<typename Scalar>
std::size_t CompressedStorage< Scalar >::m_allocatedSize [protected]

Definition at line 226 of file CompressedStorage.h.

template<typename Scalar>
int* CompressedStorage< Scalar >::m_indices [protected]

Definition at line 224 of file CompressedStorage.h.

template<typename Scalar>
std::size_t CompressedStorage< Scalar >::m_size [protected]

Definition at line 225 of file CompressedStorage.h.

template<typename Scalar>
Scalar* CompressedStorage< Scalar >::m_values [protected]

Definition at line 223 of file CompressedStorage.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:21:55 2013