pub struct Precision9;
Trait Implementations§
Source§impl Clone for Precision9
impl Clone for Precision9
Source§fn clone(&self) -> Precision9
fn clone(&self) -> Precision9
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Precision9
impl Debug for Precision9
Source§impl Default for Precision9
impl Default for Precision9
Source§fn default() -> Precision9
fn default() -> Precision9
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Precision9
impl<'de> Deserialize<'de> for Precision9
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for Precision9
impl Hash for Precision9
Source§impl PartialEq for Precision9
impl PartialEq for Precision9
Source§impl Precision for Precision9
impl Precision for Precision9
Source§const EXPONENT: usize = 9usize
const EXPONENT: usize = 9usize
The exponent of the number of registers, meaning the number of registers
that will be used is 2^EXPONENT. This is the p parameter in the HyperLogLog.
Source§const SMALL_CORRECTIONS: Self::SmallCorrections
const SMALL_CORRECTIONS: Self::SmallCorrections
The precomputed small corrections used in the HyperLogLog algorithm for better performance.
Source§type NumberOfZeros = u16
type NumberOfZeros = u16
The data type to use for the number of zeros registers counter.
This should be the smallest possinle data type that allows us to count
all the registers without overflowing. We can tollerate a one-off error
when counting the number of zeros, as it will be corrected when computing
the cardinality as it is known before hand whether this can happen at all.
Source§type SmallCorrections = [f32; 512]
type SmallCorrections = [f32; 512]
Type for small corrections:
type Registers = [u32; 512]
Source§const NUMBER_OF_REGISTERS: usize = _
const NUMBER_OF_REGISTERS: usize = _
The number of registers that will be used.
Source§impl Serialize for Precision9
impl Serialize for Precision9
Source§impl WordType<1> for Precision9
impl WordType<1> for Precision9
Source§type Words = [u32; 16]
type Words = [u32; 16]
The type to use for the associated vector of words.
The type of Words is always an array of u32, as this is the smallest
type that can be used to store the number of registers. Read more
Source§type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 2]
type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 2]
The register multiplicities is an array with the length of the largest possible
value that can appear in a register. The value at index i is the number of registers
that have a value equal to i, meaning the largest value that any register can have
is the number of registers, i.e. 2^EXPONENT. This is the m parameter in the HyperLogLog.
The lenth of the multiplicities array varies depending on the exponent and the number of bits,
as the length of the array is equal to the maximal value that can be stored in a register.
The value being stored in the register is the number of leading zeros in the hash of the
value that is being inserted.
When the register is of 1 bit, the maximal value is 1, and the length of the array is 2.
When the register is of 2 bits, the maximal value is 3, and the length of the array is 4.
When the register is of 3 bits, the maximal value is 7, and the length of the array is 8.
When the register is of 4 bits, the maximal value is 15, and the length of the array is 16.
When the register is of 5 bits, the maximal value is 31, and the length of the array is 32.
Things start to get interesting for the cases of register at least 6 bits, as the maximal
value representable in 6 bits is 63, but here we have to take into account the fact that
the precision will be the limiting factor. In fact, the higher the precision, the larger
the number of registers, and therefore more bits of the hash will be used to sample the
register associated to a given value. For this reason, in those cases, the maximal value
that we may encounter stored in the register is not 63, but 64 - (PRECISION - 1) + 1.
So, when the register is of 6 bits, we need to consider the precision as follows:
When the precision is 4, the maximal value is 61, and the length of the array is 62.
When the precision is 5, the length of the array is 61.
When the precision is 6, the length of the array is 60.
The decrease in length continues linearly until the maximal precision for which we
have experimental parameters, which is 18, where the length of the array is 48.
type FloatMultiplicities = [f32; 2]
Source§impl WordType<2> for Precision9
impl WordType<2> for Precision9
Source§type Words = [u32; 32]
type Words = [u32; 32]
The type to use for the associated vector of words.
The type of Words is always an array of u32, as this is the smallest
type that can be used to store the number of registers. Read more
Source§type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 4]
type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 4]
The register multiplicities is an array with the length of the largest possible
value that can appear in a register. The value at index i is the number of registers
that have a value equal to i, meaning the largest value that any register can have
is the number of registers, i.e. 2^EXPONENT. This is the m parameter in the HyperLogLog.
The lenth of the multiplicities array varies depending on the exponent and the number of bits,
as the length of the array is equal to the maximal value that can be stored in a register.
The value being stored in the register is the number of leading zeros in the hash of the
value that is being inserted.
When the register is of 1 bit, the maximal value is 1, and the length of the array is 2.
When the register is of 2 bits, the maximal value is 3, and the length of the array is 4.
When the register is of 3 bits, the maximal value is 7, and the length of the array is 8.
When the register is of 4 bits, the maximal value is 15, and the length of the array is 16.
When the register is of 5 bits, the maximal value is 31, and the length of the array is 32.
Things start to get interesting for the cases of register at least 6 bits, as the maximal
value representable in 6 bits is 63, but here we have to take into account the fact that
the precision will be the limiting factor. In fact, the higher the precision, the larger
the number of registers, and therefore more bits of the hash will be used to sample the
register associated to a given value. For this reason, in those cases, the maximal value
that we may encounter stored in the register is not 63, but 64 - (PRECISION - 1) + 1.
So, when the register is of 6 bits, we need to consider the precision as follows:
When the precision is 4, the maximal value is 61, and the length of the array is 62.
When the precision is 5, the length of the array is 61.
When the precision is 6, the length of the array is 60.
The decrease in length continues linearly until the maximal precision for which we
have experimental parameters, which is 18, where the length of the array is 48.
type FloatMultiplicities = [f32; 4]
Source§impl WordType<3> for Precision9
impl WordType<3> for Precision9
Source§type Words = [u32; 52]
type Words = [u32; 52]
The type to use for the associated vector of words.
The type of Words is always an array of u32, as this is the smallest
type that can be used to store the number of registers. Read more
Source§type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 8]
type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 8]
The register multiplicities is an array with the length of the largest possible
value that can appear in a register. The value at index i is the number of registers
that have a value equal to i, meaning the largest value that any register can have
is the number of registers, i.e. 2^EXPONENT. This is the m parameter in the HyperLogLog.
The lenth of the multiplicities array varies depending on the exponent and the number of bits,
as the length of the array is equal to the maximal value that can be stored in a register.
The value being stored in the register is the number of leading zeros in the hash of the
value that is being inserted.
When the register is of 1 bit, the maximal value is 1, and the length of the array is 2.
When the register is of 2 bits, the maximal value is 3, and the length of the array is 4.
When the register is of 3 bits, the maximal value is 7, and the length of the array is 8.
When the register is of 4 bits, the maximal value is 15, and the length of the array is 16.
When the register is of 5 bits, the maximal value is 31, and the length of the array is 32.
Things start to get interesting for the cases of register at least 6 bits, as the maximal
value representable in 6 bits is 63, but here we have to take into account the fact that
the precision will be the limiting factor. In fact, the higher the precision, the larger
the number of registers, and therefore more bits of the hash will be used to sample the
register associated to a given value. For this reason, in those cases, the maximal value
that we may encounter stored in the register is not 63, but 64 - (PRECISION - 1) + 1.
So, when the register is of 6 bits, we need to consider the precision as follows:
When the precision is 4, the maximal value is 61, and the length of the array is 62.
When the precision is 5, the length of the array is 61.
When the precision is 6, the length of the array is 60.
The decrease in length continues linearly until the maximal precision for which we
have experimental parameters, which is 18, where the length of the array is 48.
type FloatMultiplicities = [f32; 8]
Source§impl WordType<4> for Precision9
impl WordType<4> for Precision9
Source§type Words = [u32; 64]
type Words = [u32; 64]
The type to use for the associated vector of words.
The type of Words is always an array of u32, as this is the smallest
type that can be used to store the number of registers. Read more
Source§type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 16]
type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 16]
The register multiplicities is an array with the length of the largest possible
value that can appear in a register. The value at index i is the number of registers
that have a value equal to i, meaning the largest value that any register can have
is the number of registers, i.e. 2^EXPONENT. This is the m parameter in the HyperLogLog.
The lenth of the multiplicities array varies depending on the exponent and the number of bits,
as the length of the array is equal to the maximal value that can be stored in a register.
The value being stored in the register is the number of leading zeros in the hash of the
value that is being inserted.
When the register is of 1 bit, the maximal value is 1, and the length of the array is 2.
When the register is of 2 bits, the maximal value is 3, and the length of the array is 4.
When the register is of 3 bits, the maximal value is 7, and the length of the array is 8.
When the register is of 4 bits, the maximal value is 15, and the length of the array is 16.
When the register is of 5 bits, the maximal value is 31, and the length of the array is 32.
Things start to get interesting for the cases of register at least 6 bits, as the maximal
value representable in 6 bits is 63, but here we have to take into account the fact that
the precision will be the limiting factor. In fact, the higher the precision, the larger
the number of registers, and therefore more bits of the hash will be used to sample the
register associated to a given value. For this reason, in those cases, the maximal value
that we may encounter stored in the register is not 63, but 64 - (PRECISION - 1) + 1.
So, when the register is of 6 bits, we need to consider the precision as follows:
When the precision is 4, the maximal value is 61, and the length of the array is 62.
When the precision is 5, the length of the array is 61.
When the precision is 6, the length of the array is 60.
The decrease in length continues linearly until the maximal precision for which we
have experimental parameters, which is 18, where the length of the array is 48.
type FloatMultiplicities = [f32; 16]
Source§impl WordType<5> for Precision9
impl WordType<5> for Precision9
Source§type Words = [u32; 86]
type Words = [u32; 86]
The type to use for the associated vector of words.
The type of Words is always an array of u32, as this is the smallest
type that can be used to store the number of registers. Read more
Source§type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 32]
type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 32]
The register multiplicities is an array with the length of the largest possible
value that can appear in a register. The value at index i is the number of registers
that have a value equal to i, meaning the largest value that any register can have
is the number of registers, i.e. 2^EXPONENT. This is the m parameter in the HyperLogLog.
The lenth of the multiplicities array varies depending on the exponent and the number of bits,
as the length of the array is equal to the maximal value that can be stored in a register.
The value being stored in the register is the number of leading zeros in the hash of the
value that is being inserted.
When the register is of 1 bit, the maximal value is 1, and the length of the array is 2.
When the register is of 2 bits, the maximal value is 3, and the length of the array is 4.
When the register is of 3 bits, the maximal value is 7, and the length of the array is 8.
When the register is of 4 bits, the maximal value is 15, and the length of the array is 16.
When the register is of 5 bits, the maximal value is 31, and the length of the array is 32.
Things start to get interesting for the cases of register at least 6 bits, as the maximal
value representable in 6 bits is 63, but here we have to take into account the fact that
the precision will be the limiting factor. In fact, the higher the precision, the larger
the number of registers, and therefore more bits of the hash will be used to sample the
register associated to a given value. For this reason, in those cases, the maximal value
that we may encounter stored in the register is not 63, but 64 - (PRECISION - 1) + 1.
So, when the register is of 6 bits, we need to consider the precision as follows:
When the precision is 4, the maximal value is 61, and the length of the array is 62.
When the precision is 5, the length of the array is 61.
When the precision is 6, the length of the array is 60.
The decrease in length continues linearly until the maximal precision for which we
have experimental parameters, which is 18, where the length of the array is 48.
type FloatMultiplicities = [f32; 32]
Source§impl WordType<6> for Precision9
impl WordType<6> for Precision9
Source§type Words = [u32; 103]
type Words = [u32; 103]
The type to use for the associated vector of words.
The type of Words is always an array of u32, as this is the smallest
type that can be used to store the number of registers. Read more
Source§type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 57]
type RegisterMultiplicities = [<Precision9 as Precision>::NumberOfZeros; 57]
The register multiplicities is an array with the length of the largest possible
value that can appear in a register. The value at index i is the number of registers
that have a value equal to i, meaning the largest value that any register can have
is the number of registers, i.e. 2^EXPONENT. This is the m parameter in the HyperLogLog.
The lenth of the multiplicities array varies depending on the exponent and the number of bits,
as the length of the array is equal to the maximal value that can be stored in a register.
The value being stored in the register is the number of leading zeros in the hash of the
value that is being inserted.
When the register is of 1 bit, the maximal value is 1, and the length of the array is 2.
When the register is of 2 bits, the maximal value is 3, and the length of the array is 4.
When the register is of 3 bits, the maximal value is 7, and the length of the array is 8.
When the register is of 4 bits, the maximal value is 15, and the length of the array is 16.
When the register is of 5 bits, the maximal value is 31, and the length of the array is 32.
Things start to get interesting for the cases of register at least 6 bits, as the maximal
value representable in 6 bits is 63, but here we have to take into account the fact that
the precision will be the limiting factor. In fact, the higher the precision, the larger
the number of registers, and therefore more bits of the hash will be used to sample the
register associated to a given value. For this reason, in those cases, the maximal value
that we may encounter stored in the register is not 63, but 64 - (PRECISION - 1) + 1.
So, when the register is of 6 bits, we need to consider the precision as follows:
When the precision is 4, the maximal value is 61, and the length of the array is 62.
When the precision is 5, the length of the array is 61.
When the precision is 6, the length of the array is 60.
The decrease in length continues linearly until the maximal precision for which we
have experimental parameters, which is 18, where the length of the array is 48.
type FloatMultiplicities = [f32; 57]
impl Copy for Precision9
impl Eq for Precision9
impl StructuralPartialEq for Precision9
Auto Trait Implementations§
impl Freeze for Precision9
impl RefUnwindSafe for Precision9
impl Send for Precision9
impl Sync for Precision9
impl Unpin for Precision9
impl UnwindSafe for Precision9
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more