Module hyperloglog_rs::utils

source ·
Expand description

Utils

This module provides utility functions used by the HyperLogLog algorithm implementation.

The functions provided are:

  • ceil(numerator: usize, denominator: usize) -> usize: Calculates the integer ceil of the division of numerator by denominator.

  • word_from_registers<const NUMBER_OF_BITS_PER_REGISTER: usize>(registers: &[u32]) -> u32: Converts an array of HLL registers into a single 32-bit word.

Functions

  • Calculates the integer ceil of the division of numerator by denominator.
  • Computes the alpha constant for the given number of registers.
  • Returns an empirically determined threshold to decide on the use of linear counting.
  • Precomputes small corrections for HyperLogLog algorithm.