[][src]Trait ndhistogram::Histogram

pub trait Histogram<A: Axes, V> {
    pub fn axes(&self) -> &A;
pub fn value_at_index(&self, index: usize) -> Option<&V>;
pub fn values(&self) -> Box<dyn Iterator<Item = &'_ V> + '_>;
pub fn iter(
        &self
    ) -> Box<dyn Iterator<Item = Item<<A as Axis>::BinInterval, &'_ V>> + '_>;
pub fn value_at_index_mut(&mut self, index: usize) -> Option<&mut V>;
pub fn values_mut(&mut self) -> Box<dyn Iterator<Item = &'_ mut V> + '_>;
pub fn iter_mut(
        &mut self
    ) -> Box<dyn Iterator<Item = Item<<A as Axis>::BinInterval, &'_ mut V>> + '_>; pub fn value(&self, coordinate: &A::Coordinate) -> Option<&V> { ... }
pub fn value_mut(&mut self, coordinate: &A::Coordinate) -> Option<&mut V> { ... }
pub fn fill(&mut self, coordinate: &A::Coordinate)
    where
        V: Fill
, { ... }
pub fn fill_weight<W>(&mut self, coordinate: &A::Coordinate, weight: W)
    where
        V: FillWeight<W>
, { ... } }

A common interface for an ND histograms.

Implementations of this trait should handle storing the histogram bin values and provide methods to fill and read those values.

The most commonly used implementation is VecHistogram. See ndhistogram for examples of its use.

Required methods

pub fn axes(&self) -> &A[src]

The histogram Axes that map coordinates to bin numbers.

pub fn value_at_index(&self, index: usize) -> Option<&V>[src]

Read a bin value given an index. Return an Option as the given index may not be valid for this histogram.

pub fn values(&self) -> Box<dyn Iterator<Item = &'_ V> + '_>[src]

Iterator over bin values.

pub fn iter(
    &self
) -> Box<dyn Iterator<Item = Item<<A as Axis>::BinInterval, &'_ V>> + '_>
[src]

Iterator over bin indices, bin interval and bin values.

pub fn value_at_index_mut(&mut self, index: usize) -> Option<&mut V>[src]

Mutable access to a bin value at a given index.

pub fn values_mut(&mut self) -> Box<dyn Iterator<Item = &'_ mut V> + '_>[src]

Mutable iterator over bin values.

pub fn iter_mut(
    &mut self
) -> Box<dyn Iterator<Item = Item<<A as Axis>::BinInterval, &'_ mut V>> + '_>
[src]

Mutable iterator bin indices, bin interval and bin values.

Loading content...

Provided methods

pub fn value(&self, coordinate: &A::Coordinate) -> Option<&V>[src]

Read a bin value given a coordinate. Returns an Option as the given coordinate may not be mapeed to a bin.

pub fn value_mut(&mut self, coordinate: &A::Coordinate) -> Option<&mut V>[src]

Mutable access to a bin value at a given coordinate.

pub fn fill(&mut self, coordinate: &A::Coordinate) where
    V: Fill
[src]

Fill the histogram bin value at coordinate with unit weight. If the Axes do no cover that coordinate, do nothing. See Fill.

pub fn fill_weight<W>(&mut self, coordinate: &A::Coordinate, weight: W) where
    V: FillWeight<W>, 
[src]

Fill the histogram bin value at coordinate with a weight. If the Axes do no cover that coordinate, do nothing. See FillWeight.

Loading content...

Implementors

impl<A: Axes, V> Histogram<A, V> for VecHistogram<A, V>[src]

Loading content...