Struct average::Histogram10[][src]

pub struct Histogram10 { /* fields omitted */ }
Expand description

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]

fn add_assign(&mut self, other: &Self)[src]

Performs the += operation. Read more

impl Clone for Histogram[src]

fn clone(&self) -> Histogram[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Histogram[src]

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Histogram for Histogram[src]

fn bins(&self) -> &[u64][src]

Return the bins of the histogram.

fn variance(&self, bin: usize) -> f64[src]

Estimate the variance for the given bin. Read more

fn normalized_bins(&self) -> IterNormalized<<&Self as IntoIterator>::IntoIter>[src]

Return an iterator over the bins normalized by the bin widths.

fn widths(&self) -> IterWidths<<&Self as IntoIterator>::IntoIter>[src]

Return an iterator over the bin widths.

fn centers(&self) -> IterBinCenters<<&Self as IntoIterator>::IntoIter>[src]

Return an iterator over the bin centers.

fn variances(&self) -> IterVariances<<&Self as IntoIterator>::IntoIter>[src]

Return an iterator over the bin variances. Read more

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?

fn into_iter(self) -> IterHistogram<'a>[src]

Creates an iterator from a value. Read more

impl Merge for Histogram[src]

fn merge(&mut self, other: &Self)[src]

Merge the other estimator into this one. Read more

impl MulAssign<u64> for Histogram[src]

fn mul_assign(&mut self, other: u64)[src]

Performs the *= operation. Read more

impl Serialize for Histogram[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn cast(self) -> T[src]

Cast from Self to T

pub fn try_cast(self) -> Result<T, Error>[src]

Try converting from Self to T

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

pub fn cast_trunc(self) -> T[src]

Cast to integer, truncating Read more

pub fn cast_nearest(self) -> T[src]

Cast to the nearest integer Read more

pub fn cast_floor(self) -> T[src]

Cast the floor to an integer Read more

pub fn cast_ceil(self) -> T[src]

Cast the ceiling to an integer Read more

pub fn try_cast_trunc(self) -> Result<T, Error>[src]

Try converting to integer with truncation Read more

pub fn try_cast_nearest(self) -> Result<T, Error>[src]

Try converting to the nearest integer Read more

pub fn try_cast_floor(self) -> Result<T, Error>[src]

Try converting the floor to an integer Read more

pub fn try_cast_ceil(self) -> Result<T, Error>[src]

Try convert the ceiling to an integer Read more

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

pub fn conv(v: T) -> T[src]

Convert from T to Self

pub fn try_conv(v: T) -> Result<T, Error>[src]

Try converting from T to Self

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

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

Performs the conversion.

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.

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

Performs the conversion.

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