Struct hyperminhash::Sketch
source · pub struct Sketch { /* private fields */ }
Expand description
Records the approximate number of unique elements it has seen over it’s lifetime.
Implementations§
source§impl Sketch
impl Sketch
sourcepub fn add(&mut self, v: impl Hash)
pub fn add(&mut self, v: impl Hash)
Add an element to this set, using the element’s Hash-implementation
sourcepub fn cardinality(&self) -> f64
pub fn cardinality(&self) -> f64
The approximate number of unique elements in the set.
sourcepub fn union<'a>(&'a mut self, other: &Self) -> &'a Self
pub fn union<'a>(&'a mut self, other: &Self) -> &'a Self
Merge two sets, resulting in this set becoming the union-set.
sourcepub fn similarity(&self, other: &Self) -> f64
pub fn similarity(&self, other: &Self) -> f64
The Jaccard Index similarity estimation
sourcepub fn intersection(&self, other: &Self) -> f64
pub fn intersection(&self, other: &Self) -> f64
The approximate number of elements in both sets
Trait Implementations§
source§impl<T: Hash> FromIterator<T> for Sketch
impl<T: Hash> FromIterator<T> for Sketch
source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
source§impl PartialEq for Sketch
impl PartialEq for Sketch
impl Eq for Sketch
impl StructuralPartialEq for Sketch
Auto Trait Implementations§
impl RefUnwindSafe for Sketch
impl Send for Sketch
impl Sync for Sketch
impl Unpin for Sketch
impl UnwindSafe for Sketch
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