pub struct BundleAccumulator { /* private fields */ }Expand description
Incremental bundle accumulator for streaming/sliding-window memory.
Maintains signed bit counts for efficient add/remove operations. Finalize applies majority threshold to produce a bundled hypervector.
Implementations§
Source§impl BundleAccumulator
impl BundleAccumulator
Sourcepub fn remove(&mut self, hv: &HVec10240)
pub fn remove(&mut self, hv: &HVec10240)
Remove a hypervector from the accumulator.
Saturates at zero: removing from an empty accumulator is a no-op.
Use Self::try_remove if you need to detect underflow.
Sourcepub fn try_remove(&mut self, hv: &HVec10240) -> Result<()>
pub fn try_remove(&mut self, hv: &HVec10240) -> Result<()>
Remove a hypervector from the accumulator, returning an error if empty.
Returns Err(MemoryError::InvalidInput) when the accumulator is empty.
Trait Implementations§
Source§impl Clone for BundleAccumulator
impl Clone for BundleAccumulator
Source§fn clone(&self) -> BundleAccumulator
fn clone(&self) -> BundleAccumulator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BundleAccumulator
impl Debug for BundleAccumulator
Auto Trait Implementations§
impl Freeze for BundleAccumulator
impl RefUnwindSafe for BundleAccumulator
impl Send for BundleAccumulator
impl Sync for BundleAccumulator
impl Unpin for BundleAccumulator
impl UnsafeUnpin for BundleAccumulator
impl UnwindSafe for BundleAccumulator
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