Module standard

Source
Expand description

General trait definitions and StandardHistogram implementation

Structs§

NullParams
These are empty parameters, standard histograms don’t need any extra information.
StandardHistogram
StandardHistogram is a naive implementation of a histogram with no optimizations. It has optimal performance since it stores an exact count for exact labels, but it can take an arbitrary amount of space. It uses a library HashMap to store label-frequency pairs, and can be instantiated with one using the create_standard_histogram function. StandardHistogram is associated with NullParams.

Traits§

Histogram
Specifies the behaviors that are necessary to be a histogram. It is generic and parameterized by P, the type of parameters necessary, L, the type of the labels, and F, the type that stores the frequency. Both the labels and the frequencies need to be some sort of number.
HistogramParams
For many of the histogram space optimizations, a set of parameters are needed to interpret the data in memory as a histogram. These parameters are often needed to create a more complex kind of histogram, and they always must be passed in the histogram’s labels and frequency functions.

Functions§

create_standard_histogram
Constructs a StandardHistogram from the given HashMap