pub struct DmcModel { /* private fields */ }Expand description
DmcForest: multiple DMC instances with different clone thresholds. Each instance captures patterns at different granularities. Predictions are averaged in probability space.
Implementations§
Source§impl DmcModel
impl DmcModel
Sourcepub fn new_single() -> Self
pub fn new_single() -> Self
Create a DmcModel with a single instance (threshold=2, 4M states = ~64MB).
Sourcepub fn new_forest() -> Self
pub fn new_forest() -> Self
Create a DmcForest with 3 instances at different thresholds. Total memory: ~48MB (3 × 1M states) or ~96MB (3 × 2M states).
Sourcepub fn predict(&self) -> u32
pub fn predict(&self) -> u32
Predict probability of bit=1. Returns 12-bit probability [1, 4095]. Averages predictions from all instances.
Sourcepub fn on_byte_complete(&mut self, byte: u8)
pub fn on_byte_complete(&mut self, byte: u8)
Notify all instances that a full byte has been completed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DmcModel
impl RefUnwindSafe for DmcModel
impl Send for DmcModel
impl Sync for DmcModel
impl Unpin for DmcModel
impl UnsafeUnpin for DmcModel
impl UnwindSafe for DmcModel
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