NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Methods | Public Members | List of all members
nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator > Struct Template Reference

Detailed description

template< uint32 K, typename Hash1, typename Hash2, typename Iterator, typename OrOperator = inplace_or<uint32>>
struct nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >

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.

Template Parameters
Kthe number of hash functions, obtained as { Hash1 + i * Hash2 | i : 0, ..., K-1 }
Hash1the first hash function
Hash2the second hash function
Iteratorthe iterator to the internal filter storage, iterator_traits<iterator>::value_type must be a uint32
OrOperatorthe 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
 

Constructor & Destructor Documentation

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator >
nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::bloom_filter ( const uint64  size,
Iterator  storage,
const Hash1  hash1 = Hash1(),
const Hash2  hash2 = Hash2() 
)

constructor

Parameters
sizethe Bloom filter's storage size, in bits
storagethe Bloom filter's internal storage
hash1the first hashing function
hash2the second hashing function

Definition at line 36 of file bloom_filter_inl.h.

Member Function Documentation

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
template<typename Key >
bool nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::has ( const Key  key) const

Definition at line 79 of file bloom_filter_inl.h.

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
template<typename Key >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::has ( const Key  key) const

check for a key

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
template<typename 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.

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
template<typename Key >
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

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
template<typename Key >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::operator[] ( const Key  key) const
inline

check for a key

Definition at line 296 of file bloom_filter.h.

Member Data Documentation

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
Hash1 nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_hash1

Definition at line 300 of file bloom_filter.h.

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
Hash2 nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_hash2

Definition at line 301 of file bloom_filter.h.

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
uint64 nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_size

Definition at line 298 of file bloom_filter.h.

template<uint32 K, typename Hash1 , typename Hash2 , typename Iterator , typename OrOperator = inplace_or<uint32>>
Iterator nvbio::bloom_filter< K, Hash1, Hash2, Iterator, OrOperator >::m_storage

Definition at line 299 of file bloom_filter.h.


The documentation for this struct was generated from the following files: