| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.16 Hash Maps
For your convenience, GiNaC offers the container template exhashmap<T>
that can be used as a drop-in replacement for the STL
std::map<ex, T, ex_is_less>, using hash tables to provide faster,
typically constant-time, element look-up than map<>.
exhashmap<> supports all map<> members and operations, with the
following differences:
-
no
lower_bound()andupper_bound()methods -
no reverse iterators, no
rbegin()/rend() -
no
operator<(exhashmap, exhashmap) -
the comparison function object
key_compareis hardcoded toex_is_less -
the constructor
exhashmap(size_t n)allows specifying the minimum initial hash table size (the actual table size after construction may be larger than the specified value) -
the method
size_t bucket_count()returns the current size of the hash table -
insert()anderase()operations invalidate all iterators
