[][src]Struct compress::entropy::ari::bin::Model

pub struct Model {
    pub rate: Border,
    // some fields omitted
}

A binary value frequency model

Fields

rate: Border

learning rate

Implementations

impl Model[src]

pub fn new_flat(threshold: Border, rate: Border) -> Model[src]

Create a new flat (50/50 probability) instance

pub fn new_custom(zero_percent: u8, threshold: Border, rate: Border) -> Model[src]

Create a new instance with a given percentage for zeroes

pub fn reset_flat(&mut self)[src]

Reset the model to 50/50 distribution

pub fn get_probability_zero(&self) -> Border[src]

Return the probability of 0

pub fn get_probability_one(&self) -> Border[src]

Return the probability of 1

pub fn update_zero(&mut self)[src]

Update the frequency of zero

pub fn update_one(&mut self)[src]

Update the frequency of one

pub fn update(&mut self, value: bool)[src]

Update frequencies in favor of given 'value' Lower factors produce more aggressive updates

Trait Implementations

impl Model<bool> for Model[src]

Auto Trait Implementations

impl RefUnwindSafe for Model

impl Send for Model

impl Sync for Model

impl Unpin for Model

impl UnwindSafe for Model

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]