[−][src]Struct math::histogram::Histogram
The Histogram consists of num_intervals
intervals between the min
and
the max
value.
Implementations
impl<T> Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
pub fn new<'a>(
elements: Option<&'a Vec<T>>,
num_intervals: usize,
min: T,
max: T
) -> Result<Histogram<T>, String> where
&'a T: Deref,
[src]
elements: Option<&'a Vec<T>>,
num_intervals: usize,
min: T,
max: T
) -> Result<Histogram<T>, String> where
&'a T: Deref,
Initializing with Known Boundaries
Creates a Histogram consisting of num_intervals
intervals between the
values min
and max
, and inserts the values from the vector of
elements
into the histogram. Values smaller than min
will
increment the counter num_less_than_min
, while values larger than
max
will increment the counter num_larger_than_max
Example
use math::histogram::Histogram; let histogram = Histogram::new(Some(&vec![2, -1, 3, 5, 8]), 5, 0, 10).unwrap(); assert_eq!(histogram.get_boundaries().len(), 6); assert_eq!(histogram.get_num_less_than_min(), 1); assert_eq!(histogram.get_num_larger_than_max(), 0); assert_eq!(histogram.get_min_received(), Some(-1)); assert_eq!(histogram.get_max_received(), Some(8));
pub fn num_intervals(&self) -> usize
[src]
pub fn get_ratios(&self) -> Vec<f64>
[src]
pub fn new_with_auto_range<'a>(
elements: &'a Vec<T>,
num_intervals: usize
) -> Result<Histogram<T>, String> where
&'a T: Deref,
T: Ord,
[src]
elements: &'a Vec<T>,
num_intervals: usize
) -> Result<Histogram<T>, String> where
&'a T: Deref,
T: Ord,
pub fn get_boundaries(&self) -> &Vec<T>
[src]
pub fn get_counters(&self) -> &Vec<usize>
[src]
pub fn get_num_less_than_min(&self) -> usize
[src]
pub fn get_num_larger_than_max(&self) -> usize
[src]
pub fn get_min_received(&self) -> Option<T>
[src]
pub fn get_max_received(&self) -> Option<T>
[src]
pub fn min_boundary(&self) -> T
[src]
pub fn max_boundary(&self) -> T
[src]
Trait Implementations
impl<T: Clone> Clone for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
impl<T> Collecting<T> for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
impl<T: Debug> Debug for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
impl<T> Display for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
impl<T: Eq> Eq for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
impl<T: PartialEq> PartialEq<Histogram<T>> for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
pub fn eq(&self, other: &Histogram<T>) -> bool
[src]
pub fn ne(&self, other: &Histogram<T>) -> bool
[src]
impl<T> StructuralEq for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
impl<T> StructuralPartialEq for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
impl<'a, T> ToIterator<'a, HistogramIter<'a, T>, (T, T, usize)> for Histogram<T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
[src]
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display,
pub fn to_iter(&'a self) -> HistogramIter<'a, T>ⓘNotable traits for HistogramIter<'a, T>
impl<'a, T> Iterator for HistogramIter<'a, T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display, type Item = HistogramEntry<T>;
[src]
Notable traits for HistogramIter<'a, T>
impl<'a, T> Iterator for HistogramIter<'a, T> where
T: PartialOrd + NumAssign + NumOps + FromPrimitive + ToPrimitive + Copy + Display, type Item = HistogramEntry<T>;
Auto Trait Implementations
impl<T> RefUnwindSafe for Histogram<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Histogram<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Histogram<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Histogram<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Histogram<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,