The two probe positions both filters derive from a BloomHash: bits 0 to kLog2Slots-1 and bits kLog2Slots to 2*kLog2Slots-1. More...
#include "donner/base/BloomFilter.h"
Static Public Member Functions | |
| static constexpr std::size_t | First (BloomHash hash) noexcept |
| Returns the first probe position, from the low bits. | |
| static constexpr std::size_t | Second (BloomHash hash) noexcept |
| Returns the second probe position, from the next kLog2Slots bits. | |
| static double | ExpectedFalsePositiveRate (std::size_t keys) noexcept |
Approximates the false-positive rate after inserting keys distinct uniformly hashed keys into kSlots slots with two probes each: (1 - (1 - 1/kSlots)^(2 * keys))^2. | |
Static Public Attributes | |
| static constexpr std::size_t | kSlots = std::size_t{1} << kLog2Slots |
| Number of slots. | |
| static constexpr std::uint32_t | kIndexMask = static_cast<std::uint32_t>(kSlots - 1) |
| Mask selecting one probe's index bits. | |
The two probe positions both filters derive from a BloomHash: bits 0 to kLog2Slots-1 and bits kLog2Slots to 2*kLog2Slots-1.
The ranges are disjoint, so both fit in 32 bits only for at most 16 index bits.
| kLog2Slots | Base-2 logarithm of the slot count. |
|
inlinestaticnoexcept |
Approximates the false-positive rate after inserting keys distinct uniformly hashed keys into kSlots slots with two probes each: (1 - (1 - 1/kSlots)^(2 * keys))^2.
The estimate treats the two occupancy checks as independent.
| keys | Number of keys present. |