hash table that resolves conflicts by queueing, thereby allowing for duplicate entries
| int SCIPcalcMultihashSize | ( | int | minsize | ) |
returns a reasonable hash table size (a prime number) that is at least as large as the specified value
| minsize | minimal size of the hash table |
Definition at line 1639 of file misc.c.
References assert(), primetable, primetablesize, SCIPcalcMultihashSize(), and SCIPsortedvecFindInt().
Referenced by SCIPcalcMultihashSize().
| SCIP_RETCODE SCIPmultihashCreate | ( | SCIP_MULTIHASH ** | multihash, |
| BMS_BLKMEM * | blkmem, | ||
| int | tablesize, | ||
| SCIP_DECL_HASHGETKEY((*hashgetkey)) | , | ||
| SCIP_DECL_HASHKEYEQ((*hashkeyeq)) | , | ||
| SCIP_DECL_HASHKEYVAL((*hashkeyval)) | , | ||
| void * | userptr ) |
creates a multihash table
| multihash | pointer to store the created multihash table |
| blkmem | block memory used to store multihash table entries |
| tablesize | size of the hash table |
| - | gets the key of the given element |
| - | returns TRUE iff both keys are equal |
| - | returns the hash value of the key |
| userptr | user pointer |
Definition at line 1962 of file misc.c.
References assert(), BMSallocBlockMemory, BMSallocClearBlockMemoryArray, NULL, SCIP_ALLOC, SCIP_DECL_HASHGETKEY, SCIP_DECL_HASHKEYEQ, SCIP_DECL_HASHKEYVAL, SCIP_OKAY, and SCIPmultihashCreate().
Referenced by SCIPmultihashCreate(), and SCIPreplaceCommonSubexpressions().
| void SCIPmultihashFree | ( | SCIP_MULTIHASH ** | multihash | ) |
frees the multihash table
| multihash | pointer to the multihash table |
Definition at line 1995 of file misc.c.
References assert(), SCIP_MultiHash::blkmem, BMSfreeBlockMemory, BMSfreeBlockMemoryArray, i, SCIP_MultiHash::lists, multihashlistFree(), SCIP_MultiHash::nlists, NULL, and SCIPmultihashFree().
Referenced by SCIPmultihashFree(), and SCIPreplaceCommonSubexpressions().
| SCIP_RETCODE SCIPmultihashInsert | ( | SCIP_MULTIHASH * | multihash, |
| void * | element ) |
inserts element in multihash table (multiple inserts of same element possible)
| multihash | multihash table |
| element | element to insert into the table |
Definition at line 2026 of file misc.c.
References assert(), SCIP_MultiHash::blkmem, SCIP_MultiHash::lists, multihashlistAppend(), multihashResize(), SCIP_MultiHash::nelements, SCIP_MultiHash::nlists, NULL, SCIP_CALL, SCIP_MULTIHASH_RESIZE_PERCENTAGE, SCIP_OKAY, SCIPmultihashGetLoad(), SCIPmultihashInsert(), and SCIP_MultiHash::userptr.
Referenced by findEqualExpr(), SCIPmultihashInsert(), and SCIPmultihashSafeInsert().
| SCIP_RETCODE SCIPmultihashSafeInsert | ( | SCIP_MULTIHASH * | multihash, |
| void * | element ) |
inserts element in multihash table (multiple insertion of same element is checked and results in an error)
| multihash | multihash table |
| element | element to insert into the table |
Definition at line 2067 of file misc.c.
References assert(), NULL, SCIP_CALL, SCIP_KEYALREADYEXISTING, SCIP_OKAY, SCIPmultihashInsert(), SCIPmultihashRetrieve(), SCIPmultihashSafeInsert(), and SCIP_MultiHash::userptr.
Referenced by SCIPmultihashSafeInsert().
| void * SCIPmultihashRetrieve | ( | SCIP_MULTIHASH * | multihash, |
| void * | key ) |
retrieve element with key from multihash table, returns NULL if not existing
| multihash | multihash table |
| key | key to retrieve |
Definition at line 2086 of file misc.c.
References assert(), SCIP_MultiHash::lists, multihashlistRetrieve(), SCIP_MultiHash::nlists, NULL, SCIPmultihashRetrieve(), and SCIP_MultiHash::userptr.
Referenced by SCIPmultihashRetrieve(), and SCIPmultihashSafeInsert().
| void * SCIPmultihashRetrieveNext | ( | SCIP_MULTIHASH * | multihash, |
| SCIP_MULTIHASHLIST ** | multihashlist, | ||
| void * | key ) |
retrieve element with key from multihash table, returns NULL if not existing can be used to retrieve all entries with the same key (one-by-one)
| multihash | multihash table |
| multihashlist | input: 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 |
| key | key to retrieve |
Definition at line 2115 of file misc.c.
References assert(), SCIP_MultiHash::lists, multihashlistRetrieveNext(), SCIP_MultiHash::nlists, NULL, SCIPmultihashRetrieveNext(), and SCIP_MultiHash::userptr.
Referenced by findEqualExpr(), and SCIPmultihashRetrieveNext().
| SCIP_Bool SCIPmultihashExists | ( | SCIP_MULTIHASH * | multihash, |
| void * | element ) |
returns whether the given element exists in the multihash table
| multihash | multihash table |
| element | element to search in the table |
Definition at line 2151 of file misc.c.
References assert(), SCIP_MultiHash::lists, multihashlistFind(), SCIP_MultiHash::nlists, NULL, SCIP_Bool, SCIPmultihashExists(), and SCIP_MultiHash::userptr.
Referenced by SCIPmultihashExists().
| SCIP_RETCODE SCIPmultihashRemove | ( | SCIP_MULTIHASH * | multihash, |
| void * | element ) |
removes element from the multihash table, if it exists
| multihash | multihash table |
| element | element to remove from the table |
Definition at line 2178 of file misc.c.
References assert(), SCIP_MultiHash::blkmem, SCIP_MultiHash::lists, multihashlistRemove(), SCIP_MultiHash::nelements, SCIP_MultiHash::nlists, NULL, SCIP_OKAY, SCIPmultihashRemove(), and SCIP_MultiHash::userptr.
Referenced by SCIPmultihashRemove().
| void SCIPmultihashRemoveAll | ( | SCIP_MULTIHASH * | multihash | ) |
removes all elements of the multihash table
| multihash | multihash table |
Definition at line 2212 of file misc.c.
References assert(), SCIP_MultiHash::blkmem, i, SCIP_MultiHash::lists, multihashlistFree(), SCIP_MultiHash::nelements, SCIP_MultiHash::nlists, NULL, and SCIPmultihashRemoveAll().
Referenced by multihashResize(), and SCIPmultihashRemoveAll().
| SCIP_Longint SCIPmultihashGetNElements | ( | SCIP_MULTIHASH * | multihash | ) |
returns number of multihash table elements
| multihash | multihash table |
Definition at line 2233 of file misc.c.
References assert(), SCIP_MultiHash::nelements, NULL, SCIP_Longint, and SCIPmultihashGetNElements().
Referenced by SCIPmultihashGetNElements().
| SCIP_Real SCIPmultihashGetLoad | ( | SCIP_MULTIHASH * | multihash | ) |
returns the load of the given multihash table in percentage
| multihash | multihash table |
Definition at line 2243 of file misc.c.
References assert(), SCIP_MultiHash::nelements, SCIP_MultiHash::nlists, NULL, SCIP_Real, and SCIPmultihashGetLoad().
Referenced by multihashResize(), SCIPmultihashGetLoad(), and SCIPmultihashInsert().
| void SCIPmultihashPrintStatistics | ( | SCIP_MULTIHASH * | multihash, |
| SCIP_MESSAGEHDLR * | messagehdlr ) |
prints statistics about multihash table usage
| multihash | multihash table |
| messagehdlr | message handler |
Definition at line 2253 of file misc.c.
References assert(), i, SCIP_MultiHash::lists, MAX, SCIP_MultiHash::nelements, SCIP_MultiHashList::next, SCIP_MultiHash::nlists, NULL, SCIP_LONGINT_FORMAT, SCIP_Real, SCIP_UNUSED, SCIPmessagePrintInfo(), and SCIPmultihashPrintStatistics().
Referenced by SCIPmultihashPrintStatistics().
| SCIP_DECL_HASHKEYEQ | ( | SCIPhashKeyEqString | ) |
standard hash key comparator for string keys
returns TRUE iff both keys (i.e. strings) are equal
Definition at line 2830 of file misc.c.
References SCIP_DECL_HASHKEYEQ.
| SCIP_DECL_HASHKEYVAL | ( | SCIPhashKeyValString | ) |
standard hashing function for string keys
returns the hash value of the key (i.e. string)
Definition at line 2839 of file misc.c.
References SCIP_DECL_HASHKEYVAL.
| SCIP_DECL_HASHGETKEY | ( | SCIPhashGetKeyStandard | ) |
gets the element as the key
Definition at line 2858 of file misc.c.
References SCIP_DECL_HASHGETKEY.
| SCIP_DECL_HASHKEYEQ | ( | SCIPhashKeyEqPtr | ) |
returns TRUE iff both keys(pointer) are equal
Definition at line 2865 of file misc.c.
References SCIP_DECL_HASHKEYEQ.
| SCIP_DECL_HASHKEYVAL | ( | SCIPhashKeyValPtr | ) |
returns the hash value of the key
Definition at line 2871 of file misc.c.
References SCIP_DECL_HASHKEYVAL.