very lightweight hash set of pointers
Functions | |
SCIP_RETCODE | SCIPhashsetCreate (SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem, int size) |
void | SCIPhashsetFree (SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem) |
SCIP_RETCODE | SCIPhashsetInsert (SCIP_HASHSET *hashset, BMS_BLKMEM *blkmem, void *element) |
SCIP_Bool | SCIPhashsetExists (SCIP_HASHSET *hashset, void *element) |
SCIP_RETCODE | SCIPhashsetRemove (SCIP_HASHSET *hashset, void *element) |
void | SCIPhashsetPrintStatistics (SCIP_HASHSET *hashset, SCIP_MESSAGEHDLR *messagehdlr) |
SCIP_Bool | SCIPhashsetIsEmpty (SCIP_HASHSET *hashset) |
int | SCIPhashsetGetNElements (SCIP_HASHSET *hashset) |
int | SCIPhashsetGetNSlots (SCIP_HASHSET *hashset) |
void ** | SCIPhashsetGetSlots (SCIP_HASHSET *hashset) |
void | SCIPhashsetRemoveAll (SCIP_HASHSET *hashset) |
SCIP_RETCODE SCIPhashsetCreate | ( | SCIP_HASHSET ** | hashset, |
BMS_BLKMEM * | blkmem, | ||
int | size ) |
creates a hash set of pointers
hashset | pointer to store the created hash set |
blkmem | block memory used to store hash set entries |
size | initial size of the hash set; it is guaranteed that the set is not resized if at most that many elements are inserted |
Definition at line 3709 of file misc.c.
References assert(), BMSallocBlockMemory, BMSallocClearBlockMemoryArray, i, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPhashsetGetNSlots().
Referenced by computeSymmetryGroup(), DECL_CURVCHECK(), detectSocNorm(), dualBoundStrengthening(), mod2MatrixAddCol(), processHashlists(), and SCIPreoptSaveActiveConss().
void SCIPhashsetFree | ( | SCIP_HASHSET ** | hashset, |
BMS_BLKMEM * | blkmem ) |
frees the hash set
hashset | pointer to the hash set |
blkmem | block memory used to store hash set entries |
Definition at line 3740 of file misc.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, i, and SCIPhashsetGetNSlots().
Referenced by computeSymmetryGroup(), DECL_CURVCHECK(), destroyMod2Matrix(), detectSocNorm(), dualBoundStrengthening(), mod2matrixRemoveCol(), processHashlists(), and SCIPreoptFree().
SCIP_RETCODE SCIPhashsetInsert | ( | SCIP_HASHSET * | hashset, |
BMS_BLKMEM * | blkmem, | ||
void * | element ) |
inserts new element into the hash set
hashset | hash set |
blkmem | block memory used to store hash set entries |
element | element to insert |
Definition at line 3750 of file misc.c.
References assert(), hashsetCheckLoad(), hashsetInsert(), i, NULL, SCIP_CALL, and SCIP_OKAY.
Referenced by computeSymmetryGroup(), DECL_CURVCHECK(), detectSocNorm(), dualBoundStrengthening(), mod2colLinkRow(), processHashlists(), SCIPreoptApplyGlbConss(), and SCIPreoptSaveActiveConss().
SCIP_Bool SCIPhashsetExists | ( | SCIP_HASHSET * | hashset, |
void * | element ) |
checks whether an element exists in the hash set
hashset | hash set |
element | element to search for |
Definition at line 3767 of file misc.c.
References assert(), ELEM_DISTANCE, FALSE, hashSetDesiredPos(), i, NULL, SCIPhashsetGetNSlots(), and TRUE.
Referenced by cleanActiveConss(), computeSymmetryGroup(), DECL_CURVCHECK(), detectSocNorm(), dualBoundStrengthening(), mod2colLinkRow(), mod2colUnlinkRow(), processHashlists(), SCIP_DECL_HASHKEYEQ(), SCIPhashsetRemove(), SCIPreoptApplyGlbConss(), SCIPreoptConsCanBeDeleted(), SCIPreoptResetActiveConss(), and SCIPreoptSaveActiveConss().
SCIP_RETCODE SCIPhashsetRemove | ( | SCIP_HASHSET * | hashset, |
void * | element ) |
removes an element from the hash set, if it exists
hashset | hash set |
element | origin to remove from the list |
Definition at line 3808 of file misc.c.
References assert(), ELEM_DISTANCE, hashSetDesiredPos(), i, NULL, SCIP_OKAY, SCIPhashsetExists(), SCIPhashsetGetNSlots(), and TRUE.
Referenced by detectSocNorm(), and mod2colUnlinkRow().
void SCIPhashsetPrintStatistics | ( | SCIP_HASHSET * | hashset, |
SCIP_MESSAGEHDLR * | messagehdlr ) |
prints statistics about hash set usage
hashset | hash set |
messagehdlr | message handler |
Definition at line 3883 of file misc.c.
References assert(), hashSetDesiredPos(), i, MAX, NULL, SCIPhashsetGetNSlots(), and SCIPmessagePrintInfo().
SCIP_Bool SCIPhashsetIsEmpty | ( | SCIP_HASHSET * | hashset | ) |
int SCIPhashsetGetNElements | ( | SCIP_HASHSET * | hashset | ) |
gives the number of elements in a hash set
hashset | hash set |
Definition at line 3942 of file misc.c.
References i.
Referenced by detectSocNorm(), mod2matrixPreprocessColumns(), and SCIP_DECL_HASHKEYEQ().
int SCIPhashsetGetNSlots | ( | SCIP_HASHSET * | hashset | ) |
gives the number of slots of a hash set
hashset | hash set |
Definition at line 3950 of file misc.c.
References i.
Referenced by doSeparation(), hashsetCheckLoad(), hashsetInsert(), mod2colUnlinkRow(), mod2matrixRemoveCol(), SCIP_DECL_HASHKEYEQ(), SCIP_DECL_HASHKEYVAL(), SCIPhashsetCreate(), SCIPhashsetExists(), SCIPhashsetFree(), SCIPhashsetPrintStatistics(), SCIPhashsetRemove(), and SCIPhashsetRemoveAll().
void ** SCIPhashsetGetSlots | ( | SCIP_HASHSET * | hashset | ) |
gives the array of hash set slots; contains all elements in indetermined order and may contain NULL values
hashset | hash set |
Definition at line 3958 of file misc.c.
References i.
Referenced by doSeparation(), mod2colUnlinkRow(), mod2matrixPreprocessColumns(), mod2matrixRemoveCol(), SCIP_DECL_HASHKEYEQ(), and SCIP_DECL_HASHKEYVAL().
void SCIPhashsetRemoveAll | ( | SCIP_HASHSET * | hashset | ) |
removes all entries in a hash set.
hashset | hash set |
Definition at line 3966 of file misc.c.
References BMSclearMemoryArray, i, and SCIPhashsetGetNSlots().
Referenced by cleanActiveConss().