Struct constriction::stream::model::UniformModel
source · pub struct UniformModel<Probability: BitArray, const PRECISION: usize> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl<Probability: Clone + BitArray, const PRECISION: usize> Clone for UniformModel<Probability, PRECISION>
impl<Probability: Clone + BitArray, const PRECISION: usize> Clone for UniformModel<Probability, PRECISION>
source§fn clone(&self) -> UniformModel<Probability, PRECISION>
fn clone(&self) -> UniformModel<Probability, PRECISION>
Returns a copy 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<Probability: Debug + BitArray, const PRECISION: usize> Debug for UniformModel<Probability, PRECISION>
impl<Probability: Debug + BitArray, const PRECISION: usize> Debug for UniformModel<Probability, PRECISION>
source§impl<Probability, const PRECISION: usize> DecoderModel<PRECISION> for UniformModel<Probability, PRECISION>
impl<Probability, const PRECISION: usize> DecoderModel<PRECISION> for UniformModel<Probability, PRECISION>
source§fn quantile_function(
&self,
quantile: Self::Probability,
) -> (Self::Symbol, Self::Probability, <Self::Probability as BitArray>::NonZero)
fn quantile_function( &self, quantile: Self::Probability, ) -> (Self::Symbol, Self::Probability, <Self::Probability as BitArray>::NonZero)
Looks up the symbol for a given quantile. Read more
source§impl<Probability: BitArray, const PRECISION: usize> EncoderModel<PRECISION> for UniformModel<Probability, PRECISION>where
usize: AsPrimitive<Probability>,
impl<Probability: BitArray, const PRECISION: usize> EncoderModel<PRECISION> for UniformModel<Probability, PRECISION>where
usize: AsPrimitive<Probability>,
source§fn left_cumulative_and_probability(
&self,
symbol: impl Borrow<Self::Symbol>,
) -> Option<(Self::Probability, <Self::Probability as BitArray>::NonZero)>
fn left_cumulative_and_probability( &self, symbol: impl Borrow<Self::Symbol>, ) -> Option<(Self::Probability, <Self::Probability as BitArray>::NonZero)>
Looks up a symbol in the entropy model. Read more
source§fn floating_point_probability<F>(&self, symbol: Self::Symbol) -> F
fn floating_point_probability<F>(&self, symbol: Self::Symbol) -> F
Returns the probability of the given symbol in floating point representation. Read more
source§impl<Probability: BitArray, const PRECISION: usize> EntropyModel<PRECISION> for UniformModel<Probability, PRECISION>
impl<Probability: BitArray, const PRECISION: usize> EntropyModel<PRECISION> for UniformModel<Probability, PRECISION>
source§impl<'m, Probability, const PRECISION: usize> IterableEntropyModel<'m, PRECISION> for UniformModel<Probability, PRECISION>
impl<'m, Probability, const PRECISION: usize> IterableEntropyModel<'m, PRECISION> for UniformModel<Probability, PRECISION>
source§fn symbol_table(
&'m self,
) -> impl Iterator<Item = (Self::Symbol, Self::Probability, <Self::Probability as BitArray>::NonZero)>
fn symbol_table( &'m self, ) -> impl Iterator<Item = (Self::Symbol, Self::Probability, <Self::Probability as BitArray>::NonZero)>
Iterates over all symbols in the unique order that is consistent with the cumulative
distribution. Read more
source§fn floating_point_symbol_table<F>(
&'m self,
) -> impl Iterator<Item = (Self::Symbol, F, F)>
fn floating_point_symbol_table<F>( &'m self, ) -> impl Iterator<Item = (Self::Symbol, F, F)>
Similar to
symbol_table
, but yields both cumulatives and probabilities in
floating point representation. Read moresource§fn entropy_base2<F>(&'m self) -> F
fn entropy_base2<F>(&'m self) -> F
Returns the entropy in units of bits (i.e., base 2). Read more
source§fn cross_entropy_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
fn cross_entropy_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
Returns the cross entropy between argument
p
and this model in units of bits
(i.e., base 2). Read moresource§fn reverse_cross_entropy_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
fn reverse_cross_entropy_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
Returns the cross entropy between this model and argument
p
in units of bits
(i.e., base 2). Read moresource§fn kl_divergence_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
fn kl_divergence_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
Returns Kullback-Leibler divergence
D_KL(p || self)
Read moresource§fn reverse_kl_divergence_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
fn reverse_kl_divergence_base2<F>(&'m self, p: impl IntoIterator<Item = F>) -> F
Returns reverse Kullback-Leibler divergence, i.e.,
D_KL(self || p)
Read moreimpl<Probability: Copy + BitArray, const PRECISION: usize> Copy for UniformModel<Probability, PRECISION>
Auto Trait Implementations§
impl<Probability, const PRECISION: usize> Freeze for UniformModel<Probability, PRECISION>
impl<Probability, const PRECISION: usize> RefUnwindSafe for UniformModel<Probability, PRECISION>
impl<Probability, const PRECISION: usize> Send for UniformModel<Probability, PRECISION>
impl<Probability, const PRECISION: usize> Sync for UniformModel<Probability, PRECISION>
impl<Probability, const PRECISION: usize> Unpin for UniformModel<Probability, PRECISION>
impl<Probability, const PRECISION: usize> UnwindSafe for UniformModel<Probability, PRECISION>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)