gatb.core-API-0.0.0
BloomNeighborCoherent< Item > Class Template Reference

Bloom filter implementation with cache consideration. More...

#include <Bloom.hpp>

Inheritance diagram for BloomNeighborCoherent< Item >:
Inheritance graph

Public Member Functions

 BloomNeighborCoherent (u_int64_t tai_bloom, size_t kmersize, size_t nbHash=4, size_t block_nbits=12)
 
void insert (const Item &item)
 
std::string getName () const
 
u_int64_t getBitSize ()
 
bool contains (const Item &item)
 
std::bitset< 4 > contains4 (const Item &item, bool right)
 
std::bitset< 8 > contains8 (const Item &item)
 
- Public Member Functions inherited from BloomCacheCoherent< Item >
 BloomCacheCoherent (u_int64_t tai_bloom, size_t nbHash=4, size_t block_nbits=12)
 
unsigned long weight ()
 
- Public Member Functions inherited from Bloom< Item >
 Bloom (u_int64_t tai_bloom, size_t nbHash=4)
 
void flush ()
 
void dump (const char *filename)
 
- Public Member Functions inherited from BloomContainer< Item >
 BloomContainer (u_int64_t tai_bloom, size_t nbHash=4)
 
virtual ~BloomContainer ()
 
size_t getNbHash () const
 
virtual u_int8_t *& getArray ()
 
virtual u_int64_t getSize ()
 
- Public Member Functions inherited from IBloom< Item >
virtual ~IBloom ()
 
- Public Member Functions inherited from Container< Item >
virtual ~Container ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 
- Public Member Functions inherited from Bag< Item >
virtual void insert (const std::vector< Item > &items, size_t length=0)
 
virtual void insert (const Item *items, size_t length)
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 

Additional Inherited Members

- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

template<typename Item>
class gatb::core::tools::collections::impl::BloomNeighborCoherent< Item >

Bloom filter implementation with cache consideration.

This implementation improve memory locality in the Bloom filter between a kmer and its neighbors. This means that this implementation should be used only with Item being a kmer.

In particular, it implements contains4 and contains8 in a clever way.

Constructor & Destructor Documentation

BloomNeighborCoherent ( u_int64_t  tai_bloom,
size_t  kmersize,
size_t  nbHash = 4,
size_t  block_nbits = 12 
)
inline

Constructor.

Parameters
[in]tai_bloom: size (in bits) of the bloom filter.
[in]kmersize: kmer size
[in]nbHash: number of hash functions to use
[in]block_nbits: size of the block (actual 2^nbits)

Member Function Documentation

bool contains ( const Item &  item)
inlinevirtual

Reimplemented from BloomCacheCoherent< Item >.

std::bitset<4> contains4 ( const Item &  item,
bool  right 
)
inlinevirtual

Tells whether the 4 neighbors of the given item are in the Bloom filter. The 4 neighbors are computed from the given item by adding successively nucleotides 'A', 'C', 'T' and 'G' Note: some implementation may not provide this service.

Parameters
[in]item: starting item from which neighbors are computed.
[in]right: if true, successors are computed, otherwise predecessors are computed.
Returns
a bitset with a boolean for the 'contains' status of each neighbor

Reimplemented from BloomContainer< Item >.

std::bitset<8> contains8 ( const Item &  item)
inlinevirtual

Tells whether the 8 neighbors of the given item are in the Bloom filter. A default implementation may be two calls to contains4 with right==true and right==left and by concatenating the two bitsets. Note: some implementation may not provide this service.

Parameters
[in]item: starting item from which neighbors are computed.
Returns
a bitset with a boolean for the 'contains' status of each neighbor

Reimplemented from BloomContainer< Item >.

u_int64_t getBitSize ( )
inlinevirtual

Get the size of the Bloom filter (in bits).

Returns
the size of the bit set of the Bloom filter

Reimplemented from BloomCacheCoherent< Item >.

std::string getName ( ) const
inlinevirtual

Get the name of the implementation class.

Returns
the class name.

Reimplemented from BloomCacheCoherent< Item >.

void insert ( const Item &  item)
inlinevirtual

Reimplemented from BloomCacheCoherent< Item >.


The documentation for this class was generated from the following file: