diff --git a/src/bloom.c b/src/bloom.c index 935e2d9..a6cbfe4 100755 --- a/src/bloom.c +++ b/src/bloom.c @@ -122,7 +122,6 @@ static void setup_buckets(struct bloom * bloom, unsigned int cache_size) } -// TODO int bloom_filter_size(int entries, double error) { int bytes; @@ -185,7 +184,8 @@ int bloom_init_size(struct bloom * bloom, int entries, double error, setup_buckets(bloom, cache_size); - // TODO comment + // celine.mercier@metabarcoding.org : + // Replaced the calloc with a memset, as the memory for the bloom filter is mapped in our data structure memset(bloom->bf, 0, bloom->bytes); //bloom->bf = (unsigned char *)calloc(bloom->bytes, sizeof(unsigned char)); //if (bloom->bf == NULL) { diff --git a/src/bloom.h b/src/bloom.h index e225b70..651e2e5 100755 --- a/src/bloom.h +++ b/src/bloom.h @@ -9,7 +9,12 @@ #define _BLOOM_H -// TODO +/** *************************************************************************** + * Added by celine.mercier@metabarcoding.org + * + * Bloom filter error rate wanted. + * + */ #define BLOOM_FILTER_ERROR_RATE (0.001) @@ -72,7 +77,13 @@ struct bloom typedef struct bloom bloom_t; -// TODO +/** *************************************************************************** + * Added by celine.mercier@metabarcoding.org + * + * This function computes the size needed by the bloom filter + * depending on the number of entries and the error rate. + * + */ int bloom_filter_size(int entries, double error);