a static range filter of the keys of type T, \( B \) bits per key: the buckets of \( 2^w / ( n \, 2^{B-2} ) \) keys that hold a key of the set, \( w \) the bits of T, with no bound on the false positives of the queries near a key
More...
#include <ADS/set/GrafiteFilter.h>
|
| | BucketingFilter (void) |
| | the filter of no key
|
| | BucketingFilter (const std::vector< T > &keys, int B=16) |
| | the filter of the keys, which may repeat, in at most \( B \) bits per key
|
| bool | mayContain (const T &a, const T &b) const |
| | true if \( [ a , b ] \) holds a key, and if a bucket of a key meets it
|
| bool | maybe (const T &x) const |
| | mayContain( x , x )
|
| std::uint64_t | bucketWidth (void) const |
| | the keys of a bucket, \( s \)
|
| std::size_t | buckets (void) const |
| | the buckets that hold a key
|
| std::size_t | sizeInBits (void) const |
| | the bits of the buckets and of the directory of select
|
| template<class A> |
| void | persist (A &a) |
| | the members written to, or read from, the archive \( a \) [see Persistence.h]
|
|
| static constexpr std::uint64_t | persistTag (void) |
| | the parameters of the layout, in a file
|
|
| static constexpr std::string_view | persistName = "BucketingFilter" |
| | the name of the structure in a file [see Persistence.h]
|
template<RadixKey T = std::uint64_t>
class ADS::BucketingFilter< T >
a static range filter of the keys of type T, \( B \) bits per key: the buckets of \( 2^w / ( n \, 2^{B-2} ) \) keys that hold a key of the set, \( w \) the bits of T, with no bound on the false positives of the queries near a key
◆ BucketingFilter() [1/2]
template<RadixKey T = std::uint64_t>
◆ BucketingFilter() [2/2]
template<RadixKey T = std::uint64_t>
the filter of the keys, which may repeat, in at most \( B \) bits per key
In pseudocode (the bucketing of Costa, Ferragina and Vinciguerra, beyond the book):
\[\class{pseudocode}{\begin{array}{r@{\quad}l}
1 & \textbf{procedure}\ \mathrm{build}( K , B ) \cr
2 & \quad n \gets \text{the number of distinct keys of } K;\ s \gets
\lceil 2^w / ( n \, 2^{B-2} ) \rceil \cr
3 & \quad \text{keep by Elias-Fano the buckets } \lfloor x / s \rfloor
\text{ of the keys } x \in K \text{, sorted and once each}
\end{array}}
\]
- Precondition
- \( 2 \le B \le 40 \) and \( n \, 2^{B-2} < 2^{63} \)
- Postcondition
- every key may be there (an audit)
◆ buckets()
template<RadixKey T = std::uint64_t>
the buckets that hold a key
◆ bucketWidth()
template<RadixKey T = std::uint64_t>
the keys of a bucket, \( s \)
◆ maybe()
template<RadixKey T = std::uint64_t>
◆ mayContain()
template<RadixKey T = std::uint64_t>
true if \( [ a , b ] \) holds a key, and if a bucket of a key meets it
In pseudocode (as the build):
\[\class{pseudocode}{\begin{array}{r@{\quad}l}
1 & \textbf{function}\ \mathrm{mayContain}( a , b ) \cr
2 & \quad p \gets \mathrm{nextGEQ}( \lfloor a / s \rfloor ) \cr
3 & \quad \textbf{return}\ p \text{ is a bucket kept }
\ \textbf{and}\ \mathrm{access}( p ) \le \lfloor b / s \rfloor
\end{array}}
\]
- Precondition
- \( a \le b \)
◆ persist()
template<RadixKey T = std::uint64_t>
template<class A>
the members written to, or read from, the archive \( a \) [see Persistence.h]
◆ persistTag()
template<RadixKey T = std::uint64_t>
|
|
inlinestaticnodiscardconstexpr |
the parameters of the layout, in a file
◆ sizeInBits()
template<RadixKey T = std::uint64_t>
the bits of the buckets and of the directory of select
◆ persistName
template<RadixKey T = std::uint64_t>
The documentation for this class was generated from the following file: