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

        let whole = (F::one() + F::one()) * (Self::Probability::one() << (PRECISION - 1)).into();
        F::from(PRECISION).unwrap() - entropy_scaled / whole
    }
/// Returns the entropy in units of bits (i.e., base 2).
///
/// The entropy is the theoretical lower bound on the *expected* bit rate in any
/// lossless entropy coder.
///
/// Note that calling this method on a [`LeakilyQuantizedDistribution`] will return the
/// entropy *after quantization*, not the differential entropy of the underlying
/// continuous probability distribution.
Returns the entropy in units of bits .
The entropy is the theoretical lower bound on the *expected* bit rate in any
lossless entropy coder.

Note that calling this method on a [`LeakilyQuantizedDistribution`] will return the
entropy *after quantization*, not the differential entropy of the underlying
continuous probability distribution.
Returns the entropy in units of bits . The entropy is the theoretical lower bound on the * expected * bit rate in any lossless entropy coder . Note that calling this method on a [ ` LeakilyQuantizedDistribution ` ] will return the entropy * after quantization * not the differential entropy of the underlying continuous probability distribution .
fn entropy_base2<F>(&'m self) -> F
    where
        F: Float + core::iter::Sum,
        Self::Probability: Into<F>,
    {
        let entropy_scaled = self
            .symbol_table()
            .into_iter()
            .map(|(_, _, probability)| {
                let probability = probability.get().into();
                probability * probability.log2() // probability is guaranteed to be nonzero.
            })
            .sum::<F>();
        let whole = (F::one() + F::one()) * (Self::Probability::one() << (PRECISION - 1)).into();
        F::from(PRECISION).unwrap() - entropy_scaled / whole
    }
fn entropy_base2 < F > ( & ' m self ) -> F where F : Float + core :: iter :: Sum , Self :: Probability : Into < F > , { let entropy_scaled = self . symbol_table ( ) . into_iter ( ) . map ( | ( _ , _ , probability ) | { let probability = probability . get ( ) . into ( ) ; probability * probability . log2 ( ) // probability is guaranteed to be nonzero. } ) . sum :: < F > ( ) ; let whole = ( F :: one ( ) + F :: one ( ) ) * ( Self :: 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 ) .
&'m self
&'m self