|
|
int | SCIPcalcHashtableSize (int minsize) |
|
SCIP_RETCODE | SCIPhashtableCreate (SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr) |
|
void | SCIPhashtableFree (SCIP_HASHTABLE **hashtable) |
|
void | SCIPhashtableClear (SCIP_HASHTABLE *hashtable) |
|
SCIP_RETCODE | SCIPhashtableInsert (SCIP_HASHTABLE *hashtable, void *element) |
|
SCIP_RETCODE | SCIPhashtableSafeInsert (SCIP_HASHTABLE *hashtable, void *element) |
|
void * | SCIPhashtableRetrieve (SCIP_HASHTABLE *hashtable, void *key) |
|
void * | SCIPhashtableRetrieveNext (SCIP_HASHTABLE *hashtable, SCIP_HASHTABLELIST **hashtablelist, void *key) |
|
SCIP_Bool | SCIPhashtableExists (SCIP_HASHTABLE *hashtable, void *element) |
|
SCIP_RETCODE | SCIPhashtableRemove (SCIP_HASHTABLE *hashtable, void *element) |
|
void | SCIPhashtableRemoveAll (SCIP_HASHTABLE *hashtable) |
|
SCIP_Longint | SCIPhashtableGetNElements (SCIP_HASHTABLE *hashtable) |
|
SCIP_Real | SCIPhashtableGetLoad (SCIP_HASHTABLE *hashtable) |
|
void | SCIPhashtablePrintStatistics (SCIP_HASHTABLE *hashtable, SCIP_MESSAGEHDLR *messagehdlr) |
|
| SCIP_DECL_HASHKEYEQ (SCIPhashKeyEqString) |
|
| SCIP_DECL_HASHKEYVAL (SCIPhashKeyValString) |
|
| SCIP_DECL_HASHGETKEY (SCIPhashGetKeyStandard) |
|
| SCIP_DECL_HASHKEYEQ (SCIPhashKeyEqPtr) |
|
| SCIP_DECL_HASHKEYVAL (SCIPhashKeyValPtr) |
|
int SCIPcalcHashtableSize |
( |
int |
minsize | ) |
|
returns a reasonable hash table size (a prime number) that is at least as large as the specified value
- Parameters
-
minsize | minimal size of the hash table |
creates a hash table
- Parameters
-
hashtable | pointer to store the created hash table |
blkmem | block memory used to store hash table entries |
tablesize | size of the hash table |
userptr | user pointer |
frees the hash table
- Parameters
-
hashtable | pointer to the hash table |
removes all elements of the hash table
- Note
- From a performance point of view you should not fill and clear a hash table too often since the clearing can be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
- Deprecated:
- Please use SCIPhashtableRemoveAll()
- Parameters
-
inserts element in hash table (multiple inserts of same element possible)
- Note
- A pointer to a hashtablelist returned by SCIPhashtableRetrieveNext() might get invalid when adding an element to the hash table, due to dynamic resizing.
- Parameters
-
hashtable | hash table |
element | element to insert into the table |
inserts element in hash table (multiple insertion of same element is checked and results in an error)
- Note
- A pointer to a hashtablelist returned by SCIPhashtableRetrieveNext() might get invalid when adding a new element to the hash table, due to dynamic resizing.
- Parameters
-
hashtable | hash table |
element | element to insert into the table |
void* SCIPhashtableRetrieve |
( |
SCIP_HASHTABLE * |
hashtable, |
|
|
void * |
key |
|
) |
| |
retrieve element with key from hash table, returns NULL if not existing
- Parameters
-
hashtable | hash table |
key | key to retrieve |
retrieve element with key from hash table, returns NULL if not existing can be used to retrieve all entries with the same key (one-by-one)
- Note
- The returned hashtablelist pointer might get invalid when adding a new element to the hash table.
- Parameters
-
hashtable | hash table |
hashtablelist | input: entry in hash table list from which to start searching, or NULL output: entry in hash table list corresponding to element after retrieved one, or NULL |
key | key to retrieve |
returns whether the given element exists in the table
- Parameters
-
hashtable | hash table |
element | element to search in the table |
removes element from the hash table, if it exists
- Parameters
-
hashtable | hash table |
element | element to remove from the table |
removes all elements of the hash table
- Note
- From a performance point of view you should not fill and clear a hash table too often since the clearing can be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
- Parameters
-
returns number of hash table elements
- Parameters
-
returns the load of the given hash table in percentage
- Parameters
-
prints statistics about hash table usage
- Parameters
-
hashtable | hash table |
messagehdlr | message handler |
SCIP_DECL_HASHKEYEQ |
( |
SCIPhashKeyEqString |
| ) |
|
standard hash key comparator for string keys
SCIP_DECL_HASHKEYVAL |
( |
SCIPhashKeyValString |
| ) |
|
standard hashing function for string keys
SCIP_DECL_HASHGETKEY |
( |
SCIPhashGetKeyStandard |
| ) |
|
gets the element as the key
SCIP_DECL_HASHKEYEQ |
( |
SCIPhashKeyEqPtr |
| ) |
|
returns TRUE iff both keys(pointer) are equal
SCIP_DECL_HASHKEYVAL |
( |
SCIPhashKeyValPtr |
| ) |
|
returns the hash value of the key
|