openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
|
Custom unordered_set implementation. More...
#include <hashmap.hpp>
Classes | |
class | const_iterator |
struct | entry_t |
internal entry type More... | |
class | iterator |
Public Member Functions | |
unordered_set () | |
Empty constructor. More... | |
unordered_set (const unordered_set &other) | |
Construct from another set. More... | |
unordered_set (unordered_set &&other) | |
Construct from another set. More... | |
unordered_set & | operator= (const unordered_set &other) |
unordered_set & | operator= (unordered_set &&other) |
unordered_set (const std::initializer_list< K > &list) | |
template<class InputIterator > | |
unordered_set (InputIterator first, InputIterator last) | |
template<class InputIterator > | |
void | insert (InputIterator first, InputIterator last) |
std::pair< iterator, bool > | insert (const K &value) |
hm_int | erase (const K &key) |
iterator | erase (iterator it) |
hm_int | count (const K &key) const |
hm_int | count (const K &key, const_iterator it) const |
iterator | find (const K &key) |
const_iterator | find (const K &key) const |
bool | operator[] (const K &key) |
template<typename Compare = std::less<K>> | |
void | sort (Compare comp=Compare()) |
K | pop () |
void | swap (unordered_set &other) |
bool | operator== (const unordered_set &other) const |
bool | operator!= (const unordered_set &other) const |
void | reserve (size_t n) |
size_t | size () const |
bool | empty () const |
void | clear () |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Protected Member Functions | |
hm_int | do_hash (const K &key) const |
Generate a hash from a key. More... | |
void | do_rehash () |
Resize the hashtable and compute new hashes. More... | |
hm_int | do_erase (hm_int index, hm_int hash) |
Remove an entry. More... | |
hm_int | do_lookup (const K &key, hm_int &hash) const |
Return hash and index for a key. More... | |
hm_int | do_insert (const K &value, hm_int &hash) |
Insert a pair consisting of a key and a default (empty) value. More... | |
Static Protected Member Functions | |
static void | do_assert (bool cond) |
Protected Attributes | |
std::vector< hm_int > | hashtable |
the hashtable More... | |
std::vector< entry_t > | entries |
the stored entries More... | |
OPS | ops |
the hash generator More... | |
Friends | |
template<typename , hm_int , typename > | |
class | idict |
Custom unordered_set implementation.
K | Key type. |
OPS | Hashing and comparison class. |
Definition at line 241 of file hashmap.hpp.
|
inline |
Empty constructor.
Definition at line 921 of file hashmap.hpp.
|
inline |
Construct from another set.
Definition at line 925 of file hashmap.hpp.
|
inline |
Construct from another set.
Definition at line 932 of file hashmap.hpp.
|
inline |
Definition at line 949 of file hashmap.hpp.
|
inline |
Definition at line 956 of file hashmap.hpp.
|
inline |
|
inline |
Definition at line 1073 of file hashmap.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 999 of file hashmap.hpp.
|
inlinestaticprotected |
Definition at line 730 of file hashmap.hpp.
|
inlineprotected |
Remove an entry.
index | The index in the entries vector. |
hash | The hash -> index w.r.t. hashtable. |
Definition at line 776 of file hashmap.hpp.
|
inlineprotected |
Generate a hash from a key.
Hash in always in the range of the current hash table size.
key | The key. |
Definition at line 744 of file hashmap.hpp.
|
inlineprotected |
Insert a pair consisting of a key and a default (empty) value.
New values are always added to the end of the entries array. Their index is inserted into the hashtable at the hash index.
[in] | key | The key. |
[out] | hash | The hash index. |
Definition at line 860 of file hashmap.hpp.
|
inlineprotected |
Return hash and index for a key.
[in] | key | The key value. |
[out] | hash | The hash, i.e. the hashtable index. |
Definition at line 829 of file hashmap.hpp.
|
inlineprotected |
Resize the hashtable and compute new hashes.
Definition at line 755 of file hashmap.hpp.
|
inline |
Definition at line 1067 of file hashmap.hpp.
|
inline |
|
inline |
Definition at line 1074 of file hashmap.hpp.
|
inline |
|
inline |
Definition at line 985 of file hashmap.hpp.
|
inline |
Definition at line 1006 of file hashmap.hpp.
|
inline |
Definition at line 1015 of file hashmap.hpp.
|
inline |
|
inline |
Definition at line 968 of file hashmap.hpp.
|
inline |
Definition at line 1061 of file hashmap.hpp.
|
inline |
Definition at line 937 of file hashmap.hpp.
|
inline |
Definition at line 943 of file hashmap.hpp.
|
inline |
Definition at line 1052 of file hashmap.hpp.
|
inline |
Definition at line 1024 of file hashmap.hpp.
|
inline |
Definition at line 1038 of file hashmap.hpp.
|
inline |
Definition at line 1065 of file hashmap.hpp.
|
inline |
|
inline |
Definition at line 1032 of file hashmap.hpp.
|
inline |
Definition at line 1046 of file hashmap.hpp.
|
friend |
Definition at line 707 of file hashmap.hpp.
|
protected |
the stored entries
Definition at line 723 of file hashmap.hpp.
|
protected |
the hashtable
Definition at line 721 of file hashmap.hpp.
|
protected |
the hash generator
Definition at line 725 of file hashmap.hpp.