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

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 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()

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

Definition at line 1349 of file misc.c.

References SCIP_HashTable::blkmem, hashtablelistFree(), SCIP_HashTable::lists, SCIP_HashTable::nelements, SCIP_HashTable::nlists, and NULL.

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

Definition at line 1415 of file misc.c.

References NULL, SCIP_CALL, SCIP_KEYALREADYEXISTING, SCIP_OKAY, SCIPhashtableInsert(), SCIPhashtableRetrieve(), and SCIP_HashTable::userptr.

Referenced by paramsetAdd().

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

Definition at line 1434 of file misc.c.

References hashtablelistRetrieve(), SCIP_HashTable::lists, SCIP_HashTable::nlists, NULL, and SCIP_HashTable::userptr.

Referenced by applyVariableAssignment(), consdataFree(), CREATE_CONSTRAINT(), createAndAddAndCons(), createConstantAssignment(), createLinking(), createVariable(), detectRedundantConstraints(), exprparseReadVariable(), extractGates(), nodepairqueueCreate(), paramSetBool(), paramSetChar(), paramSetInt(), paramSetLongint(), paramsetParse(), paramSetReal(), paramsetSetHeuristicsAggressive(), paramsetSetHeuristicsFast(), paramsetSetPresolvingAggressive(), paramsetSetPresolvingFast(), paramsetSetSeparatingAggressive(), paramsetSetSeparatingDefault(), parseAggregation(), parseArrayIndex(), parseConstraint(), parseQuadratic(), parseSolveItem(), parseValue(), parseVariableArrayAssignment(), SCIP_DECL_PRESOLEXEC(), SCIPcreateConsPseudobooleanWithConss(), SCIPcutpoolAddRow(), SCIPcutpoolDelRow(), SCIPhashtableSafeInsert(), SCIPparamsetCopyParams(), SCIPparamsetFix(), SCIPparamsetGetBool(), SCIPparamsetGetChar(), SCIPparamsetGetInt(), SCIPparamsetGetLongint(), SCIPparamsetGetParam(), SCIPparamsetGetReal(), SCIPparamsetGetString(), SCIPparamsetIsFixed(), SCIPparamsetSet(), SCIPparamsetSetBool(), SCIPparamsetSetChar(), SCIPparamsetSetDefaultBool(), SCIPparamsetSetDefaultInt(), SCIPparamsetSetInt(), SCIPparamsetSetLongint(), SCIPparamsetSetReal(), SCIPparamsetSetString(), SCIPparamsetSetToDefault(), SCIPprobFindCons(), SCIPprobFindVar(), and transformToOrig().

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

Definition at line 1463 of file misc.c.

References hashtablelistRetrieveNext(), SCIP_HashTable::lists, SCIP_HashTable::nlists, NULL, and SCIP_HashTable::userptr.

Referenced by presolveFindDuplicates().

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

Definition at line 1560 of file misc.c.

References SCIP_HashTable::blkmem, hashtablelistFree(), SCIP_HashTable::lists, SCIP_HashTable::nelements, SCIP_HashTable::nlists, and NULL.

Referenced by correctPresoldata(), hashtableResize(), resolvePropagation(), and SCIP_DECL_PRESOLEXIT().

SCIP_Longint SCIPhashtableGetNElements ( SCIP_HASHTABLE hashtable)

returns number of hash table elements

Parameters
hashtablehash table

Definition at line 1581 of file misc.c.

References SCIP_HashTable::nelements, and NULL.

SCIP_Real SCIPhashtableGetLoad ( SCIP_HASHTABLE hashtable)

returns the load of the given hash table in percentage

Parameters
hashtablehash table

Definition at line 1591 of file misc.c.

References SCIP_HashTable::nelements, SCIP_HashTable::nlists, NULL, and SCIP_Real.

Referenced by hashtableResize(), and SCIPhashtableInsert().

void SCIPhashtablePrintStatistics ( SCIP_HASHTABLE hashtable,
SCIP_MESSAGEHDLR messagehdlr 
)

prints statistics about hash table usage

Parameters
hashtablehash table
messagehdlrmessage handler

Definition at line 1601 of file misc.c.

References SCIP_HashTable::lists, MAX, SCIP_HashTable::nelements, SCIP_HashTableList::next, SCIP_HashTable::nlists, NULL, SCIP_Real, and SCIPmessagePrintInfo().

Referenced by detectRedundantConstraints().

SCIP_DECL_HASHKEYEQ ( SCIPhashKeyEqString  )

standard hash key comparator for string keys

returns TRUE iff both keys (i.e. strings) are equal

Definition at line 1646 of file misc.c.

SCIP_DECL_HASHKEYVAL ( SCIPhashKeyValString  )

standard hashing function for string keys

returns the hash value of the key (i.e. string)

Definition at line 1655 of file misc.c.

SCIP_DECL_HASHGETKEY ( SCIPhashGetKeyStandard  )

gets the element as the key

Definition at line 1674 of file misc.c.

SCIP_DECL_HASHKEYEQ ( SCIPhashKeyEqPtr  )

returns TRUE iff both keys(pointer) are equal

Definition at line 1681 of file misc.c.

SCIP_DECL_HASHKEYVAL ( SCIPhashKeyValPtr  )

returns the hash value of the key

Definition at line 1687 of file misc.c.