Struct Precision10

Source
pub struct Precision10;

Trait Implementations§

Source§

impl Clone for Precision10

Source§

fn clone(&self) -> Precision10

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Precision10

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Precision10

Source§

fn default() -> Precision10

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Precision10

Source§

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 Precision10

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Precision10

Source§

fn eq(&self, other: &Precision10) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Precision for Precision10

Source§

const EXPONENT: usize = 10usize

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

The precomputed small corrections used in the HyperLogLog algorithm for better performance.
Source§

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; 1024]

Type for small corrections:
Source§

type Registers = [u32; 1024]

Source§

const NUMBER_OF_REGISTERS: usize = _

The number of registers that will be used.
Source§

impl Serialize for Precision10

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl WordType<1> for Precision10

Source§

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 = [<Precision10 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.
Source§

type FloatMultiplicities = [f32; 2]

Source§

impl WordType<2> for Precision10

Source§

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 = [<Precision10 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.
Source§

type FloatMultiplicities = [f32; 4]

Source§

impl WordType<3> for Precision10

Source§

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 = [<Precision10 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.
Source§

type FloatMultiplicities = [f32; 8]

Source§

impl WordType<4> for Precision10

Source§

type Words = [u32; 128]

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 = [<Precision10 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.
Source§

type FloatMultiplicities = [f32; 16]

Source§

impl WordType<5> for Precision10

Source§

type Words = [u32; 171]

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 = [<Precision10 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.
Source§

type FloatMultiplicities = [f32; 32]

Source§

impl WordType<6> for Precision10

Source§

type Words = [u32; 205]

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 = [<Precision10 as Precision>::NumberOfZeros; 56]

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.
Source§

type FloatMultiplicities = [f32; 56]

Source§

impl Copy for Precision10

Source§

impl Eq for Precision10

Source§

impl StructuralPartialEq for Precision10

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,