pub struct BitVec2048 { /* private fields */ }Expand description
A 2048-bit bitvector.
The vector is stored as 32 little-endian 64-bit words.
Bit n resides in word n / 64, at position n % 64.
Implementations§
Source§impl BitVec2048
impl BitVec2048
Sourcepub fn tanimoto(&self, other: &Self) -> f64
pub fn tanimoto(&self, other: &Self) -> f64
Tanimoto similarity: |A & B| / |A | B|.
Returns 1.0 when both vectors are all-zero (the empty-set convention).
Sourcepub fn dice(&self, other: &Self) -> f64
pub fn dice(&self, other: &Self) -> f64
Dice similarity: 2|A & B| / (|A| + |B|).
Returns 1.0 when both vectors are all-zero.
Sourcepub fn fold(&self, bits: usize) -> Self
pub fn fold(&self, bits: usize) -> Self
XOR-fold this 2048-bit vector to bits bits.
The upper half is XOR-folded into the lower half, and the upper half is zeroed. This is applied recursively until the target width is reached.
bits must be 1024, 512, or 256.
§Panics
Panics if bits is not one of 1024, 512, or 256.
Trait Implementations§
Source§impl Clone for BitVec2048
impl Clone for BitVec2048
Source§fn clone(&self) -> BitVec2048
fn clone(&self) -> BitVec2048
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 BitVec2048
impl Debug for BitVec2048
Source§impl Default for BitVec2048
impl Default for BitVec2048
Source§impl PartialEq for BitVec2048
impl PartialEq for BitVec2048
Source§fn eq(&self, other: &BitVec2048) -> bool
fn eq(&self, other: &BitVec2048) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for BitVec2048
impl StructuralPartialEq for BitVec2048
Auto Trait Implementations§
impl Freeze for BitVec2048
impl RefUnwindSafe for BitVec2048
impl Send for BitVec2048
impl Sync for BitVec2048
impl Unpin for BitVec2048
impl UnsafeUnpin for BitVec2048
impl UnwindSafe for BitVec2048
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