[][src]Struct ndhistogram::axis::VariableNoFlow

pub struct VariableNoFlow<T> { /* fields omitted */ }

An axis with variable sized bins and no overflow bins.

An axis with variable sized bins constructed with a list of bin edges. This axis has (num edges - 1) bins.

Example

Create a 1D histogram with 3 variable width bin 0.0 and 7.0, plus overflow and underflow bins.

   use ndhistogram::{ndhistogram, Histogram};
   use ndhistogram::axis::{Axis, VariableNoFlow};
   let mut hist = ndhistogram!(VariableNoFlow::new(vec![0.0, 1.0, 3.0, 7.0]); i32);
   hist.fill(&-1.0); // will be ignore as there is no underflow bin
   hist.fill(&1.0);
   hist.fill(&2.0);
   assert_eq!(
       hist.values().copied().collect::<Vec<_>>(),
       vec![0, 2, 0],
   );

Implementations

impl<T: PartialOrd + Copy> VariableNoFlow<T>[src]

pub fn new<I: IntoIterator<Item = T>>(bin_edges: I) -> Self[src]

Factory method to create an variable binning from a set of bin edges with no under/overflow bins. See the documentation for Variable::new.

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

Return the lowest bin edge.

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

Return the highest bin edge.

Trait Implementations

impl<T: PartialOrd + Copy> Axis for VariableNoFlow<T>[src]

type Coordinate = T

The type representing a location on this axis.

type BinInterval = BinInterval<T>

The type of an interval representing the set of Coordinates that correspond to a histogram bin

impl<T: Clone> Clone for VariableNoFlow<T>[src]

impl<T: Debug> Debug for VariableNoFlow<T>[src]

impl<T: PartialOrd + Copy + Display> Display for VariableNoFlow<T> where
    Self: Axis
[src]

impl<T: Eq> Eq for VariableNoFlow<T>[src]

impl<'a, T: PartialOrd + Copy> IntoIterator for &'a VariableNoFlow<T>[src]

type Item = (usize, <VariableNoFlow<T> as Axis>::BinInterval)

The type of the elements being iterated over.

type IntoIter = Box<dyn Iterator<Item = Self::Item> + 'a>

Which kind of iterator are we turning this into?

impl<T: PartialEq> PartialEq<VariableNoFlow<T>> for VariableNoFlow<T>[src]

impl<T> StructuralEq for VariableNoFlow<T>[src]

impl<T> StructuralPartialEq for VariableNoFlow<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for VariableNoFlow<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for VariableNoFlow<T> where
    T: Send
[src]

impl<T> Sync for VariableNoFlow<T> where
    T: Sync
[src]

impl<T> Unpin for VariableNoFlow<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for VariableNoFlow<T> where
    T: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.