A spectral Bloom filter with recurring minimum (RM) policy. More...
#include <counting.h>
Public Member Functions | |
spectral_rm_bloom_filter (hasher h1, size_t cells1, size_t width1, hasher h2, size_t cells2, size_t width2) | |
Constructs a spectral RM Bloom filter. More... | |
virtual void | add (object const &o) override |
Adds an element to the Bloom filter. More... | |
virtual size_t | lookup (object const &o) const override |
Retrieves the count of an element. More... | |
virtual void | clear () override |
Removes all items from the Bloom filter. | |
void | remove (object const &o) |
Removes an element. More... | |
Public Member Functions inherited from bf::bloom_filter | |
template<typename T > | |
void | add (T const &x) |
Adds an element to the Bloom filter. More... | |
template<typename T > | |
size_t | lookup (T const &x) const |
Retrieves the count of an element. More... | |
Private Attributes | |
counting_bloom_filter | first_ |
counting_bloom_filter | second_ |
A spectral Bloom filter with recurring minimum (RM) policy.
Definition at line 105 of file counting.h.
bf::spectral_rm_bloom_filter::spectral_rm_bloom_filter | ( | hasher | h1, |
size_t | cells1, | ||
size_t | width1, | ||
hasher | h2, | ||
size_t | cells2, | ||
size_t | width2 | ||
) |
Constructs a spectral RM Bloom filter.
h1 | The first hasher. |
cells1 | The number of cells in the first Bloom filter. |
width1 | The number of bits per cell in the first Bloom filter. |
h2 | The second hasher. |
cells2 | The number of cells in the second Bloom filter. |
width2 | The number of bits per cell in the second Bloom filter. |
Definition at line 136 of file counting.cc.
|
overridevirtual |
Adds an element to the Bloom filter.
o | A wrapped object. |
Implements bf::bloom_filter.
Definition at line 149 of file counting.cc.
References bf::counting_bloom_filter::count(), bf::counting_bloom_filter::find_indices(), bf::counting_bloom_filter::find_minima(), bf::counting_bloom_filter::find_minimum(), and bf::counting_bloom_filter::increment().
|
overridevirtual |
Retrieves the count of an element.
o | A wrapped object. |
Implements bf::bloom_filter.
Definition at line 171 of file counting.cc.
References bf::counting_bloom_filter::count(), bf::counting_bloom_filter::find_indices(), bf::counting_bloom_filter::find_minima(), and bf::counting_bloom_filter::find_minimum().
void bf::spectral_rm_bloom_filter::remove | ( | object const & | o | ) |
Removes an element.
o | The object whose cells to decrement by 1. |
Definition at line 190 of file counting.cc.
References bf::counting_bloom_filter::decrement(), bf::counting_bloom_filter::find_indices(), bf::counting_bloom_filter::find_minima(), and bf::counting_bloom_filter::find_minimum().