#include <CompressedStorage.h>
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) |
CompressedStorage & | operator= (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 |
Stores a sparse set of values as a list of values and a list of indices.
Definition at line 32 of file CompressedStorage.h.
typedef NumTraits<Scalar>::Real CompressedStorage< Scalar >::RealScalar [private] |
Definition at line 34 of file CompressedStorage.h.
CompressedStorage< Scalar >::CompressedStorage | ( | ) | [inline] |
Definition at line 36 of file CompressedStorage.h.
CompressedStorage< Scalar >::CompressedStorage | ( | std::size_t | size | ) | [inline] |
Definition at line 40 of file CompressedStorage.h.
CompressedStorage< Scalar >::CompressedStorage | ( | const CompressedStorage< Scalar > & | other | ) | [inline] |
Definition at line 46 of file CompressedStorage.h.
CompressedStorage< Scalar >::~CompressedStorage | ( | ) | [inline] |
Definition at line 68 of file CompressedStorage.h.
std::size_t CompressedStorage< Scalar >::allocatedSize | ( | ) | const [inline] |
Definition at line 103 of file CompressedStorage.h.
void CompressedStorage< Scalar >::append | ( | const Scalar & | v, | |
int | i | |||
) | [inline] |
Definition at line 94 of file CompressedStorage.h.
Scalar CompressedStorage< Scalar >::at | ( | int | key, | |
Scalar | defaultValue = Scalar(0) | |||
) | const [inline] |
Definition at line 143 of file CompressedStorage.h.
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.
Scalar& CompressedStorage< Scalar >::atWithInsertion | ( | int | key, | |
Scalar | defaultValue = Scalar(0) | |||
) | [inline] |
Definition at line 171 of file CompressedStorage.h.
void CompressedStorage< Scalar >::clear | ( | ) | [inline] |
Definition at line 104 of file CompressedStorage.h.
const int& CompressedStorage< Scalar >::index | ( | std::size_t | i | ) | const [inline] |
Definition at line 110 of file CompressedStorage.h.
int& CompressedStorage< Scalar >::index | ( | std::size_t | i | ) | [inline] |
Definition at line 109 of file CompressedStorage.h.
static CompressedStorage CompressedStorage< Scalar >::Map | ( | int * | indices, | |
Scalar * | values, | |||
std::size_t | size | |||
) | [inline, static] |
Definition at line 112 of file CompressedStorage.h.
CompressedStorage& CompressedStorage< Scalar >::operator= | ( | const CompressedStorage< Scalar > & | other | ) | [inline] |
Definition at line 52 of file CompressedStorage.h.
void CompressedStorage< Scalar >::prune | ( | Scalar | reference, | |
RealScalar | epsilon = precision<RealScalar>() | |||
) | [inline] |
Definition at line 188 of file CompressedStorage.h.
void CompressedStorage< Scalar >::reallocate | ( | std::size_t | size | ) | [inline, protected] |
Definition at line 206 of file CompressedStorage.h.
void CompressedStorage< Scalar >::reserve | ( | std::size_t | size | ) | [inline] |
Definition at line 74 of file CompressedStorage.h.
void CompressedStorage< Scalar >::resize | ( | std::size_t | size, | |
float | reserveSizeFactor = 0 | |||
) | [inline] |
Definition at line 87 of file CompressedStorage.h.
int CompressedStorage< Scalar >::searchLowerIndex | ( | std::size_t | start, | |
std::size_t | end, | |||
int | key | |||
) | const [inline] |
k
in [start,end) such that for all j
in [start,k) index[j
]<key Definition at line 128 of file CompressedStorage.h.
int CompressedStorage< Scalar >::searchLowerIndex | ( | int | key | ) | const [inline] |
k
such that for all j
in [0,k) index[j
]<key Definition at line 122 of file CompressedStorage.h.
std::size_t CompressedStorage< Scalar >::size | ( | ) | const [inline] |
Definition at line 102 of file CompressedStorage.h.
void CompressedStorage< Scalar >::squeeze | ( | ) | [inline] |
Definition at line 81 of file CompressedStorage.h.
void CompressedStorage< Scalar >::swap | ( | CompressedStorage< Scalar > & | other | ) | [inline] |
Definition at line 60 of file CompressedStorage.h.
const Scalar& CompressedStorage< Scalar >::value | ( | std::size_t | i | ) | const [inline] |
Definition at line 107 of file CompressedStorage.h.
Scalar& CompressedStorage< Scalar >::value | ( | std::size_t | i | ) | [inline] |
Definition at line 106 of file CompressedStorage.h.
std::size_t CompressedStorage< Scalar >::m_allocatedSize [protected] |
Definition at line 226 of file CompressedStorage.h.
int* CompressedStorage< Scalar >::m_indices [protected] |
Definition at line 224 of file CompressedStorage.h.
std::size_t CompressedStorage< Scalar >::m_size [protected] |
Definition at line 225 of file CompressedStorage.h.
Scalar* CompressedStorage< Scalar >::m_values [protected] |
Definition at line 223 of file CompressedStorage.h.