156#ifndef __ADS_GrafiteFilter
157 #define __ADS_GrafiteFilter
174#include <string_view>
191template< RadixKey T = std::u
int64_t >
218 std::uint64_t seed = 1 );
249 [[nodiscard]]
bool mayContain(
const T & a ,
const T & b )
const;
253 [[nodiscard]]
bool maybe(
const T & x )
const;
260 [[nodiscard]] std::size_t
size(
void )
const;
263 [[nodiscard]]
bool empty(
void )
const;
267 [[nodiscard]] std::size_t
codes(
void )
const;
270 [[nodiscard]] std::uint64_t
reduced(
void )
const;
281 [[nodiscard]]
static constexpr std::uint64_t
persistTag(
void ) {
282 return( detail::persistMix( {
sizeof( T ) } ) );
293 [[nodiscard]] std::uint64_t code( std::uint64_t x )
const;
297 [[nodiscard]]
bool meets( std::uint64_t x , std::uint64_t y )
const;
300 std::uint64_t f_r = 1;
301 std::uint64_t f_alo = 0 , f_ahi = 0;
302 std::uint64_t f_blo = 0 , f_bhi = 0;
303 std::uint64_t f_first = 0;
317template< RadixKey T = std::u
int64_t >
357 [[nodiscard]]
bool mayContain(
const T & a ,
const T & b )
const;
360 [[nodiscard]]
bool maybe(
const T & x )
const;
366 [[nodiscard]] std::size_t
buckets(
void )
const;
374 static constexpr std::string_view
persistName =
"BucketingFilter";
377 [[nodiscard]]
static constexpr std::uint64_t
persistTag(
void ) {
378 return( detail::persistMix( {
sizeof( T ) } ) );
389 std::uint64_t f_s = 1;
401#include "ADS/set/impl/GrafiteFilter.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The Elias-Fano representation of a non-decreasing sequence of integers in (chapters 11,...
The engineered hash functions of ADS, beyond the book [see HashFunctions.h for those of section 7....
A file mapped in memory, shared by the structures that are read from it in place [see Persistence....
The sorts by the digits of the keys, beyond the book (which has Counting Sort and Pigeonhole Sort,...
static constexpr std::string_view persistName
the name of the structure in a file [see Persistence.h]
Definition GrafiteFilter.h:374
static constexpr std::uint64_t persistTag(void)
the parameters of the layout, in a file
Definition GrafiteFilter.h:377
std::size_t sizeInBits(void) const
the bits of the buckets and of the directory of select
std::size_t buckets(void) const
the buckets that hold a key
void persist(A &a)
the members written to, or read from, the archive [see Persistence.h]
std::uint64_t bucketWidth(void) const
the keys of a bucket,
bool maybe(const T &x) const
mayContain( x , x )
bool mayContain(const T &a, const T &b) const
true if holds a key, and if a bucket of a key meets it
BucketingFilter(const std::vector< T > &keys, int B=16)
the filter of the keys, which may repeat, in at most bits per key
BucketingFilter(void)
the filter of no key
Definition GrafiteFilter.h:324
void persist(A &a)
the members written to, or read from, the archive [see Persistence.h]
bool mayContain(const T &a, const T &b) const
true if holds a key, and with probability at most otherwise
double falsePositiveBound(double l) const
the bound of the false positive probability of a range of keys
static constexpr std::uint64_t persistTag(void)
the parameters of the layout, in a file
Definition GrafiteFilter.h:281
std::size_t codes(void) const
the distinct codes, less the keys of that share a code
std::size_t sizeInBits(void) const
the bits of the codes and of the directory of select
static constexpr std::string_view persistName
the name of the structure in a file [see Persistence.h]
Definition GrafiteFilter.h:278
GrafiteFilter(const std::vector< T > &keys, int B=16, std::uint64_t seed=1)
the filter of the keys, which may repeat, in bits per key
bool empty(void) const
true if the filter has no key
bool maybe(const T &x) const
mayContain( x , x ): true for a key, and with probability at most otherwise
std::size_t size(void) const
the keys of the build, the repeated ones once each
std::uint64_t reduced(void) const
the reduced universe
GrafiteFilter(void)
the filter of no key
Definition GrafiteFilter.h:198
BasicEliasFano< false > EliasFano
Elias-Fano with the inventories of built in the constructor, the fastest access() and nextGEQ().
Definition EliasFano.h:291