|
NVBIO
|
A blocked 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. The block size is determined by the value_type of the storage Iterator: e.g. a uint4 or a uint64_2 will cause the Bloom filter to use 128-bit blocks, whereas a uint64_4 will cause it to use 256-bit blocks.
| 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 one of {uint32|uint2|uint4|uint64|uint64_2|uint64_4} |
| 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 327 of file bloom_filter.h.
#include <bloom_filter.h>
Public Types | |
| typedef std::iterator_traits < Iterator >::value_type | block_type |
| typedef vector_traits < block_type >::value_type | word_type |
| typedef StaticVector < word_type, BLOCK_DIM > | vector_type |
Public Methods | |
| NVBIO_FORCEINLINE NVBIO_HOST_DEVICE | blocked_bloom_filter (const uint32 k, 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 | |
| uint32 | m_k |
| uint64 | m_size |
| Iterator | m_storage |
| Hash1 | m_hash1 |
| Hash2 | m_hash2 |
Static Public Members | |
| static const uint32 | BLOCK_DIM = vector_traits<block_type>::DIM |
| static const uint32 | BLOCK_SIZE = sizeof(block_type)*8u |
| static const uint32 | WORD_SIZE = sizeof(word_type)*8u |
| typedef std::iterator_traits<Iterator>::value_type nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::block_type |
Definition at line 329 of file bloom_filter.h.
| typedef StaticVector<word_type,BLOCK_DIM> nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::vector_type |
Definition at line 336 of file bloom_filter.h.
| typedef vector_traits<block_type>::value_type nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::word_type |
Definition at line 330 of file bloom_filter.h.
| nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::blocked_bloom_filter | ( | const uint32 | k, |
| 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 106 of file bloom_filter_inl.h.
| bool nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::has | ( | const Key | key) | const |
Definition at line 155 of file bloom_filter_inl.h.
| NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::has | ( | const Key | key) | const |
check for a key
| void nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::insert | ( | const Key | key, |
| const OrOperator | or_op | ||
| ) |
Definition at line 124 of file bloom_filter_inl.h.
| NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::insert | ( | const Key | key, |
| const OrOperator | or_op = OrOperator() |
||
| ) |
insert a key
|
inline |
check for a key
Definition at line 369 of file bloom_filter.h.
|
static |
Definition at line 332 of file bloom_filter.h.
|
static |
Definition at line 333 of file bloom_filter.h.
| Hash1 nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::m_hash1 |
Definition at line 374 of file bloom_filter.h.
| Hash2 nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::m_hash2 |
Definition at line 375 of file bloom_filter.h.
| uint32 nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::m_k |
Definition at line 371 of file bloom_filter.h.
| uint64 nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::m_size |
Definition at line 372 of file bloom_filter.h.
| Iterator nvbio::blocked_bloom_filter< Hash1, Hash2, Iterator, OrOperator >::m_storage |
Definition at line 373 of file bloom_filter.h.
|
static |
Definition at line 334 of file bloom_filter.h.
1.8.4