Trait net_ensembles::sampling::histogram::AtomicHistogram
source · [−]pub trait AtomicHistogram {
fn count_multiple_index(
&self,
index: usize,
count: usize
) -> Result<(), HistErrors>;
fn hist(&self) -> &[AtomicUsize];
fn reset(&mut self);
fn count_index(&self, index: usize) -> Result<(), HistErrors> { ... }
fn bin_count(&self) -> usize { ... }
fn any_bin_zero(&self) -> bool { ... }
}
Expand description
Implements histogram
- anything that implements
Histogram
should also implement the traitHistogramVal
Required Methods
sourcefn count_multiple_index(
&self,
index: usize,
count: usize
) -> Result<(), HistErrors>
fn count_multiple_index(
&self,
index: usize,
count: usize
) -> Result<(), HistErrors>
sourcefn hist(&self) -> &[AtomicUsize]
fn hist(&self) -> &[AtomicUsize]
the created histogram
Since this uses atomics, you can also write to the underlying hist yourself, if you so desire
Provided Methods
sourcefn count_index(&self, index: usize) -> Result<(), HistErrors>
fn count_index(&self, index: usize) -> Result<(), HistErrors>
sourcefn any_bin_zero(&self) -> bool
fn any_bin_zero(&self) -> bool
check if any bin was not hit yet
- Uses SeqCst Ordering