[−][src]Struct average::Histogram10
A histogram with a number of bins known at compile time.
Methods
impl Histogram
[src]
impl Histogram
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, ()> where | [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, ()> | [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<(), ()> | [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 Merge for Histogram
[src]
impl Merge for Histogram
impl Histogram for Histogram
[src]
impl Histogram for Histogram
fn bins(&self) -> &[u64] | [src] |
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 Debug for Histogram
[src]
impl Debug for Histogram
impl<'a> AddAssign<&'a Histogram> for Histogram
[src]
impl<'a> AddAssign<&'a Histogram> for Histogram
fn add_assign(&mut self, other: &Self) | [src] |
impl MulAssign<u64> for Histogram
[src]
impl MulAssign<u64> for Histogram
fn mul_assign(&mut self, other: u64) | [src] |
impl<'a> IntoIterator for &'a Histogram
[src]
impl<'a> IntoIterator for &'a Histogram
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] |
impl Clone for Histogram
[src]
impl Clone for Histogram
Auto Trait Implementations
impl Send for Histogram10
impl Send for Histogram10
impl Sync for Histogram10
impl Sync for Histogram10
Blanket Implementations
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)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> From for T
[src]
impl<T> From for T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> ConvUtil for T
[src]
impl<T> ConvUtil for T
fn approx_as<Dst>(self) -> Result<Dst, Self::Err> where | [src] |
Approximate the subject to a given type with the default scheme.
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err> where | [src] |
Approximate the subject to a given type with a specific scheme.
fn into_as<Dst>(self) -> Dst where | [src] |
Convert the subject to a given type.
fn try_as<Dst>(self) -> Result<Dst, Self::Err> where | [src] |
Attempt to convert the subject to a given type.
fn value_as<Dst>(self) -> Result<Dst, Self::Err> where | [src] |
Attempt a value conversion of the subject to a given type.
impl<Dst, Src, Scheme> ApproxInto for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
[src]
impl<Dst, Src, Scheme> ApproxInto for Src where
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err> | [src] |
impl<Src, Dst> ValueInto for Src where
Dst: ValueFrom<Src>,
[src]
impl<Src, Dst> ValueInto for Src where
Dst: ValueFrom<Src>,
type Err = <Dst as ValueFrom<Src>>::Err
The error type produced by a failed conversion.
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err> | [src] |
impl<Src> ValueFrom for Src
[src]
impl<Src> ValueFrom for Src
type Err = NoError
The error type produced by a failed conversion.
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err> | [src] |
impl<Src, Scheme> ApproxFrom for Src where
Scheme: ApproxScheme,
[src]
impl<Src, Scheme> ApproxFrom for Src where
Scheme: ApproxScheme,
type Err = NoError
The error type produced by a failed conversion.
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err> | [src] |
impl<T, Dst> ConvAsUtil for T
[src]
impl<T, Dst> ConvAsUtil for T
fn approx(self) -> Result<Dst, Self::Err> where | [src] |
Approximate the subject with the default scheme.
fn approx_by<Scheme>(self) -> Result<Dst, Self::Err> where | [src] |
Approximate the subject with a specific scheme.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<Src> TryFrom for Src
[src]
impl<Src> TryFrom for Src
type Err = NoError
The error type produced by a failed conversion.
fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err> | [src] |
impl<Src, Dst> TryInto for Src where
Dst: TryFrom<Src>,
[src]
impl<Src, Dst> TryInto for Src where
Dst: TryFrom<Src>,