pub struct GF2Vector { /* private fields */ }Expand description
A vector in F₂ⁿ, stored as packed bits in u64 words.
Operations are word-parallel: XOR for addition, AND + popcount for dot product. Vectors of dimension ≤ 64 fit in a single word with no heap allocation overhead.
Implementations§
Source§impl GF2Vector
impl GF2Vector
Sourcepub fn hamming_distance(&self, other: &Self) -> usize
pub fn hamming_distance(&self, other: &Self) -> usize
Hamming distance to another vector.
Sourcepub fn bitwise_and(&self, other: &Self) -> Self
pub fn bitwise_and(&self, other: &Self) -> Self
Component-wise AND.
Trait Implementations§
impl Eq for GF2Vector
impl StructuralPartialEq for GF2Vector
Auto Trait Implementations§
impl Freeze for GF2Vector
impl RefUnwindSafe for GF2Vector
impl Send for GF2Vector
impl Sync for GF2Vector
impl Unpin for GF2Vector
impl UnsafeUnpin for GF2Vector
impl UnwindSafe for GF2Vector
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