Struct basichll::HLL [] [src]

pub struct HLL { /* fields omitted */ }

The HLL struct stores the underlying registers of the HyperLogLog, with m many registers.

The value for m is derived from the desired error of the estimation. The error is considered to be 1.04 / sqrt(2 ^ bits). So, given a desired 1% error rate, we result in around 12 bits per register, producing an underlying M of 212 bits (i.e. 4kb).

Methods

impl HLL
[src]

Convenience function to produce a HLL with one hundred and twenty eight registers.

Create a new HLL with the desired standard error. Some examples might be:

bits    size    error
     12      4096    0.0163
     13      8192    0.0115
     14      16384   0.0081

The error must be between 0.0 and 1.0. Beware using a stupidly small error size will grow beyond e.g. isize at less than 0.03 (if you need something that isn't an estimate probably don't use a hyperloglog).

Add an element into the hyperloglog estimate. We require the type of value to be able to be hashed. Returns whether the insertion altered the hyperloglog

Return the estimated cardinality of the observed set of elements.

Access a copy of the underlying registers (this is mainly here just for debugging/testing... its unlikely you'll need this access typically).

A completely zeroed HLL. Not particularly useful except as an identity element in Add.

Trait Implementations

impl Clone for HLL
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for HLL
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for HLL
[src]

impl Display for HLL
[src]

Formats the value using the given formatter. Read more

impl Debug for HLL
[src]

Formats the value using the given formatter.

impl<'a> Add<&'a HLL> for &'a HLL
[src]

Adding together two HLLs produces a new HLL where the larger value of each register has been selected.

The resulting type after applying the + operator

The method for the + operator