[][src]Struct ndhistogram::axis::Uniform

pub struct Uniform<T = f64> { /* fields omitted */ }

An axis with equal sized bins.

An axis with N equally spaced, equal sized, bins between (low, high]. Below (above) this range is an underflow (overflow) bin. Hence this axis has N+2 bins.

Example

Create a 1D histogram with 10 uniform bins between -5.0 and 5.0, plus overflow and underflow bins.

   use ndhistogram::{ndhistogram, Histogram};
   use ndhistogram::axis::{Axis, Uniform, BinInterval};
   let hist = ndhistogram!(Uniform::new(10, -5.0, 5.0));
   let axis = &hist.axes().as_tuple().0;
   assert_eq!(axis.bin(0), Some(BinInterval::underflow(-5.0)));
   assert_eq!(axis.bin(1), Some(BinInterval::new(-5.0, -4.0)));
   assert_eq!(axis.bin(11), Some(BinInterval::overflow(5.0)));

Implementations

impl<T> Uniform<T> where
    T: PartialOrd
[src]

pub fn new(num: usize, low: T, high: T) -> Self[src]

Factory method to create an axis with num uniformly spaced bins in the range [low, high). Under/overflow bins cover values outside this range.

Panics

Panics if num bins == 0 or low == high.

impl<T> Uniform<T>[src]

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

Low edge of axis (excluding underflow bin).

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

High edge of axis (excluding overflow bin).

Trait Implementations

impl<T: Float> Axis for Uniform<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 Uniform<T>[src]

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

impl<T: Default> Default for Uniform<T>[src]

impl<'de, T> Deserialize<'de> for Uniform<T> where
    T: Deserialize<'de>, 
[src]

impl<T: Display> Display for Uniform<T>[src]

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

impl<T: Hash> Hash for Uniform<T>[src]

impl<'a, T: Float> IntoIterator for &'a Uniform<T>[src]

type Item = (usize, <Uniform<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: Ord> Ord for Uniform<T>[src]

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

impl<T: PartialOrd> PartialOrd<Uniform<T>> for Uniform<T>[src]

impl<T> Serialize for Uniform<T> where
    T: Serialize
[src]

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

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

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Uniform<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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.