2 #ifndef vbl_sparse_array_base_hxx_ 3 #define vbl_sparse_array_base_hxx_ 13 # include <vcl_msvc_warnings.h> 17 template <
class T,
class Index>
24 template <
class T,
class Index>
27 typename Map::const_iterator p = storage_.find(i);
29 assert(p != storage_.end());
35 template <
class T,
class Index>
38 typename Map::iterator p = storage_.find(i);
40 assert(p != storage_.end());
46 template <
class T,
class Index>
49 typename Map::iterator p = storage_.find(i);
51 if (p == storage_.end())
58 template <
class T,
class Index>
61 return storage_.find(i) != storage_.end();
65 template <
class T,
class Index>
68 typedef typename Map::iterator iter;
69 typedef typename Map::value_type value_type;
70 std::pair<iter,bool> res = storage_.insert(value_type(i,t));
75 #undef VBL_SPARSE_ARRAY_BASE_INSTANTIATE 76 #define VBL_SPARSE_ARRAY_BASE_INSTANTIATE(T, I) \ 77 template class vbl_sparse_array_base<T , I > 79 #endif // vbl_sparse_array_base_hxx_ 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.
T * get_addr(Index)
Return the address of location (i). 0 if not yet filled.
void clear()
Empty the sparse matrix.
base class for sparse arrays.
bool fullp(Index) const
Return true if location (i) has been filled.
T & operator()(Index i)
Return contents at (i).