pub fn entropy_base2<F>(&self) -> F
    where
        F: Float + core::iter::Sum,
        Probability: Into<F>,
    {
        let entropy_scaled = self
            .table
            .values()
            .map(|&(_, probability)| {
                let probability = probability.get().into();
                probability * probability.log2() // probability is guaranteed to be nonzero.
            })
            .sum::<F>();

        let whole = (F::one() + F::one()) * (Probability::one() << (PRECISION - 1)).into();
        F::from(PRECISION).unwrap() - entropy_scaled / whole
    }
/// Returns the entropy in units of bits (i.e., base 2).
///
/// Similar to [`IterableEntropyModel::entropy_base2`], except that
/// - this type doesn't implement `IterableEntropyModel` because it doesn't store
///   entries in a stable expected order;
/// - because the order in which entries are stored will generally be different on each
///   program execution, rounding errors will be slightly different across multiple
///   program executions.
Returns the entropy in units of bits .
Similar to [`IterableEntropyModel::entropy_base2`], except that
this type doesn't implement `IterableEntropyModel` because it doesn't store
entries in a stable expected order;
because the order in which entries are stored will generally be different on each
program execution, rounding errors will be slightly different across multiple
program executions.
Returns the entropy in units of bits . Similar to [ ` IterableEntropyModel :: entropy_base2 ` ] except that this type doesn ' t implement ` IterableEntropyModel ` because it doesn ' t store entries in a stable expected order ; because the order in which entries are stored will generally be different on each program execution rounding errors will be slightly different across multiple program executions .
pub fn entropy_base2<F>(&self) -> F
    where
        F: Float + core::iter::Sum,
        Probability: Into<F>,
    {
        let entropy_scaled = self
            .table
            .values()
            .map(|&(_, probability)| {
                let probability = probability.get().into();
                probability * probability.log2() // probability is guaranteed to be nonzero.
            })
            .sum::<F>();
        let whole = (F::one() + F::one()) * (Probability::one() << (PRECISION - 1)).into();
        F::from(PRECISION).unwrap() - entropy_scaled / whole
    }
pub fn entropy_base2 < F > ( & self ) -> F where F : Float + core :: iter :: Sum , Probability : Into < F > , { let entropy_scaled = self . table . values ( ) . map ( | & ( _ , probability ) | { let probability = probability . get ( ) . into ( ) ; probability * probability . log2 ( ) // probability is guaranteed to be nonzero. } ) . sum :: < F > ( ) ; let whole = ( F :: one ( ) + F :: one ( ) ) * ( Probability :: one ( ) << ( PRECISION - 1 ) ) . into ( ) ; F :: from ( PRECISION ) . unwrap ( ) - entropy_scaled / whole }
Returns the entropy in units of bits (i.e., base 2).
Returns the entropy in units of bits ( i . e . base 2 ) .
&self
&self