Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

Functions

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)
 

Function Documentation

int SCIPcalcHashtableSize ( int  minsize)

returns a reasonable hash table size (a prime number) that is at least as large as the specified value

Parameters
minsizeminimal size of the hash table
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 
)

creates a hash table

Parameters
hashtablepointer to store the created hash table
blkmemblock memory used to store hash table entries
tablesizesize of the hash table
userptruser pointer
void SCIPhashtableFree ( SCIP_HASHTABLE **  hashtable)

frees the hash table

Parameters
hashtablepointer to the hash table
void SCIPhashtableClear ( SCIP_HASHTABLE hashtable)

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
hashtablehash table
SCIP_RETCODE SCIPhashtableInsert ( SCIP_HASHTABLE hashtable,
void *  element 
)

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
hashtablehash table
elementelement to insert into the table
SCIP_RETCODE SCIPhashtableSafeInsert ( SCIP_HASHTABLE hashtable,
void *  element 
)

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
hashtablehash table
elementelement 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
hashtablehash table
keykey to retrieve
void* SCIPhashtableRetrieveNext ( SCIP_HASHTABLE hashtable,
SCIP_HASHTABLELIST **  hashtablelist,
void *  key 
)

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
hashtablehash table
hashtablelistinput: 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
keykey to retrieve
SCIP_Bool SCIPhashtableExists ( SCIP_HASHTABLE hashtable,
void *  element 
)

returns whether the given element exists in the table

Parameters
hashtablehash table
elementelement to search in the table
SCIP_RETCODE SCIPhashtableRemove ( SCIP_HASHTABLE hashtable,
void *  element 
)

removes element from the hash table, if it exists

Parameters
hashtablehash table
elementelement to remove from the table
void SCIPhashtableRemoveAll ( SCIP_HASHTABLE hashtable)

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
hashtablehash table
SCIP_Longint SCIPhashtableGetNElements ( SCIP_HASHTABLE hashtable)

returns number of hash table elements

Parameters
hashtablehash table
SCIP_Real SCIPhashtableGetLoad ( SCIP_HASHTABLE hashtable)

returns the load of the given hash table in percentage

Parameters
hashtablehash table
void SCIPhashtablePrintStatistics ( SCIP_HASHTABLE hashtable,
SCIP_MESSAGEHDLR messagehdlr 
)

prints statistics about hash table usage

Parameters
hashtablehash table
messagehdlrmessage 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