pub struct AdaptiveTreeModel { /* private fields */ }
Expand description
Adaptive model that uses a Binary Indexed Tree for storing cumulative frequencies.
Implementations§
Source§impl AdaptiveTreeModel
impl AdaptiveTreeModel
Sourcepub fn new(p: Parameters) -> Box<dyn Model>
pub fn new(p: Parameters) -> Box<dyn Model>
Initializes the model with the given parameters.
Trait Implementations§
Source§impl Model for AdaptiveTreeModel
impl Model for AdaptiveTreeModel
Source§fn parameters<'a>(&'a self) -> &'a Parameters
fn parameters<'a>(&'a self) -> &'a Parameters
Returns the arithmetic compression parameters.
Source§fn total_frequency(&self) -> u64
fn total_frequency(&self) -> u64
Returns the maximum cumulative frequency.
Source§fn get_frequency(&mut self, symbol: usize) -> Result<(u64, u64)>
fn get_frequency(&mut self, symbol: usize) -> Result<(u64, u64)>
Returns the cumulative frequency range for the given input symbol.
Auto Trait Implementations§
impl Freeze for AdaptiveTreeModel
impl RefUnwindSafe for AdaptiveTreeModel
impl Send for AdaptiveTreeModel
impl Sync for AdaptiveTreeModel
impl Unpin for AdaptiveTreeModel
impl UnwindSafe for AdaptiveTreeModel
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