Struct average::Histogram10 [−][src]
pub struct Histogram10 { /* fields omitted */ }
A histogram with a number of bins known at compile time.
Methods
impl Histogram10
[src]
impl Histogram10
pub fn with_const_width(start: f64, end: f64) -> Self
[src]
pub fn with_const_width(start: f64, end: f64) -> Self
Construct a histogram with constant bin width.
pub fn from_ranges<T>(ranges: T) -> Result<Self, ()> where
T: IntoIterator<Item = f64>,
[src]
pub fn from_ranges<T>(ranges: T) -> Result<Self, ()> where
T: IntoIterator<Item = f64>,
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]
pub fn find(&self, x: f64) -> Result<usize, ()>
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]
pub fn add(&mut self, x: f64) -> Result<(), ()>
Add a sample to the histogram.
Fails if the sample is out of range of the histogram.
pub fn ranges(&self) -> &[f64]
[src]
pub fn ranges(&self) -> &[f64]
Return the ranges of the histogram.
ⓘImportant traits for IterHistogram<'a>pub fn iter(&self) -> IterHistogram
[src]
pub fn iter(&self) -> IterHistogram
Return an iterator over the bins and corresponding ranges:
((lower, upper), count)
pub fn reset(&mut self)
[src]
pub fn reset(&mut self)
Reset all bins to zero.
pub fn range_min(&self) -> f64
[src]
pub fn range_min(&self) -> f64
Return the lower range limit.
(The corresponding bin might be empty.)
pub fn range_max(&self) -> f64
[src]
pub fn range_max(&self) -> f64
Return the upper range limit.
(The corresponding bin might be empty.)
Trait Implementations
impl Debug for Histogram10
[src]
impl Debug for Histogram10
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Histogram10
[src]
impl Clone for Histogram10
fn clone(&self) -> Histogram10
[src]
fn clone(&self) -> Histogram10
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'a> IntoIterator for &'a Histogram10
[src]
impl<'a> IntoIterator for &'a Histogram10
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?
ⓘImportant traits for IterHistogram<'a>fn into_iter(self) -> IterHistogram<'a>
[src]
fn into_iter(self) -> IterHistogram<'a>
Creates an iterator from a value. Read more
impl Histogram for Histogram10
[src]
impl Histogram for Histogram10
fn bins(&self) -> &[u64]
[src]
fn bins(&self) -> &[u64]
Return the bins of the histogram.
fn variance(&self, bin: usize) -> f64
[src]
fn variance(&self, bin: usize) -> f64
Estimate the variance for the given bin. Read more
fn normalized_bins(&self) -> IterNormalized<<&Self as IntoIterator>::IntoIter>
[src]
fn normalized_bins(&self) -> IterNormalized<<&Self as IntoIterator>::IntoIter>
Return an iterator over the bins normalized by the bin widths.
fn widths(&self) -> IterWidths<<&Self as IntoIterator>::IntoIter>
[src]
fn widths(&self) -> IterWidths<<&Self as IntoIterator>::IntoIter>
Return an iterator over the bin widths.
fn centers(&self) -> IterBinCenters<<&Self as IntoIterator>::IntoIter>
[src]
fn centers(&self) -> IterBinCenters<<&Self as IntoIterator>::IntoIter>
Return an iterator over the bin centers.
fn variances(&self) -> IterVariances<<&Self as IntoIterator>::IntoIter>
[src]
fn variances(&self) -> IterVariances<<&Self as IntoIterator>::IntoIter>
Return an iterator over the bin variances. Read more
impl<'a> AddAssign<&'a Self> for Histogram10
[src]
impl<'a> AddAssign<&'a Self> for Histogram10
fn add_assign(&mut self, other: &Self)
[src]
fn add_assign(&mut self, other: &Self)
Performs the +=
operation.
impl MulAssign<u64> for Histogram10
[src]
impl MulAssign<u64> for Histogram10
fn mul_assign(&mut self, other: u64)
[src]
fn mul_assign(&mut self, other: u64)
Performs the *=
operation.
impl Merge for Histogram10
[src]
impl Merge for Histogram10
Auto Trait Implementations
impl Send for Histogram10
impl Send for Histogram10
impl Sync for Histogram10
impl Sync for Histogram10