hash table that resolves conflicts by probing
Macros | |
| #define | SCIPhashSignature64(a) ((uint64_t)(UINT64_C(1) << ((a) % 64))) |
| #define | SCIPhashTwo(a, b) ((uint32_t)((((uint64_t)(a) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) )>>32)) |
| #define | SCIPhashFour(a, b, c, d) |
| #define | SCIPcombineTwoInt(a, b) (((uint64_t) (a) << 32) | (uint64_t) (b) ) |
| #define | SCIPcombineThreeInt(a, b, c) (((uint64_t) (a) << 43) + ((uint64_t) (b) << 21) + ((uint64_t) (c)) ) |
| #define | SCIPcombineFourInt(a, b, c, d) (((uint64_t) (a) << 48) + ((uint64_t) (b) << 32) + ((uint64_t) (c) << 16) + ((uint64_t) (d)) ) |
| #define | SCIPrealHashCode(x, n) ( (x)*(1<<n) >= INT64_MAX ? INT64_MAX : ((x)*(1<<n) <= INT64_MIN ? INT64_MIN : (int64_t)((x)*(1<<n))) ) |
| #define | SCIPpositiveRealHashCode(x, n) ( (x)*(1<<n) >= UINT64_MAX ? UINT64_MAX : (uint64_t)((x)*(1<<n)) ) |
Functions | |
| 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) |
| 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) |
| #define SCIPhashSignature64 | ( | a | ) | ((uint64_t)(UINT64_C(1) << ((a) % 64))) |
Definition at line 470 of file pub_misc.h.
Referenced by consdataGetFeasibility().
| #define SCIPhashTwo | ( | a, | |
| b | |||
| ) | ((uint32_t)((((uint64_t)(a) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) )>>32)) |
Definition at line 471 of file pub_misc.h.
Referenced by randomInitialize(), and SCIP_DECL_HASHKEYVAL().
| #define SCIPhashFour | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) |
Definition at line 473 of file pub_misc.h.
Referenced by SCIP_DECL_HASHKEYVAL().
| #define SCIPcombineTwoInt | ( | a, | |
| b | |||
| ) | (((uint64_t) (a) << 32) | (uint64_t) (b) ) |
Definition at line 477 of file pub_misc.h.
Referenced by SCIP_DECL_HASHKEYVAL().
| #define SCIPcombineThreeInt | ( | a, | |
| b, | |||
| c | |||
| ) | (((uint64_t) (a) << 43) + ((uint64_t) (b) << 21) + ((uint64_t) (c)) ) |
Definition at line 479 of file pub_misc.h.
Referenced by SCIP_DECL_HASHKEYVAL().
| #define SCIPcombineFourInt | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) | (((uint64_t) (a) << 48) + ((uint64_t) (b) << 32) + ((uint64_t) (c) << 16) + ((uint64_t) (d)) ) |
Definition at line 481 of file pub_misc.h.
| #define SCIPrealHashCode | ( | x, | |
| n | |||
| ) | ( (x)*(1<<n) >= INT64_MAX ? INT64_MAX : ((x)*(1<<n) <= INT64_MIN ? INT64_MIN : (int64_t)((x)*(1<<n))) ) |
Definition at line 484 of file pub_misc.h.
| #define SCIPpositiveRealHashCode | ( | x, | |
| n | |||
| ) | ( (x)*(1<<n) >= UINT64_MAX ? UINT64_MAX : (uint64_t)((x)*(1<<n)) ) |
Definition at line 486 of file pub_misc.h.
Referenced by SCIP_DECL_HASHKEYVAL().
| 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
| 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 |
Definition at line 2015 of file misc.c.
References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSallocClearBlockMemoryArray, log(), MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by collectBranchingCands(), copyConsPseudoboolean(), detectRedundantConstraints(), findCumulativeConss(), inithashmapandtable(), nodepairqueueCreate(), presoldataInitHashtables(), SCIP_DECL_HEURINIT(), SCIP_DECL_READERREAD(), SCIP_DECL_READERWRITE(), SCIPcliquetableCreate(), SCIPcutpoolCreate(), SCIPexprParse(), SCIPparamsetCreate(), SCIPprobCreate(), SCIPvisualizeConsCumulative(), SCIPwriteLp(), SCIPwritePip(), variableGraphCreate(), and writeOpb().
| void SCIPhashtableFree | ( | SCIP_HASHTABLE ** | hashtable | ) |
frees the hash table
| hashtable | pointer to the hash table |
Definition at line 2065 of file misc.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, SCIP_HashTable::hashes, SCIP_HashTable::mask, MAX, SCIP_HashTable::nelements, NULL, SCIP_Real, SCIPdebugMessage, SCIP_HashTable::shift, and SCIP_HashTable::slots.
Referenced by collectBranchingCands(), conshdlrdataFree(), copyConsPseudoboolean(), detectRedundantConstraints(), findCumulativeConss(), nodepairqueueCreate(), SCIP_DECL_HEUREXIT(), SCIP_DECL_READERREAD(), SCIP_DECL_READERWRITE(), SCIPcliquetableFree(), SCIPcutpoolFree(), SCIPexprParse(), SCIPparamsetFree(), SCIPprobFree(), SCIPvisualizeConsCumulative(), SCIPwriteLp(), SCIPwritePip(), and writeOpb().
| void SCIPhashtableClear | ( | SCIP_HASHTABLE * | hashtable | ) |
removes all elements of the hash table
removes all elements of the hash table
| hashtable | hash table |
Definition at line 2117 of file misc.c.
References SCIPhashtableRemoveAll().
| SCIP_RETCODE SCIPhashtableInsert | ( | SCIP_HASHTABLE * | hashtable, |
| void * | element | ||
| ) |
inserts element in hash table (multiple inserts of same element override the previous entry)
inserts element in hash table
| hashtable | hash table |
| element | element to insert into the table |
Definition at line 2254 of file misc.c.
References SCIP_HashTable::hashes, hashtableCheckLoad(), hashtableInsert(), hashvalue(), SCIP_HashTable::mask, NULL, SCIP_CALL, SCIP_HashTable::slots, TRUE, and SCIP_HashTable::userptr.
Referenced by addConflictBinvar(), cleanupHashDatas(), collectAggregatedVars(), collectBranchingCands(), collectMinactImplicVars(), copyConsPseudoboolean(), correctPresoldata(), createAndAddAndCons(), createConstantAssignment(), createPresoldata(), createVariable(), detectRedundantConstraints(), determineVariableFixings(), exprparseReadVariable(), findCumulativeConss(), getConflictImplics(), nodepairqueueCreate(), SCIP_DECL_HEUREXEC(), SCIP_DECL_READERWRITE(), SCIPcliquetableAdd(), SCIPcliquetableCleanup(), SCIPcreateConsPseudobooleanWithConss(), SCIPcutpoolAddNewRow(), SCIPprobAddConsName(), SCIPprobAddVarName(), SCIPvisualizeConsCumulative(), selectSolsRandomized(), variablegraphBreadthFirst(), writeOpbFixedVars(), and writeOpbRelevantAnds().
| 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)
inserts element in hash table
| hashtable | hash table |
| element | element to insert into the table |
Definition at line 2286 of file misc.c.
References FALSE, SCIP_HashTable::hashes, hashtableCheckLoad(), hashtableInsert(), hashvalue(), SCIP_HashTable::mask, NULL, SCIP_CALL, SCIP_HashTable::slots, 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
| hashtable | hash table |
| key | key to retrieve |
Definition at line 2315 of file misc.c.
References ELEM_DISTANCE, SCIP_HashTable::hashes, hashvalue(), SCIP_HashTable::mask, NULL, SCIP_HashTable::shift, SCIP_HashTable::slots, TRUE, 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(), SCIPcliquetableAdd(), SCIPcliquetableCleanup(), SCIPcreateConsPseudobooleanWithConss(), SCIPcutpoolAddRow(), SCIPcutpoolDelRow(), SCIPhashtableExists(), SCIPparamsetCopyParams(), SCIPparamsetFix(), SCIPparamsetGetBool(), SCIPparamsetGetChar(), SCIPparamsetGetInt(), SCIPparamsetGetLongint(), SCIPparamsetGetParam(), SCIPparamsetGetReal(), SCIPparamsetGetString(), SCIPparamsetIsFixed(), SCIPparamsetSet(), SCIPparamsetSetBool(), SCIPparamsetSetChar(), SCIPparamsetSetDefaultBool(), SCIPparamsetSetDefaultInt(), SCIPparamsetSetEmphasis(), SCIPparamsetSetInt(), SCIPparamsetSetLongint(), SCIPparamsetSetReal(), SCIPparamsetSetString(), SCIPparamsetSetToDefault(), SCIPprobFindCons(), SCIPprobFindVar(), SCIPprobRemoveConsName(), and transformToOrig().
| SCIP_Bool SCIPhashtableExists | ( | SCIP_HASHTABLE * | hashtable, |
| void * | element | ||
| ) |
returns whether the given element exists in the table
| hashtable | hash table |
| element | element to search in the table |
Definition at line 2366 of file misc.c.
References SCIP_HashTable::hashes, SCIP_HashTable::mask, NULL, SCIPhashtableRetrieve(), SCIP_HashTable::slots, and SCIP_HashTable::userptr.
Referenced by addConflictBinvar(), cleanupHashDatas(), collectAggregatedVars(), collectBranchingCands(), collectMinactImplicVars(), consdataFree(), copyConsPseudoboolean(), correctConshdlrdata(), correctPresoldata(), cutpoolDelCut(), determineVariableFixings(), findCumulativeConss(), getConflictImplics(), printBoundSection(), printColumnSection(), resolvePropagation(), SCIP_DECL_READERWRITE(), SCIPprobRemoveVarName(), SCIPvisualizeConsCumulative(), selectSolsRandomized(), transformToOrig(), updateConsanddataUses(), variablegraphBreadthFirst(), and writeOpbFixedVars().
| SCIP_RETCODE SCIPhashtableRemove | ( | SCIP_HASHTABLE * | hashtable, |
| void * | element | ||
| ) |
removes element from the hash table, if it exists
| hashtable | hash table |
| element | element to remove from the table |
Definition at line 2384 of file misc.c.
References ELEM_DISTANCE, SCIP_HashTable::hashes, hashvalue(), SCIP_HashTable::mask, SCIP_HashTable::nelements, NULL, SCIP_OKAY, SCIP_HashTable::shift, SCIP_HashTable::slots, TRUE, and SCIP_HashTable::userptr.
Referenced by cleanupHashDatas(), consdataFree(), correctConshdlrdata(), correctPresoldata(), cutpoolDelCut(), detectRedundantConstraints(), extractGates(), SCIPcliquetableCleanup(), SCIPprobRemoveConsName(), SCIPprobRemoveVarName(), and updateConsanddataUses().
| void SCIPhashtableRemoveAll | ( | SCIP_HASHTABLE * | hashtable | ) |
removes all elements of the hash table
| hashtable | hash table |
Definition at line 2462 of file misc.c.
References BMSclearMemoryArray, SCIP_HashTable::hashes, SCIP_HashTable::mask, SCIP_HashTable::nelements, and NULL.
Referenced by correctPresoldata(), resolvePropagation(), SCIPhashtableClear(), and variablegraphBreadthFirst().
| SCIP_Longint SCIPhashtableGetNElements | ( | SCIP_HASHTABLE * | hashtable | ) |
returns number of hash table elements
| hashtable | hash table |
Definition at line 2474 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
| hashtable | hash table |
Definition at line 2484 of file misc.c.
References SCIP_HashTable::mask, SCIP_HashTable::nelements, NULL, and SCIP_Real.
| void SCIPhashtablePrintStatistics | ( | SCIP_HASHTABLE * | hashtable, |
| SCIP_MESSAGEHDLR * | messagehdlr | ||
| ) |
prints statistics about hash table usage
| hashtable | hash table |
| messagehdlr | message handler |
Definition at line 2494 of file misc.c.
References ELEM_DISTANCE, SCIP_HashTable::hashes, SCIP_HashTable::mask, MAX, SCIP_HashTable::nelements, NULL, SCIP_Real, and SCIPmessagePrintInfo().