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 3340 of file misc.c.
References BMSallocBlockMemory, BMSallocClearBlockMemoryArray, log(), MAX, SCIP_ALLOC, SCIP_OKAY, and SCIPhashsetGetNSlots().
Referenced by mod2MatrixAddCol(), and SCIPrealHashCode().
| 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 3371 of file misc.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, and SCIPhashsetGetNSlots().
Referenced by destroyMod2Matrix(), mod2matrixRemoveCol(), and SCIPrealHashCode().
| 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 3381 of file misc.c.
References hashsetCheckLoad(), hashsetInsert(), SCIP_CALL, SCIP_OKAY, and SCIP_HashSet::slots.
Referenced by mod2colLinkRow(), and SCIPrealHashCode().
| 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 3398 of file misc.c.
References ELEM_DISTANCE, FALSE, hashSetDesiredPos(), SCIPhashsetGetNSlots(), SCIP_HashSet::slots, and TRUE.
Referenced by mod2colLinkRow(), mod2colUnlinkRow(), SCIP_DECL_HASHKEYEQ(), SCIPhashsetRemove(), and SCIPrealHashCode().
| 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 3439 of file misc.c.
References ELEM_DISTANCE, hashSetDesiredPos(), SCIP_HashSet::nelements, SCIP_OKAY, SCIPhashsetExists(), SCIPhashsetGetNSlots(), SCIP_HashSet::slots, and TRUE.
Referenced by mod2colUnlinkRow(), and SCIPrealHashCode().
| void SCIPhashsetPrintStatistics | ( | SCIP_HASHSET * | hashset, |
| SCIP_MESSAGEHDLR * | messagehdlr | ||
| ) |
prints statistics about hash set usage
| hashset | hash set |
| messagehdlr | message handler |
Definition at line 3514 of file misc.c.
References hashSetDesiredPos(), MAX, SCIP_HashSet::nelements, SCIP_Real, SCIPhashsetGetNSlots(), SCIPmessagePrintInfo(), and SCIP_HashSet::slots.
Referenced by SCIPrealHashCode().
| SCIP_Bool SCIPhashsetIsEmpty | ( | SCIP_HASHSET * | hashset | ) |
indicates whether a hash set has no entries
| hashset | hash set |
Definition at line 3565 of file misc.c.
References SCIP_HashSet::nelements.
Referenced by SCIPrealHashCode().
| int SCIPhashsetGetNElements | ( | SCIP_HASHSET * | hashset | ) |
gives the number of elements in a hash set
| hashset | hash set |
Definition at line 3573 of file misc.c.
References SCIP_HashSet::nelements.
Referenced by mod2matrixPreprocessColumns(), SCIP_DECL_HASHKEYEQ(), and SCIPrealHashCode().
| int SCIPhashsetGetNSlots | ( | SCIP_HASHSET * | hashset | ) |
gives the number of slots of a hash set
| hashset | hash set |
Definition at line 3581 of file misc.c.
References SCIP_HashSet::shift.
Referenced by hashsetCheckLoad(), hashsetInsert(), mod2colUnlinkRow(), mod2matrixRemoveCol(), SCIP_DECL_HASHKEYEQ(), SCIP_DECL_HASHKEYVAL(), SCIP_DECL_SEPAEXECLP(), SCIPhashsetCreate(), SCIPhashsetExists(), SCIPhashsetFree(), SCIPhashsetPrintStatistics(), SCIPhashsetRemove(), SCIPhashsetRemoveAll(), and SCIPrealHashCode().
| 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 3589 of file misc.c.
References SCIP_HashSet::slots.
Referenced by mod2colUnlinkRow(), mod2matrixPreprocessColumns(), mod2matrixRemoveCol(), SCIP_DECL_HASHKEYEQ(), SCIP_DECL_HASHKEYVAL(), SCIP_DECL_SEPAEXECLP(), and SCIPrealHashCode().
| void SCIPhashsetRemoveAll | ( | SCIP_HASHSET * | hashset | ) |
removes all entries in a hash set.
| hashset | hash set |
Definition at line 3597 of file misc.c.
References BMSclearMemoryArray, SCIP_HashSet::nelements, SCIPhashsetGetNSlots(), and SCIP_HashSet::slots.
Referenced by SCIPrealHashCode().