pub struct UniformModel<Probability: BitArray, const PRECISION: usize> { /* private fields */ }

Implementations§

source§

impl<Probability: BitArray, const PRECISION: usize> UniformModel<Probability, PRECISION>

source

pub fn new(range: Probability) -> Self

Trait Implementations§

source§

impl<Probability: Clone + BitArray, const PRECISION: usize> Clone for UniformModel<Probability, PRECISION>
where Probability::NonZero: Clone,

source§

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)

Performs copy-assignment from source. Read more
source§

impl<Probability: Debug + BitArray, const PRECISION: usize> Debug for UniformModel<Probability, PRECISION>
where Probability::NonZero: Debug,

source§

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

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

impl<Probability: BitArray, 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)

Looks up the symbol for a given quantile. Read more
source§

impl<Probability: BitArray, const PRECISION: usize> EncoderModel<PRECISION> for UniformModel<Probability, PRECISION>

source§

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
where F: FloatCore, Self::Probability: Into<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>

§

type Symbol = Probability

The type of data over which the entropy model is defined. Read more
§

type Probability = Probability

The type used to represent probabilities, cumulatives, and quantiles. Read more
source§

impl<'m, Probability, const PRECISION: usize> IterableEntropyModel<'m, PRECISION> for UniformModel<Probability, PRECISION>
where Probability: AsPrimitive<usize> + BitArray,

§

type Iter = UniformModelIter<'m, Probability, PRECISION>

The type of the iterator returned by symbol_table. Read more
source§

fn symbol_table(&'m self) -> Self::Iter

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 ) -> FloatingPointSymbolTable<F, Self::Iter, PRECISION>
where F: From<Self::Probability>,

Similar to symbol_table, but yields both cumulatives and probabilities in floating point representation. Read more
source§

fn entropy_base2<F>(&'m self) -> F
where F: Float + Sum, Self::Probability: Into<F>,

Returns the entropy in units of bits (i.e., base 2). Read more
source§

impl<Probability: Copy + BitArray, const PRECISION: usize> Copy for UniformModel<Probability, PRECISION>
where Probability::NonZero: Copy,

Auto Trait Implementations§

§

impl<Probability, const PRECISION: usize> RefUnwindSafe for UniformModel<Probability, PRECISION>
where Probability: RefUnwindSafe, <Probability as BitArray>::NonZero: RefUnwindSafe,

§

impl<Probability, const PRECISION: usize> Send for UniformModel<Probability, PRECISION>
where Probability: Send, <Probability as BitArray>::NonZero: Send,

§

impl<Probability, const PRECISION: usize> Sync for UniformModel<Probability, PRECISION>
where Probability: Sync, <Probability as BitArray>::NonZero: Sync,

§

impl<Probability, const PRECISION: usize> Unpin for UniformModel<Probability, PRECISION>
where Probability: Unpin, <Probability as BitArray>::NonZero: Unpin,

§

impl<Probability, const PRECISION: usize> UnwindSafe for UniformModel<Probability, PRECISION>
where Probability: UnwindSafe, <Probability as BitArray>::NonZero: UnwindSafe,

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> 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.