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]
impl Histogram
[src]pub fn with_const_width(start: f64, end: f64) -> Self
[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]
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]
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]
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 iter(&self) -> IterHistogram<'_>
[src]
pub fn iter(&self) -> IterHistogram<'_>
[src]Return an iterator over the bins and corresponding ranges:
((lower, upper), count)
Trait Implementations
impl<'a> AddAssign<&'a Histogram> for Histogram
[src]
impl<'a> AddAssign<&'a Histogram> for Histogram
[src]fn add_assign(&mut self, other: &Self)
[src]
fn add_assign(&mut self, other: &Self)
[src]Performs the +=
operation. Read more
impl<'de> Deserialize<'de> for Histogram
[src]
impl<'de> Deserialize<'de> for Histogram
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[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]
impl Histogram for Histogram
[src]fn normalized_bins(&self) -> IterNormalized<<&Self as IntoIterator>::IntoIter>
[src]
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]
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]
fn centers(&self) -> IterBinCenters<<&Self as IntoIterator>::IntoIter>
[src]Return an iterator over the bin centers.
impl<'a> IntoIterator for &'a Histogram
[src]
impl<'a> IntoIterator for &'a Histogram
[src]Auto Trait Implementations
impl RefUnwindSafe for Histogram
impl Send for Histogram
impl Sync for Histogram
impl Unpin for Histogram
impl UnwindSafe for Histogram
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<S, T> CastFloat<T> for S where
T: ConvFloat<S>,
[src]
impl<S, T> CastFloat<T> for S where
T: ConvFloat<S>,
[src]pub fn cast_trunc(self) -> T
[src]
pub fn cast_trunc(self) -> T
[src]Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
[src]
pub fn cast_nearest(self) -> T
[src]Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
[src]
pub fn cast_floor(self) -> T
[src]Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
[src]
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]
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]
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]
pub fn try_cast_ceil(self) -> Result<T, Error>
[src]Try convert the ceiling to an integer Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,