NVBIO
|
A Bloom filter implementation. This class is storage-free, and can used both from the host and the device. Constructing a Bloom filter can be done incrementally calling insert(), either sequentially or in parallel.
K | the number of hash functions, obtained as { Hash1 + i * Hash2 | i : 0, ..., K-1 } |
Hash1 | the first hash function |
Hash2 | the second hash function |
Iterator | the iterator to the internal filter storage, iterator_traits<iterator>::value_type must be a uint32 |
OrOperator | the binary functor used to OR the filter's words with the inserted keys; NOTE: this operation must be performed atomically if the filter is constructed in parallel |
Definition at line 264 of file bloom_filter.h.
#include <bloom_filter.h>
Public Methods | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE | bloom_filter (const uint64 size, Iterator storage, const Hash1 hash1=Hash1(), const Hash2 hash2=Hash2()) |
template<typename Key > | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void | insert (const Key key, const OrOperator or_op=OrOperator()) |
template<typename Key > | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool | has (const Key key) const |
template<typename Key > | |
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool | operator[] (const Key key) const |
template<typename Key > | |
void | insert (const Key key, const OrOperator or_op) |
template<typename Key > | |
bool | has (const Key key) const |
Public Members | |
uint64 | m_size |
Iterator | m_storage |
Hash1 | m_hash1 |
Hash2 | m_hash2 |
nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::bloom_filter | ( | const uint64 | size, |
Iterator | storage, | ||
const Hash1 | hash1 = Hash1() , |
||
const Hash2 | hash2 = Hash2() |
||
) |
constructor
size | the Bloom filter's storage size, in bits |
storage | the Bloom filter's internal storage |
hash1 | the first hashing function |
hash2 | the second hashing function |
Definition at line 36 of file bloom_filter_inl.h.
bool nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::has | ( | const Key | key) | const |
Definition at line 79 of file bloom_filter_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::has | ( | const Key | key) | const |
check for a key
void nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::insert | ( | const Key | key, |
const OrOperator | or_op | ||
) |
Definition at line 53 of file bloom_filter_inl.h.
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::insert | ( | const Key | key, |
const OrOperator | or_op = OrOperator() |
||
) |
insert a key
|
inline |
check for a key
Definition at line 296 of file bloom_filter.h.
Hash1 nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_hash1 |
Definition at line 300 of file bloom_filter.h.
Hash2 nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_hash2 |
Definition at line 301 of file bloom_filter.h.
uint64 nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_size |
Definition at line 298 of file bloom_filter.h.
Iterator nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_storage |
Definition at line 299 of file bloom_filter.h.