[−][src]Struct ndhistogram::axis::VariableNoFlow
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 bins between 0.0 and 7.0.
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 ignored 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.
Panics
Panics under the same conditions as 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
pub fn index(&self, coordinate: &Self::Coordinate) -> Option<usize>
[src]
pub fn num_bins(&self) -> usize
[src]
pub fn bin(&self, index: usize) -> Option<Self::BinInterval>
[src]
pub fn indices(&self) -> Box<dyn Iterator<Item = usize>>
[src]
pub fn iter(&self) -> Box<dyn Iterator<Item = (usize, Self::BinInterval)> + '_>
[src]
pub fn bins(&self) -> Box<dyn Iterator<Item = Self::BinInterval> + '_>
[src]
pub fn num_dim(&self) -> usize
[src]
impl<T: Clone> Clone for VariableNoFlow<T>
[src]
pub fn clone(&self) -> VariableNoFlow<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for VariableNoFlow<T>
[src]
impl<T: Default> Default for VariableNoFlow<T>
[src]
pub fn default() -> VariableNoFlow<T>
[src]
impl<'de, T> Deserialize<'de> for VariableNoFlow<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: PartialOrd + Copy + Display> Display for VariableNoFlow<T> where
Self: Axis,
[src]
Self: Axis,
impl<T: Eq> Eq for VariableNoFlow<T>
[src]
impl<T: Hash> Hash for VariableNoFlow<T>
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl<T: Ord> Ord for VariableNoFlow<T>
[src]
pub fn cmp(&self, other: &VariableNoFlow<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: PartialEq> PartialEq<VariableNoFlow<T>> for VariableNoFlow<T>
[src]
pub fn eq(&self, other: &VariableNoFlow<T>) -> bool
[src]
pub fn ne(&self, other: &VariableNoFlow<T>) -> bool
[src]
impl<T: PartialOrd> PartialOrd<VariableNoFlow<T>> for VariableNoFlow<T>
[src]
pub fn partial_cmp(&self, other: &VariableNoFlow<T>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &VariableNoFlow<T>) -> bool
[src]
pub fn le(&self, other: &VariableNoFlow<T>) -> bool
[src]
pub fn gt(&self, other: &VariableNoFlow<T>) -> bool
[src]
pub fn ge(&self, other: &VariableNoFlow<T>) -> bool
[src]
impl<T> Serialize for VariableNoFlow<T> where
T: Serialize,
[src]
T: Serialize,
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: RefUnwindSafe,
impl<T> Send for VariableNoFlow<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for VariableNoFlow<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for VariableNoFlow<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for VariableNoFlow<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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,