|
| Othello (uint8_t _L, keyType *_keys, uint32_t keycount, bool _autoclear=true, void *_values=NULL, size_t _valuesize=0, int32_t _allowed_conflicts=-1) |
| Construct l-Othello. More...
|
|
template<typename VT > |
| Othello (uint8_t _L, vector< keyType > &keys, vector< VT > &values, bool _autoclear=true, int32_t allowed_conflicts=-1) |
| Construct othello with vectors.
|
|
void | finishBuild () |
| release memory space used during construction and forbid future modification of arrayA and arrayB.
|
|
void | exportInfo (unsigned char *v) |
| export the information of the Othello, not including the array, to a memory space. More...
|
|
| Othello (unsigned char *v) |
| load the infomation of the Othello from memory. More...
|
|
void | addkeys (int newkeys, void *values, uint32_t valuesize) |
| after putting some keys into keys, call this function to add keys into Othello. values shall be stored in the array *values
|
|
uint64_t | queryInt (const keyType &k) |
| returns a 64-bit integer query value for a key.
|
|
void | printValueTSize () |
|
vector< uint32_t > | getCnt () |
| returns vector, length = 2L. position x: the number of 1s on the x-th lowest bit, for array A, if x<L; otherwise, for arrayB.
|
|
vector< double > | getRatio () |
| returns vector, length = L. position x: the probability that query return 1 on the x-th lowest bit.
|
|
void | randomflip () |
| adjust the array so that for random alien query, returns 0 or 1 with equal probability on each bit.
|
|
void | setAlienPreference (double ideal=1.0) |
| adjust the array so that for random alien query, return 1 with probability that is close to the ideal value. More...
|
|
valueType | query (const keyType &k, uint32_t &ha, uint32_t &hb) |
| compute the hash value of key and return query value. More...
|
|
void | get_hash_2 (const keyType &v, uint32_t &ret1) |
|
void | get_hash (const keyType &v, uint32_t &ret1, uint32_t &ret2) |
|
void | loadDataFromBinaryFile (FILE *pF) |
| load the array from file. More...
|
|
void | writeDataToBinaryFile (FILE *pF) |
| write array to binary file.
|
|
void | removeOneKey (uint32_t kid) |
| remove one key with the particular index from the keylist. More...
|
|
void | updatevalue (uint32_t kid, void *values, uint32_t valuesize) |
| update the value for one particular key.
|
|
template<class keyType>
class Othello< keyType >
Describes the data structure l-Othello. It classifies keys of keyType into 2^L classes.
- Note
- Query a key of keyType always return uint64_t, however, only the lowest L bits are meaningful.
The array are all stored in an array of uint64_t. There are actually m_a+m_b cells in this array, each of length L.