pub struct Precision4;
Trait Implementations§
Source§impl Clone for Precision4
impl Clone for Precision4
Source§fn clone(&self) -> Precision4
fn clone(&self) -> Precision4
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 Precision4
impl Debug for Precision4
Source§impl Default for Precision4
impl Default for Precision4
Source§fn default() -> Precision4
fn default() -> Precision4
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Precision4
impl<'de> Deserialize<'de> for Precision4
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 Precision4
impl Hash for Precision4
Source§impl PartialEq for Precision4
impl PartialEq for Precision4
Source§impl Precision for Precision4
impl Precision for Precision4
Source§const EXPONENT: usize = 4usize
const EXPONENT: usize = 4usize
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 = u8
type NumberOfZeros = u8
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; 16]
type SmallCorrections = [f32; 16]
Type for small corrections:
type Registers = [u32; 16]
Source§const NUMBER_OF_REGISTERS: usize = _
const NUMBER_OF_REGISTERS: usize = _
The number of registers that will be used.
Source§impl Serialize for Precision4
impl Serialize for Precision4
Source§impl WordType<1> for Precision4
impl WordType<1> for Precision4
Source§type Words = [u32; 1]
type Words = [u32; 1]
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 = [<Precision4 as Precision>::NumberOfZeros; 2]
type RegisterMultiplicities = [<Precision4 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 Precision4
impl WordType<2> for Precision4
Source§type Words = [u32; 1]
type Words = [u32; 1]
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 = [<Precision4 as Precision>::NumberOfZeros; 4]
type RegisterMultiplicities = [<Precision4 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 Precision4
impl WordType<3> for Precision4
Source§type Words = [u32; 2]
type Words = [u32; 2]
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 = [<Precision4 as Precision>::NumberOfZeros; 8]
type RegisterMultiplicities = [<Precision4 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 Precision4
impl WordType<4> for Precision4
Source§type Words = [u32; 2]
type Words = [u32; 2]
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 = [<Precision4 as Precision>::NumberOfZeros; 16]
type RegisterMultiplicities = [<Precision4 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 Precision4
impl WordType<5> for Precision4
Source§type Words = [u32; 3]
type Words = [u32; 3]
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 = [<Precision4 as Precision>::NumberOfZeros; 32]
type RegisterMultiplicities = [<Precision4 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 Precision4
impl WordType<6> for Precision4
Source§type Words = [u32; 4]
type Words = [u32; 4]
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 = [<Precision4 as Precision>::NumberOfZeros; 62]
type RegisterMultiplicities = [<Precision4 as Precision>::NumberOfZeros; 62]
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; 62]
impl Copy for Precision4
impl Eq for Precision4
impl StructuralPartialEq for Precision4
Auto Trait Implementations§
impl Freeze for Precision4
impl RefUnwindSafe for Precision4
impl Send for Precision4
impl Sync for Precision4
impl Unpin for Precision4
impl UnwindSafe for Precision4
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