Struct average::Histogram10[][src]

pub struct Histogram10 { /* fields omitted */ }

A histogram with a number of bins known at compile time.

Implementations

impl Histogram[src]

pub fn with_const_width(start: f64, end: f64) -> Self[src]

Construct a histogram with constant bin width.

pub fn from_ranges<T>(ranges: T) -> Result<Self, InvalidRangeError> where
    T: IntoIterator<Item = f64>, 
[src]

Construct a histogram from given ranges.

The ranges are given by an iterator of floats where neighboring pairs (a, b) define a bin for all x where a <= x < b.

Fails if the iterator is too short (less than n + 1 where n is the number of bins), is not sorted or contains nan. inf and empty ranges are allowed.

pub fn find(&self, x: f64) -> Result<usize, SampleOutOfRangeError>[src]

Find the index of the bin corresponding to the given sample.

Fails if the sample is out of range of the histogram.

pub fn add(&mut self, x: f64) -> Result<(), SampleOutOfRangeError>[src]

Add a sample to the histogram.

Fails if the sample is out of range of the histogram.

pub fn ranges(&self) -> &[f64][src]

Return the ranges of the histogram.

pub fn iter(&self) -> IterHistogram<'_>[src]

Return an iterator over the bins and corresponding ranges: ((lower, upper), count)

pub fn reset(&mut self)[src]

Reset all bins to zero.

pub fn range_min(&self) -> f64[src]

Return the lower range limit.

(The corresponding bin might be empty.)

pub fn range_max(&self) -> f64[src]

Return the upper range limit.

(The corresponding bin might be empty.)

Trait Implementations

impl<'a> AddAssign<&'a Histogram> for Histogram[src]

impl Clone for Histogram[src]

impl Debug for Histogram[src]

impl<'de> Deserialize<'de> for Histogram[src]

impl Histogram for Histogram[src]

impl<'a> IntoIterator for &'a Histogram[src]

type Item = ((f64, f64), u64)

The type of the elements being iterated over.

type IntoIter = IterHistogram<'a>

Which kind of iterator are we turning this into?

impl Merge for Histogram[src]

impl MulAssign<u64> for Histogram[src]

impl Serialize for Histogram[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<S, T> Cast<T> for S where
    T: Conv<S>, 
[src]

impl<S, T> CastFloat<T> for S where
    T: ConvFloat<S>, 
[src]

impl<T> Conv<T> for T[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.