Skip to main content

BinningStrategy

Trait BinningStrategy 

Source
pub trait BinningStrategy:
    Send
    + Sync
    + 'static {
    // Required methods
    fn observe(&mut self, value: f64);
    fn compute_edges(&self, n_bins: usize) -> BinEdges;
    fn reset(&mut self);
    fn clone_fresh(&self) -> Box<dyn BinningStrategy>;
}
Available on crate feature alloc only.
Expand description

A strategy for computing histogram bin edges from a stream of values.

Required Methods§

Source

fn observe(&mut self, value: f64)

Observe a single value from the stream.

Source

fn compute_edges(&self, n_bins: usize) -> BinEdges

Compute bin edges from observed values.

Source

fn reset(&mut self)

Reset observed state.

Source

fn clone_fresh(&self) -> Box<dyn BinningStrategy>

Create a fresh instance with the same configuration.

Implementors§