hash table that resolves conflicts by probing
Macros | |
#define | SCIPhashSignature64(a) (UINT64_C(0x8000000000000000)>>((UINT32_C(0x9e3779b9) * ((uint32_t)(a)))>>26)) |
#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 SCIPhashSignature64 | ( | a | ) | (UINT64_C(0x8000000000000000)>>((UINT32_C(0x9e3779b9) * ((uint32_t)(a)))>>26)) |
Definition at line 472 of file pub_misc.h.
Referenced by consdataGetFeasibility(), and SCIP_DECL_HASHKEYVAL().
#define SCIPhashTwo | ( | a, | |
b | |||
) | ((uint32_t)((((uint64_t)(a) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) )>>32)) |
Definition at line 473 of file pub_misc.h.
Referenced by SCIP_DECL_HASHKEYVAL(), and SCIPrandomSetSeed().
#define SCIPhashFour | ( | a, | |
b, | |||
c, | |||
d | |||
) |
Definition at line 475 of file pub_misc.h.
#define SCIPcombineTwoInt | ( | a, | |
b | |||
) | (((uint64_t) (a) << 32) | (uint64_t) (b) ) |
Definition at line 479 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 481 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 483 of file pub_misc.h.
|
static |
computes a hashcode for double precision floating point values containing 15 significant bits, the sign and the exponent
Definition at line 489 of file pub_misc.h.
References exp(), nnodes, SCIP_Bool, SCIP_DECL_HASHGETKEY(), SCIP_DECL_HASHKEYEQ(), SCIP_DECL_HASHKEYVAL(), SCIP_Longint, SCIP_Real, SCIPactivityCreate(), SCIPactivityFree(), SCIPactivityGetDemand(), SCIPactivityGetDuration(), SCIPactivityGetEnergy(), SCIPactivityGetVar(), SCIPbtCreate(), SCIPbtFree(), SCIPbtGetRoot(), SCIPbtIsEmpty(), SCIPbtnodeCreate(), SCIPbtnodeFree(), SCIPbtnodeGetData(), SCIPbtnodeGetLeftchild(), SCIPbtnodeGetParent(), SCIPbtnodeGetRightchild(), SCIPbtnodeGetSibling(), SCIPbtnodeIsLeaf(), SCIPbtnodeIsLeftchild(), SCIPbtnodeIsRightchild(), SCIPbtnodeIsRoot(), SCIPbtnodeSetData(), SCIPbtnodeSetLeftchild(), SCIPbtnodeSetParent(), SCIPbtnodeSetRightchild(), SCIPbtPrintGml(), SCIPbtSetRoot(), SCIPcalcBinomCoef(), SCIPcalcGreComDiv(), SCIPcalcIntegralScalar(), SCIPcalcMachineEpsilon(), SCIPcalcMultihashSize(), SCIPcalcSmaComMul(), SCIPdigraphAddArc(), SCIPdigraphAddArcSafe(), SCIPdigraphComputeDirectedComponents(), SCIPdigraphComputeUndirectedComponents(), SCIPdigraphFree(), SCIPdigraphFreeComponents(), SCIPdigraphGetComponent(), SCIPdigraphGetNArcs(), SCIPdigraphGetNComponents(), SCIPdigraphGetNNodes(), SCIPdigraphGetNodeData(), SCIPdigraphGetNSuccessors(), SCIPdigraphGetSuccessors(), SCIPdigraphGetSuccessorsData(), SCIPdigraphPrint(), SCIPdigraphPrintComponents(), SCIPdigraphPrintGml(), SCIPdigraphResize(), SCIPdigraphSetNodeData(), SCIPdigraphSetNSuccessors(), SCIPdigraphSetSizes(), SCIPdigraphTopoSortComponents(), SCIPdisjointsetClear(), SCIPdisjointsetFind(), SCIPdisjointsetGetComponentCount(), SCIPdisjointsetGetSize(), SCIPdisjointsetUnion(), SCIPfindSimpleRational(), SCIPhashmapCreate(), SCIPhashmapEntryGetImage(), SCIPhashmapEntryGetImageReal(), SCIPhashmapEntryGetOrigin(), SCIPhashmapEntrySetImage(), SCIPhashmapEntrySetImageReal(), SCIPhashmapExists(), SCIPhashmapFree(), SCIPhashmapGetEntry(), SCIPhashmapGetImage(), SCIPhashmapGetImageReal(), SCIPhashmapGetNElements(), SCIPhashmapGetNEntries(), SCIPhashmapInsert(), SCIPhashmapInsertReal(), SCIPhashmapIsEmpty(), SCIPhashmapPrintStatistics(), SCIPhashmapRemove(), SCIPhashmapRemoveAll(), SCIPhashmapSetImage(), SCIPhashmapSetImageReal(), SCIPhashsetCreate(), SCIPhashsetExists(), SCIPhashsetFree(), SCIPhashsetGetNElements(), SCIPhashsetGetNSlots(), SCIPhashsetGetSlots(), SCIPhashsetInsert(), SCIPhashsetIsEmpty(), SCIPhashsetPrintStatistics(), SCIPhashsetRemove(), SCIPhashsetRemoveAll(), SCIPhashtableClear(), SCIPhashtableCreate(), SCIPhashtableExists(), SCIPhashtableFree(), SCIPhashtableGetEntry(), SCIPhashtableGetLoad(), SCIPhashtableGetNElements(), SCIPhashtableGetNEntries(), SCIPhashtableInsert(), SCIPhashtablePrintStatistics(), SCIPhashtableRemove(), SCIPhashtableRemoveAll(), SCIPhashtableRetrieve(), SCIPhashtableSafeInsert(), SCIPmultihashCreate(), SCIPmultihashExists(), SCIPmultihashFree(), SCIPmultihashGetLoad(), SCIPmultihashGetNElements(), SCIPmultihashInsert(), SCIPmultihashPrintStatistics(), SCIPmultihashRemove(), SCIPmultihashRemoveAll(), SCIPmultihashRetrieve(), SCIPmultihashRetrieveNext(), SCIPmultihashSafeInsert(), SCIPnextafter(), SCIPprofileCreate(), SCIPprofileDeleteCore(), SCIPprofileFindLeft(), SCIPprofileFree(), SCIPprofileGetCapacity(), SCIPprofileGetEarliestFeasibleStart(), SCIPprofileGetLatestFeasibleStart(), SCIPprofileGetLoad(), SCIPprofileGetLoads(), SCIPprofileGetNTimepoints(), SCIPprofileGetTime(), SCIPprofileGetTimepoints(), SCIPprofileInsertCore(), SCIPprofilePrint(), SCIPrealToRational(), and SCIPselectSimpleValue().
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 2014 of file misc.c.
References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSallocClearBlockMemoryArray, MAX, SCIP_ALLOC, and SCIP_OKAY.
Referenced by checkConsnames(), collectBranchingCands(), computeSymmetryGroup(), copyConsPseudoboolean(), detectRedundantConstraints(), findCumulativeConss(), inithashmapandtable(), mod2matrixPreprocessColumns(), mod2matrixPreprocessRows(), nodepairqueueCreate(), presoldataInitHashtables(), SCIP_DECL_HEURINIT(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_READERREAD(), SCIP_DECL_READERWRITE(), SCIPcliquetableCreate(), SCIPcutpoolCreate(), SCIPexprParse(), SCIPparamsetCreate(), SCIPprobCreate(), SCIPrealHashCode(), SCIPvariableGraphCreate(), SCIPvisualizeConsCumulative(), SCIPwriteLp(), SCIPwritePip(), and writeOpb().
void SCIPhashtableFree | ( | SCIP_HASHTABLE ** | hashtable | ) |
frees the hash table
hashtable | pointer to the hash table |
Definition at line 2064 of file misc.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, SCIP_HashTable::hashes, SCIP_HashTable::mask, MAX, SCIP_HashTable::nelements, SCIP_Real, SCIPdebugMessage, SCIP_HashTable::shift, and SCIP_HashTable::slots.
Referenced by checkConsnames(), collectBranchingCands(), computeSymmetryGroup(), conshdlrdataFree(), copyConsPseudoboolean(), detectRedundantConstraints(), findCumulativeConss(), mod2matrixPreprocessColumns(), mod2matrixPreprocessRows(), nodepairqueueCreate(), SCIP_DECL_HEUREXIT(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_READERREAD(), SCIP_DECL_READERWRITE(), SCIPcliquetableFree(), SCIPcutpoolFree(), SCIPexprParse(), SCIPparamsetFree(), SCIPprobFree(), SCIPrealHashCode(), SCIPvariableGraphFree(), 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 2116 of file misc.c.
References SCIPhashtableRemoveAll().
Referenced by SCIPrealHashCode().
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 2265 of file misc.c.
References SCIP_HashTable::hashes, hashtableCheckLoad(), hashtableInsert(), hashvalue(), SCIP_HashTable::mask, SCIP_CALL, SCIP_HashTable::slots, TRUE, and SCIP_HashTable::userptr.
Referenced by addConflictBinvar(), checkConsnames(), cleanupHashDatas(), collectAggregatedVars(), collectBranchingCands(), collectMinactImplicVars(), computeSymmetryGroup(), copyConsPseudoboolean(), correctPresoldata(), createAndAddAndCons(), createConstantAssignment(), createPresoldata(), createVariable(), detectRedundantConstraints(), determineVariableFixings(), exprparseReadVariable(), findCumulativeConss(), getConflictImplics(), mod2matrixPreprocessColumns(), mod2matrixPreprocessRows(), nodepairqueueCreate(), SCIP_DECL_PRESOLEXEC(), SCIP_DECL_READERWRITE(), SCIPcliquetableAdd(), SCIPcliquetableCleanup(), SCIPcreateConsPseudobooleanWithConss(), SCIPcutpoolAddNewRow(), SCIPprobAddConsName(), SCIPprobAddVarName(), SCIPrealHashCode(), SCIPvariablegraphBreadthFirst(), SCIPvisualizeConsCumulative(), selectSolsRandomized(), setupAndSolveSubscipCrossover(), 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 2297 of file misc.c.
References FALSE, SCIP_HashTable::hashes, hashtableCheckLoad(), hashtableInsert(), hashvalue(), SCIP_HashTable::mask, SCIP_CALL, SCIP_HashTable::slots, and SCIP_HashTable::userptr.
Referenced by paramsetAdd(), and SCIPrealHashCode().
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 2326 of file misc.c.
References ELEM_DISTANCE, SCIP_HashTable::hashes, hashvalue(), SCIP_HashTable::mask, SCIP_HashTable::shift, SCIP_HashTable::slots, TRUE, and SCIP_HashTable::userptr.
Referenced by applyVariableAssignment(), cancelRow(), checkConsnames(), computeSymmetryGroup(), consdataFree(), CREATE_CONSTRAINT(), createAndAddAndCons(), createConstantAssignment(), createLinking(), createVariable(), detectRedundantConstraints(), exprparseReadVariable(), extractGates(), getParallelConsKey(), mod2matrixPreprocessColumns(), mod2matrixPreprocessRows(), nodepairqueueCreate(), paramSetBool(), paramSetChar(), paramSetInt(), paramSetLongint(), paramsetParse(), paramSetReal(), paramsetSetHeuristicsAggressive(), paramsetSetHeuristicsFast(), paramsetSetPresolvingAggressive(), paramsetSetPresolvingFast(), paramsetSetSeparatingAggressive(), paramsetSetSeparatingDefault(), parseAggregation(), parseArrayIndex(), parseConstraint(), parseQuadratic(), parseSolveItem(), parseValue(), parseVariableArrayAssignment(), SCIP_DECL_PRESOLEXEC(), SCIPcliquetableAdd(), SCIPcliquetableCleanup(), SCIPcreateConsPseudobooleanWithConss(), SCIPcutpoolAddRow(), SCIPcutpoolDelRow(), SCIPcutpoolIsCutNew(), 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(), SCIPrealHashCode(), 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 2377 of file misc.c.
References SCIP_HashTable::hashes, SCIP_HashTable::mask, SCIPhashtableRetrieve(), SCIP_HashTable::slots, and SCIP_HashTable::userptr.
Referenced by addConflictBinvar(), cleanupHashDatas(), collectAggregatedVars(), collectBranchingCands(), collectMinactImplicVars(), computeSymmetryGroup(), consdataFree(), copyConsPseudoboolean(), correctConshdlrdata(), correctPresoldata(), cutpoolDelCut(), determineVariableFixings(), findCumulativeConss(), getConflictImplics(), mod2matrixPreprocessRows(), printBoundSection(), printColumnSection(), resolvePropagation(), SCIP_DECL_READERWRITE(), SCIPcutpoolAddNewRow(), SCIPprobRemoveVarName(), SCIPrealHashCode(), SCIPvariablegraphBreadthFirst(), SCIPvisualizeConsCumulative(), selectSolsRandomized(), transformToOrig(), updateConsanddataUses(), 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 2395 of file misc.c.
References ELEM_DISTANCE, SCIP_HashTable::hashes, hashvalue(), SCIP_HashTable::mask, SCIP_HashTable::nelements, SCIP_OKAY, SCIP_HashTable::shift, SCIP_HashTable::slots, TRUE, and SCIP_HashTable::userptr.
Referenced by cleanupHashDatas(), consdataFree(), correctConshdlrdata(), correctPresoldata(), cutpoolDelCut(), detectRedundantConstraints(), extractGates(), mod2matrixPreprocessRows(), SCIP_DECL_PRESOLEXEC(), SCIPcliquetableCleanup(), SCIPprobRemoveConsName(), SCIPprobRemoveVarName(), SCIPrealHashCode(), and updateConsanddataUses().
void SCIPhashtableRemoveAll | ( | SCIP_HASHTABLE * | hashtable | ) |
removes all elements of the hash table
hashtable | hash table |
Definition at line 2473 of file misc.c.
References BMSclearMemoryArray, SCIP_HashTable::hashes, SCIP_HashTable::mask, and SCIP_HashTable::nelements.
Referenced by correctPresoldata(), resolvePropagation(), SCIPhashtableClear(), SCIPrealHashCode(), and SCIPvariablegraphBreadthFirst().
SCIP_Longint SCIPhashtableGetNElements | ( | SCIP_HASHTABLE * | hashtable | ) |
returns number of hash table elements
hashtable | hash table |
Definition at line 2485 of file misc.c.
References SCIP_HashTable::nelements.
Referenced by SCIPrealHashCode().
int SCIPhashtableGetNEntries | ( | SCIP_HASHTABLE * | hashtable | ) |
gives the number of entries in the internal arrays of a hash table
hashtable | hash table |
Definition at line 2495 of file misc.c.
References SCIP_HashTable::mask.
Referenced by SCIPrealHashCode().
void* SCIPhashtableGetEntry | ( | SCIP_HASHTABLE * | hashtable, |
int | entryidx | ||
) |
gives the element at the given index or NULL if entry at that index has no element
hashtable | hash table |
entryidx | index of hash table entry |
Definition at line 2503 of file misc.c.
References SCIP_HashTable::hashes, and SCIP_HashTable::slots.
Referenced by SCIPrealHashCode().
SCIP_Real SCIPhashtableGetLoad | ( | SCIP_HASHTABLE * | hashtable | ) |
returns the load of the given hash table in percentage
hashtable | hash table |
Definition at line 2512 of file misc.c.
References SCIP_HashTable::mask, SCIP_HashTable::nelements, and SCIP_Real.
Referenced by SCIPrealHashCode().
void SCIPhashtablePrintStatistics | ( | SCIP_HASHTABLE * | hashtable, |
SCIP_MESSAGEHDLR * | messagehdlr | ||
) |
prints statistics about hash table usage
hashtable | hash table |
messagehdlr | message handler |
Definition at line 2522 of file misc.c.
References ELEM_DISTANCE, SCIP_HashTable::hashes, SCIP_HashTable::mask, MAX, SCIP_HashTable::nelements, SCIP_Real, and SCIPmessagePrintInfo().
Referenced by SCIPrealHashCode().