[−][src]Struct c2_histograms::c2::CompactHistogram
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).
A CompactHistogram
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 with CompactParams
.
There are 3 parameters that govern this process:
- n -> the number of logarithmically sized ranges to represent
- k -> the number of equally sized sub-ranges that each larger range is divided into
- b -> a floating point number that determines the size of each of the logarithmically scaled buckets. The ranges are [1..b], [b+1..b^2], ..., [b^(n)+1,b^(n+1)].
Each compact histogram can be stored in n * (c + log_2(k)) + c bits, where c is the number of bits dedicated to a counter. Note that this value is independent of b.
This histogram also keeps track of how many labels "overflow", i.e. are too large to fit into any of the ranges. The labels themselves are lost, but the frequencies are recorded and included in total.
A CompactHistogram
must be derived from a StandardHistogram
using the to_compact
function.
Trait Implementations
impl Histogram<CompactParams, usize, usize> for CompactHistogram
[src]
Auto Trait Implementations
impl RefUnwindSafe for CompactHistogram
impl Send for CompactHistogram
impl Sync for CompactHistogram
impl Unpin for CompactHistogram
impl UnwindSafe for CompactHistogram
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,