Struct C2Histogram

Source
pub struct C2Histogram { /* private fields */ }
Expand description

C2Histogram is a combination of CompressedHistogram and CompactHistogram, performing the memory saving operations from each of them. It is associated with C2Params.

Each c2 histogram can be stored in n * (c + log2(k)) + c bits, where c = log2(max_exp)

A C2Histogram must be derrived from a StandardHistogram using the to_c2 function.

Trait Implementations§

Source§

impl Histogram<C2Params, usize, usize> for C2Histogram

Source§

fn labels(&self, params: &C2Params) -> Option<Box<dyn Iterator<Item = usize>>>

If possible, creates and returns an iterator for the labels for which the histogram has frequencies stored.
Source§

fn frequency(&self, label: usize, params: &C2Params) -> Option<usize>

If possible, returns the frequency of a particular label. The behavior need only be defined if the label is in the set of values returned from labels.
Source§

fn total(&self) -> usize

the total number of data-points in the histogram

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.