2 #ifndef vbl_sparse_array_base_h_ 3 #define vbl_sparse_array_base_h_ 14 # include <vcl_msvc_warnings.h> 36 template <
class T,
class Index>
41 typedef std::map<Index, T, std::less<Index> >
Map;
59 bool fullp(Index )
const;
62 bool put(Index ,
const T& );
94 #endif // vbl_sparse_array_base_h_ Map::const_iterator const_iterator
The type of iterators into the efficient storage.
size_type count_nonempty() const
Return number of locations that have been assigned a value using "put".
bool put(Index, const T &)
Put a value into location (i).
void erase(Index)
Erase element at location (i). Assertion failure if not yet filled.
const_iterator end() const
A bidirectional iterator pointing just beyond last non-empty element.
T * get_addr(Index)
Return the address of location (i). 0 if not yet filled.
const_iterator begin() const
A bidirectional iterator pointing at the first non-empty element.
void clear()
Empty the sparse matrix.
T T_type
The type of values stored by the sparse array.
Index Index_type
The type of objects used to index the sparse array.
bool fullp(Index) const
Return true if location (i) has been filled.
Map storage_
This stores a compact list of the values.
A fully featured sparse array which devolves indexing to its templated type.
T & operator()(Index i)
Return contents at (i).
std::map< Index, T, std::less< Index > > Map
The type of the storage.
Map::value_type sequence_value_type
The type of values of the controlled sequence.