BlockedBloomFilterSize Struct

The size of a BlockedBloomFilter: a number of 512-bit blocks and a number of bits set per value.

public readonly struct BlockedBloomFilterSize

Remarks

The values do not spread evenly over the blocks: the number of values per block follows a Poisson distribution, and the crowded blocks answer "maybe" more often than the average. BlockedBloomFilterSize.CreateOptimalSize accounts for this, so it returns more bits than BloomFilterSize.CreateOptimalSize for the same false positive probability.

Properties

NameDescription
BitCountGets the total number of bits: BlockedBloomFilterSize.BlockCount × 512.
BlockCountGets the number of 512-bit (64-byte) blocks.
HashCountGets the number of bits set in the block of a value when it is added.

Gets the total number of bits: BlockedBloomFilterSize.BlockCount × 512.

public long BitCount { get; }

Property value

long

Gets the number of 512-bit (64-byte) blocks.

public long BlockCount { get; }

Property value

long

Gets the number of bits set in the block of a value when it is added.

public int HashCount { get; }

Property value

int

Methods

NameDescription
CreateExact(long, int)
CreateOptimalSize(long, double)Computes the smallest size whose false positive probability, once expectedItemCount values are added, is at most falsePositiveProbability.
GetFalsePositiveProbability(long)Computes the expected false positive probability of a filter of this size once itemCount distinct values are added.

CreateExact(long, int)

BlockedBloomFilterSize.cs
public static BlockedBloomFilterSize CreateExact(long blockCount, int hashCount)

Parameters

blockCount long
hashCount int

Returns

BlockedBloomFilterSize

No documentation is available.

CreateOptimalSize(long, double)

BlockedBloomFilterSize.cs

Computes the smallest size whose false positive probability, once expectedItemCount values are added, is at most falsePositiveProbability.

public static BlockedBloomFilterSize CreateOptimalSize(long expectedItemCount, double falsePositiveProbability)

Parameters

expectedItemCount long
falsePositiveProbability double

Returns

BlockedBloomFilterSize

GetFalsePositiveProbability(long)

BlockedBloomFilterSize.cs

Computes the expected false positive probability of a filter of this size once itemCount distinct values are added.

public double GetFalsePositiveProbability(long itemCount)

Parameters

itemCount long

Returns

double