Struct pdatastructs::HyperLogLog
[−]
[src]
pub struct HyperLogLog { /* fields omitted */ }
A simple implementation of a HyperLogLog
Methods
impl HyperLogLog
[src]
fn new(b: usize) -> HyperLogLog
[src]
Creates a new, empty HyperLogLog.
b
number of bits used for register selection, number of registers within the HyperLogLog will be2^b
.b
must be in[4, 16]
Panics when b
is out of bounds.
fn b(&self) -> usize
[src]
Get number of bits used for register selection.
fn m(&self) -> usize
[src]
Get number of registers.
fn add<T>(&mut self, obj: &T) where
T: Hash,
[src]
T: Hash,
Adds an element to the HyperLogLog.
fn count(&self) -> usize
[src]
Guess the number of unique elements seen by the HyperLogLog.
fn merge(&mut self, other: &HyperLogLog)
[src]
Merge w/ another HyperLogLog.
This HyperLogLog will then have the same state as if all elements seen by other
where
directly added to self
.
Panics when b
parameter of self
and other
do not match.
fn clear(&mut self)
[src]
Empties the HyperLogLog.
fn is_empty(&self) -> bool
[src]
Checks whether the HyperLogLog has never seen an element.
Trait Implementations
impl Clone for HyperLogLog
[src]
fn clone(&self) -> HyperLogLog
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more