pub struct BitVecN { /* private fields */ }Expand description
A variable-length bitvector with dynamic bit width.
Unlike BitVec2048 which is fixed at 2048 bits, BitVecN allows
arbitrary bit widths (512, 1024, 2048, 4096, etc.).
Implementations§
Source§impl BitVecN
impl BitVecN
Sourcepub fn tanimoto(&self, other: &Self) -> f64
pub fn tanimoto(&self, other: &Self) -> f64
Tanimoto similarity with another BitVecN.
Both vectors must have the same bit width.
§Panics
Panics if the two vectors have different bit widths.
Sourcepub fn from_bitvec2048(bv: &BitVec2048) -> Self
pub fn from_bitvec2048(bv: &BitVec2048) -> Self
Convert from a BitVec2048 (truncates to same 2048 bits).
Sourcepub fn to_bitvec2048(&self) -> Option<BitVec2048>
pub fn to_bitvec2048(&self) -> Option<BitVec2048>
Convert to a BitVec2048 if the bit width is exactly 2048.
Returns None if the bit width is not 2048.
Trait Implementations§
impl Eq for BitVecN
impl StructuralPartialEq for BitVecN
Auto Trait Implementations§
impl Freeze for BitVecN
impl RefUnwindSafe for BitVecN
impl Send for BitVecN
impl Sync for BitVecN
impl Unpin for BitVecN
impl UnsafeUnpin for BitVecN
impl UnwindSafe for BitVecN
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