|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Probabilistic set membership with Cuckoo filters. More...
#include <cassert>#include <cstddef>#include <cmath>#include <optional>#include <random>#include <algorithm>#include <hash-fct.H>#include <ah-errors.H>#include <ahUtils.H>#include <tpl_array.H>Go to the source code of this file.
Classes | |
| class | Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket > |
| Industrial-grade Cuckoo Filter implementation. More... | |
| struct | Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::Bucket |
| struct | Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::Victim |
| Victim entry: a fingerprint displaced during a failed kick chain. More... | |
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Probabilistic set membership with Cuckoo filters.
A Cuckoo filter is a space-efficient probabilistic data structure that supports adding, deleting, and checking for the presence of items. Compared to Bloom filters, Cuckoo filters support deletion and provide better space efficiency for low false positive rates.
The filter consists of an array of buckets, where each bucket can hold multiple fingerprints (partial hashes).
x has two candidate buckets: h1(x) and h2(x).h2(x) = h1(x) ⊕ hash(fingerprint(x)). This property allows finding the other candidate bucket without knowing the original item.| T | Item type. |
| FingerprintBits | Number of bits per fingerprint (e.g., 8, 12, 16). |
| EntriesPerBucket | Associativity (number of slots per bucket). |
2 * EntriesPerBucket / 2^FingerprintBits. With the defaults (8-bit fingerprints, 4 entries per bucket) this is ~3.1 %.remove() the filter will still report the item as present. Callers that need set semantics should guard with contains() before inserting.Definition in file cuckoo-filter.H.