[−][src]Struct compress::entropy::ari::bin::Model
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]
fn get_range(&self, value: bool) -> (Border, Border)
[src]
fn find_value(&self, offset: Border) -> (bool, Border, Border)
[src]
fn get_denominator(&self) -> Border
[src]
fn encode(&self, value: V, re: &mut RangeEncoder, out: &mut [Symbol]) -> usize
[src]
fn decode(&self, code: Border, re: &mut RangeEncoder) -> (V, usize)
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,