pub trait Histogram {
// Required methods
fn increment_index_by(
&mut self,
index: usize,
count: usize,
) -> Result<(), HistErrors>;
fn hist(&self) -> &Vec<usize>;
fn reset(&mut self);
// Provided methods
fn increment_index(&mut 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 increment_index_by(
&mut self,
index: usize,
count: usize,
) -> Result<(), HistErrors>
fn increment_index_by( &mut self, index: usize, count: usize, ) -> Result<(), HistErrors>
§self.hist[index] += count
, Err()
if index
out of bounds
Provided Methods§
Sourcefn increment_index(&mut self, index: usize) -> Result<(), HistErrors>
fn increment_index(&mut self, index: usize) -> Result<(), HistErrors>
§self.hist[index] += 1
, Err()
if index
out of bounds
Sourcefn any_bin_zero(&self) -> bool
fn any_bin_zero(&self) -> bool
check if any bin was not hit yet