pub struct PpmModel { /* private fields */ }Expand description
PPM model with checksum-validated hash tables at orders 0-12.
Memory budget depends on config:
- Default: ~90MB total
- Scaled 4x: ~360MB total
- Order 0: 1 entry (global unigram)
- Order 1: 256 entries
- Order 2: 64K entries
- Orders 3+: configurable
Implementations§
Source§impl PpmModel
impl PpmModel
Sourcepub fn with_config(config: PpmConfig) -> Self
pub fn with_config(config: PpmConfig) -> Self
Create a PPM model with the given configuration.
Sourcepub fn predict_bit(&mut self, bpos: u8, c0: u32) -> u32
pub fn predict_bit(&mut self, bpos: u8, c0: u32) -> u32
Predict bit probability. Returns 12-bit probability [1, 4095].
Sourcepub fn update_byte(&mut self, byte: u8)
pub fn update_byte(&mut self, byte: u8)
Update PPM model after a full byte has been decoded.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PpmModel
impl RefUnwindSafe for PpmModel
impl Send for PpmModel
impl Sync for PpmModel
impl Unpin for PpmModel
impl UnsafeUnpin for PpmModel
impl UnwindSafe for PpmModel
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more