pub struct RabitqCode {
pub bits: Vec<u8>,
pub norm: f32,
pub dot_corr: f32,
}Expand description
A single encoded vector: 1-bit sign code plus correction scalars.
Fields§
§bits: Vec<u8>Sign bits of the rotated centered vector (padded_dim bits,
dimension d maps to bit d % 8 of byte d / 8).
norm: f32Residual norm ||v - centroid||.
dot_corr: f32Dot correction <o_unit, s_unit> where o_unit is the unit
rotated residual and s_unit = signs / sqrt(padded_dim).
Implementations§
Source§impl RabitqCode
impl RabitqCode
Sourcepub fn stored_bytes(&self) -> usize
pub fn stored_bytes(&self) -> usize
Total stored bytes for this code (bits + correction scalars).
Trait Implementations§
Source§impl Clone for RabitqCode
impl Clone for RabitqCode
Source§fn clone(&self) -> RabitqCode
fn clone(&self) -> RabitqCode
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 RabitqCode
impl Debug for RabitqCode
Source§impl PartialEq for RabitqCode
impl PartialEq for RabitqCode
Source§fn eq(&self, other: &RabitqCode) -> bool
fn eq(&self, other: &RabitqCode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RabitqCode
Auto Trait Implementations§
impl Freeze for RabitqCode
impl RefUnwindSafe for RabitqCode
impl Send for RabitqCode
impl Sync for RabitqCode
impl Unpin for RabitqCode
impl UnsafeUnpin for RabitqCode
impl UnwindSafe for RabitqCode
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