Expand description
Space saving histogram implementations
Structs§
- C2Histogram
C2Histogram
is a combination ofCompressedHistogram
andCompactHistogram
, performing the memory saving operations from each of them. It is associated withC2Params
.- C2Params
C2Params
are a wrapper struct for a set ofCompactParams
andCompressedParams
.- Compact
Histogram CompactHistogram
is a fixed-size representation of a histogram. The set of possible labels are partitioned into logarithmically scaled ranges, then further subdivided into equally sized sub-ranges (equally sized within a given range). ACompactHistogram
stores a counter for each of the larger logarithmic ranges and which of the equally sized sub-ranges contains the frequency-weighted average of the labels. It is associated withCompactParams
.- Compact
Params CompactParams
contains 3 critical parameters determining how aCompactHistogram
is stored and interpreted. SeeCompactHistogram
for a full explanation.- Compressed
Histogram - Though not fixed,
CompressedHistogram
encodes histograms using less space than aStandardHistogram
. All of the frequencies for each label are approximated by a next greatest exponent.CompressedHistogram
uses a library HashMap to store the label-frequency pairs, so it is unbounded in terms of space. It is associated withCompressedParams
- Compressed
Params CompactParams
contains 2 parameters determining how aCompressedHistogram
is stored and interpreted. SeeCompressedHistogram
for a full explanation.
Functions§
- new_
c2_ params - Wraps
CompactParams
andCompressedParams
. - new_
compact_ params - ensures that the parameters are all valid and if so creates a new
CompactParams
struct - new_
compressed_ params - checks parameters for validity and if so creates a new
CompressedParams
struct