|
static void | save (const std::string &path, const cpptoml::table &table, const char *data, size_t n) |
|
static bool | is_bloom_file (const std::string &path) |
|
static bool | check_file_signature (const std::string &path, const std::string &signature) |
|
|
class | KmerBloomFilter |
|
class | SeedBloomFilter |
|
btllib::BloomFilter::BloomFilter |
( |
| ) |
|
|
inline |
Construct a dummy Bloom filter (e.g. as a default argument).
btllib::BloomFilter::BloomFilter |
( |
size_t |
bytes, |
|
|
unsigned |
hash_num, |
|
|
std::string |
hash_fn = "" |
|
) |
| |
Construct an empty Bloom filter of given size.
- Parameters
-
bytes | Filter size in bytes. |
hash_num | Number of hash values per element. |
hash_fn | Name of the hash function used. Used for metadata. Optional. |
btllib::BloomFilter::BloomFilter |
( |
const std::string & |
path | ) |
|
|
explicit |
Load a Bloom filter from a file.
- Parameters
-
path | Filepath to load from. |
bool btllib::BloomFilter::contains |
( |
const uint64_t * |
hashes | ) |
const |
Check for the presence of an element's hash values.
- Parameters
-
hashes | Integer array of hash values. Array size should equal the hash_num argument used when the Bloom filter was constructed. |
- Returns
- True if present, false otherwise.
bool btllib::BloomFilter::contains |
( |
const std::vector< uint64_t > & |
hashes | ) |
const |
|
inline |
Check for the presence of an element's hash values.
- Parameters
-
hashes | Integer vector of hash values. |
- Returns
- True if present, false otherwise.
bool btllib::BloomFilter::contains_insert |
( |
const uint64_t * |
hashes | ) |
|
Check for the presence of an element's hash values and insert if missing.
- Parameters
-
hashes | Integer array of hash values. Array size should equal the hash_num argument used when the Bloom filter was constructed. |
- Returns
- True if present before insertion, false otherwise.
bool btllib::BloomFilter::contains_insert |
( |
const std::vector< uint64_t > & |
hashes | ) |
|
|
inline |
Check for the presence of an element's hash values and insert if missing.
- Parameters
-
hashes | Integer vector of hash values. |
- Returns
- True if present before insertion, false otherwise.
size_t btllib::BloomFilter::get_bytes |
( |
| ) |
const |
|
inline |
Get filter size in bytes.
double btllib::BloomFilter::get_fpr |
( |
| ) |
const |
Get the query false positive rate.
const std::string& btllib::BloomFilter::get_hash_fn |
( |
| ) |
const |
|
inline |
Get the name of the hash function used.
unsigned btllib::BloomFilter::get_hash_num |
( |
| ) |
const |
|
inline |
Get the number of hash values per element.
double btllib::BloomFilter::get_occupancy |
( |
| ) |
const |
Get the fraction of the filter occupied by 1 bits.
uint64_t btllib::BloomFilter::get_pop_cnt |
( |
| ) |
const |
Get population count, i.e. the number of 1 bits in the filter.
void btllib::BloomFilter::insert |
( |
const uint64_t * |
hashes | ) |
|
Insert an element's hash values.
- Parameters
-
hashes | Integer array of hash values. Array size should equal the hash_num argument used when the Bloom filter was constructed. |
void btllib::BloomFilter::insert |
( |
const std::vector< uint64_t > & |
hashes | ) |
|
|
inline |
Insert an element's hash values.
- Parameters
-
hashes | Integer vector of hash values. |
static bool btllib::BloomFilter::is_bloom_file |
( |
const std::string & |
path | ) |
|
|
inlinestatic |
Check whether the file at the given path is a saved Bloom filter.
- Parameters
-
void btllib::BloomFilter::save |
( |
const std::string & |
path | ) |
|
Save the Bloom filter to a file that can be loaded in the future.
- Parameters
-
path | Filepath to store filter at. |
The documentation for this class was generated from the following file: