biomcmc-lib
0.1
low level library for phylogenetic analysis
|
double hashing open-address hash table using strings as key – also has distance matrix, that can be used in alignments and trees More...
#include "hashfunctions.h"
Go to the source code of this file.
Data Structures | |
struct | hashtable_item_struct |
key/value pair for hash table More... | |
struct | hashtable_struct |
Hash table (vector indexed by strings). More... | |
struct | bip_hashtable_struct |
Hash table of bipartitions (see hashtable.h for original version, with string keys and integer values) More... | |
struct | bip_hashitem_struct |
key (bipartition) and value (frequency) pair for hash table of bipartitions More... | |
Typedefs | |
typedef struct hashtable_struct * | hashtable |
typedef struct hashtable_item_struct * | hashtable_item |
typedef struct bip_hashtable_struct * | bip_hashtable |
typedef struct bip_hashitem_struct * | bip_hashitem |
Functions | |
void | insert_hashtable (hashtable ht, char *key, int value) |
Insert key/value pair into hashtable. | |
int | lookup_hashtable (hashtable ht, char *key) |
Return location (value) of corresponding key (string) or negative value if not found. | |
hashtable | new_hashtable (int size) |
Create new hashtable of size elements. | |
void | del_hashtable (hashtable ht) |
Free hashtable space. | |
bip_hashtable | new_bip_hashtable (int size) |
Create new hashtable of size bipartitions. | |
void | del_bip_hashtable (bip_hashtable ht) |
Free bipartition hashtable space. | |
void | bip_hashtable_insert (bip_hashtable ht, bipartition key) |
Insert key (bipartition) into bipartition hashtable, adding one to its count (freq). | |
double | bip_hashtable_get_frequency (bip_hashtable ht, bipartition key) |
Return frequency of bipartition (count/maxfreq) or zero if not found. | |
double hashing open-address hash table using strings as key – also has distance matrix, that can be used in alignments and trees
Hash tables allow us to search for the position of a key (taxa name) without scanning the whole vector (like in sequencial search). This code is derived from the software DCM3, released under the GPL license (Copyright (C) 2004 The University of Texas at Austin).