pub struct BitPackedPath {
pub path_bits: u128,
pub path_length: u8,
pub prediction: f32,
}Expand description
Bit-packed decision path for ultra-compact storage
Fields§
§path_bits: u128Packed decision bits (left = 0, right = 1)
path_length: u8Number of decisions in the path
prediction: f32Final prediction value
Implementations§
Source§impl BitPackedPath
impl BitPackedPath
Sourcepub fn add_decision(&mut self, go_right: bool) -> Result<()>
pub fn add_decision(&mut self, go_right: bool) -> Result<()>
Add a decision to the path (false = left, true = right)
Sourcepub fn get_decision(&self, position: u8) -> bool
pub fn get_decision(&self, position: u8) -> bool
Get decision at position (false = left, true = right)
Sourcepub fn set_prediction(&mut self, prediction: f64)
pub fn set_prediction(&mut self, prediction: f64)
Set final prediction
Sourcepub fn get_prediction(&self) -> f64
pub fn get_prediction(&self) -> f64
Get final prediction
Trait Implementations§
Source§impl Clone for BitPackedPath
impl Clone for BitPackedPath
Source§fn clone(&self) -> BitPackedPath
fn clone(&self) -> BitPackedPath
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BitPackedPath
impl Debug for BitPackedPath
Auto Trait Implementations§
impl Freeze for BitPackedPath
impl RefUnwindSafe for BitPackedPath
impl Send for BitPackedPath
impl Sync for BitPackedPath
impl Unpin for BitPackedPath
impl UnwindSafe for BitPackedPath
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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