17 template <
class keyType>
19 vector<uint32_t> offset;
20 uint32_t sum(uint32_t h) {
21 uint32_t p = (h & 0x1F);
32 Othello<keyType>(1,_keys, keycount)
36 for (
int i = 1 ; i < offset.size(); i++) {
51 uint32_t
query(
const keyType &k) {
65 fread(&(offset[0]),
sizeof(offset[0]),offset.size(),pF);
73 fwrite(&(offset[0]),
sizeof(offset[0]),offset.size(),pF);
OthelloIndex is a data structure that stores a minimum perfect hash function. For n keys...
Definition: othelloindex.h:18
void loadDataFromBinaryFile(FILE *pF)
load the array from file.
Definition: othelloindex.h:62
Describes the data structure l-Othello. It classifies keys of keyType into 2^L classes.
Definition: othello.h:25
uint32_t query(const keyType &k)
return the index of key k, in range [0..n-1]
Definition: othelloindex.h:51
void writeDataToBinaryFile(FILE *pF)
write array to binary file.
Definition: othelloindex.h:70
valueType query(const keyType &k, uint32_t &ha, uint32_t &hb)
compute the hash value of key and return query value.
Definition: othello.h:344
OthelloIndex(keyType *_keys, uint32_t keycount)
Construct OthelloIndex
Definition: othelloindex.h:31