23 #ifndef _biomcmc_hashtable_h_ 24 #define _biomcmc_hashtable_h_ 68 uint32_t a1, a2, b1, b2,
P;
int count
pointer to bipartition (must update ref_counter)
Definition: hashtable.h:76
bip_hashtable new_bip_hashtable(int size)
Create new hashtable of size bipartitions.
Definition: hashtable.c:155
Hash table (vector indexed by strings).
Definition: hashtable.h:42
hashtable_item * table
Vector with key/value pairs.
Definition: hashtable.h:56
void del_hashtable(hashtable ht)
Free hashtable space.
Definition: hashtable.c:63
int probelength
Number of collisions before empty slot is found.
Definition: hashtable.h:47
Collections of hash functions for 32 and 64 bits, including one-liners, murmurhash, and xxhash.
uint32_t h
Value set by hash(). Used in hash1() and hash2() to avoid calling hash() again.
Definition: hashtable.h:49
int maxfreq
Number of collisions before empty slot is found.
Definition: hashtable.h:66
void bip_hashtable_insert(bip_hashtable ht, bipartition key)
Insert key (bipartition) into bipartition hashtable, adding one to its count (freq).
Definition: hashtable.c:209
uint32_t P
Random values used in hash functions.
Definition: hashtable.h:68
int value
Integer (position in vector where hashtable_item_struct::key can be found)
Definition: hashtable.h:38
int size
Table size.
Definition: hashtable.h:45
char * key
String (vector of char).
Definition: hashtable.h:36
double bip_hashtable_get_frequency(bip_hashtable ht, bipartition key)
Return frequency of bipartition (count/maxfreq) or zero if not found.
Definition: hashtable.c:235
key/value pair for hash table
Definition: hashtable.h:34
Hash table of bipartitions (see hashtable.h for original version, with string keys and integer values...
Definition: hashtable.h:62
int ref_counter
Counter of how many external references (structures sharing this hashtable) to avoid deletion...
Definition: hashtable.h:58
uint32_t P
Random values used in hash functions.
Definition: hashtable.h:50
void insert_hashtable(hashtable ht, char *key, int value)
Insert key/value pair into hashtable.
Definition: hashtable.c:107
uint32_t h
frequency (integer) of most frequent bipartition
Definition: hashtable.h:67
int ref_counter
Vector with key/value pairs.
Definition: hashtable.h:70
int probelength
Table size.
Definition: hashtable.h:65
key (bipartition) and value (frequency) pair for hash table of bipartitions
Definition: hashtable.h:74
int lookup_hashtable(hashtable ht, char *key)
Return location (value) of corresponding key (string) or negative value if not found.
Definition: hashtable.c:132
Bit-string representation of splits.
Definition: bipartition.h:30
void del_bip_hashtable(bip_hashtable ht)
Free bipartition hashtable space.
Definition: hashtable.c:190
hashtable new_hashtable(int size)
Create new hashtable of size elements.
Definition: hashtable.c:26