|
| | PartitionedBloomFilter (void) |
| | a filter of 64 bits and one part, empty
|
| | PartitionedBloomFilter (std::size_t m, int r, H h=H()) |
| | the empty filter of about \( m \) bits in \( r \) parts
|
| void | insert (const T &x) |
| | \( x \) into the filter, one bit in each part
|
| bool | maybe (const T &x) const |
| | whether \( x \) may be in the set, its bit of each part read: false only if \( x \) was never inserted
|
| std::size_t | ones (void) const |
| | the bits set
|
| std::size_t | bits (void) const |
| | the bits, \( r \) times those of a part
|
| template<class A> |
| void | persist (A &a) |
| | the members written to, or read from, the archive \( a \) [see Persistence.h]
|
template<class T, class H = std::hash< T >>
class ADS::PartitionedBloomFilter< T, H >
a filter of Bloom of \( r \) parts of \( m / r \) bits, a hash for each part
template<class T, class H = std::hash< T >>
\( x \) into the filter, one bit in each part
In pseudocode (Grandi), \( w = \lfloor m / r \rfloor \) the bits of a part:
\[\class{pseudocode}{\begin{array}{r@{\quad}l}
1 & \textbf{procedure}\ \mathrm{insert}( x ) \cr
2 & \quad \textbf{for}\ i \gets 0\ \textbf{to}\ r - 1\ \textbf{do}
\ B[ i w + ( h_1 + i h_2 ) \bmod w ] \gets 1
\end{array}}
\]
- Postcondition
- maybe( x )