Struct pdatastructs::CountMinSketch [] [src]

pub struct CountMinSketch<C = usize> where
    C: Counter
{ /* fields omitted */ }

Simple implementation of a Count-min sketch

The type parameter C sets the type of the counter in the internal table and can be used to reduce memory consumption when low counts are expected.

Methods

impl<C> CountMinSketch<C> where
    C: Counter
[src]

[src]

Create new CountMinSketch based on table size.

  • w sets the number of columns
  • d sets the number of rows

[src]

Create new CountMinSketch with the following properties for a point query:

  • a is the real count of observed objects
  • a' is the guessed count of observed objects
  • N is the total count in the internal table
  • a <= a' always holds
  • a' <= a + epsilon * N holds with p > 1 - delta

The following conditions must hold:

  • epsilon > 0
  • delta > 0 and delta < 1

Panics when the input conditions do not hold.

[src]

Get number of columns of internal counter table.

[src]

Get number of rows of internal counter table.

[src]

Check whether the CountMinSketch is empty (i.e. no elements seen yet).

[src]

Add one to the counter of the given element.

[src]

Add n to the counter of the given element.

[src]

Runs a point query, i.e. a query for the count of a single object.

[src]

Merge self with another CountMinSketch.

After this operation self will be in the same state as when it would have seen all elements from self and other.

Panics when d and w from self and other differ.

[src]

Clear internal counters to a fresh state (i.e. no objects seen).

Trait Implementations

impl<C: Clone> Clone for CountMinSketch<C> where
    C: Counter
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for CountMinSketch
[src]

[src]

Formats the value using the given formatter.