pub struct BitStreamTensor {
pub data: Vec<u64>,
pub length: usize,
}Expand description
Packed bitstream tensor with original bit length metadata.
Fields§
§data: Vec<u64>Packed words containing bitstream data.
length: usizeOriginal unpacked bit length.
Implementations§
Source§impl BitStreamTensor
impl BitStreamTensor
Sourcepub fn from_words(data: Vec<u64>, length: usize) -> Self
pub fn from_words(data: Vec<u64>, length: usize) -> Self
Create a tensor from pre-packed words.
Sourcepub fn xor_inplace(&mut self, other: &BitStreamTensor)
pub fn xor_inplace(&mut self, other: &BitStreamTensor)
HDC BIND: In-place XOR with another tensor.
Sourcepub fn xor(&self, other: &BitStreamTensor) -> BitStreamTensor
pub fn xor(&self, other: &BitStreamTensor) -> BitStreamTensor
HDC BIND: XOR returning a new tensor.
Sourcepub fn rotate_right(&mut self, shift: usize)
pub fn rotate_right(&mut self, shift: usize)
HDC PERMUTE: Cyclic right rotation by shift bits.
Rotates the entire logical bitstream, handling cross-word boundaries.
Sourcepub fn hamming_distance(&self, other: &BitStreamTensor) -> f32
pub fn hamming_distance(&self, other: &BitStreamTensor) -> f32
HDC SIMILARITY: Normalized Hamming distance (0.0 = identical, 1.0 = opposite).
Sourcepub fn bundle(vectors: &[&BitStreamTensor]) -> BitStreamTensor
pub fn bundle(vectors: &[&BitStreamTensor]) -> BitStreamTensor
HDC BUNDLE: Majority vote across N tensors.
Bit is 1 if a strict majority (> N/2) of inputs have it set. Optimized bitwise implementation using full adders.
Trait Implementations§
Source§impl Clone for BitStreamTensor
impl Clone for BitStreamTensor
Source§fn clone(&self) -> BitStreamTensor
fn clone(&self) -> BitStreamTensor
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 moreAuto Trait Implementations§
impl Freeze for BitStreamTensor
impl RefUnwindSafe for BitStreamTensor
impl Send for BitStreamTensor
impl Sync for BitStreamTensor
impl Unpin for BitStreamTensor
impl UnsafeUnpin for BitStreamTensor
impl UnwindSafe for BitStreamTensor
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