Free Electron
|
Row-Compressed Sparse Container. More...
#include <SparseArray.h>
Public Member Functions | |
SparseArray (U32 prealloc=FE_SA_PREALLOC) | |
SparseArray (const SparseArray< T > &other) | |
SparseArray< T > & | operator= (const SparseArray< T > &other) |
void | reset (U32 prealloc=FE_SA_PREALLOC) |
Remove all existing values. More... | |
void | clear (void) |
Zero existing values, but do not remove. More... | |
U32 | size (void) const |
Return the largest index. More... | |
T & | operator[] (U32 index) |
Return the entry at the particular index. More... | |
T | operator[] (U32 index) const |
Return the const entry at the particular index. More... | |
U32 | entries (void) const |
Return the number of actual stored entries. More... | |
U32 | index (U32 location) const |
Return the index at a storage location. More... | |
T & | entry (U32 location) |
Return the entry at a storage location. More... | |
T | entry (U32 location) const |
Return the const entry at a storage location. More... | |
Private Member Functions | |
void | grow (void) |
void | initialize (U32 prealloc) |
Private Attributes | |
U32 | m_allocated |
U32 | m_used |
U32 | m_maxIndex |
U32 | m_cacheLocation |
U32 * | m_pIndex |
T * | m_pData |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
String | print (const SparseArray< T > &rhs, BWORD sparse=FALSE) |
Print to a string. More... | |
Row-Compressed Sparse Container.
|
inline |
Zero existing values, but do not remove.
Referenced by fe::ext::SparseArray< T >::operator[]().
|
inline |
Return the number of actual stored entries.
This can be less than the size. Using entry() instead of operator[] can be helpful to limit an iteration to only the values that are actually set, instead of reading lots of zeros.
|
inline |
Return the entry at a storage location.
|
inline |
Return the const entry at a storage location.
|
inline |
Return the index at a storage location.
Referenced by fe::ext::SparseArray< T >::operator[](), and fe::ext::SparseArray< T >::size().
|
inline |
Return the entry at the particular index.
References fe::ext::SparseArray< T >::index().
Referenced by fe::ext::SparseArray< T >::operator[](), and fe::ext::SparseArray< T >::size().
|
inline |
Return the const entry at the particular index.
References fe::ext::SparseArray< T >::clear(), and fe::ext::SparseArray< T >::operator[]().
|
inline |
Remove all existing values.
|
inline |
Return the largest index.
References fe::ext::SparseArray< T >::index(), and fe::ext::SparseArray< T >::operator[]().
Referenced by fe::ext::SparseMatrix< F64 >::premultiplyDiagonal(), and fe::ext::SparseMatrix< F64 >::premultiplyInverseDiagonal().
|
related |
Print to a string.