Struct pdatastructs::TopK [] [src]

pub struct TopK<T> where
    T: Clone + Eq + Hash + Ord
{ /* fields omitted */ }

Top-K implementation.

This data structure keeps the k most frequent data points of a stream.

Methods

impl<T> TopK<T> where
    T: Clone + Eq + Hash + Ord
[src]

[src]

Create new Top-K data structure.

  • k: number of elements to remember
  • cms: CountMinSketch that is used for guessing the frequency of elements not currently hold. Refer to its documentation about parameter selection.

Panics if k == 0.

[src]

Number of data points to remember.

[src]

Observe a data point.

[src]

Returns top-k values.

The result may contain less than k values if less than k unique data points where observed.

[src]

Check whether the sampler is empty (i.e. no data points observer so far)

[src]

Clear sampler, so that it behaves like it never observed any data points.

Trait Implementations

impl<T: Clone> Clone for TopK<T> where
    T: Clone + Eq + Hash + Ord
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Debug for TopK<T> where
    T: Clone + Eq + Hash + Ord
[src]

[src]

Formats the value using the given formatter.

impl<T> Extend<T> for TopK<T> where
    T: Clone + Eq + Hash + Ord
[src]

[src]

Extends a collection with the contents of an iterator. Read more