pub struct GenericHist<B, T> { /* private fields */ }
Expand description

Provides Histogram functionallity

  • Is automatically implemented for any type that implements Binning

Implementations§

source§

impl<B, T> GenericHist<B, T>
where B: Binning<T>,

source

pub fn new(binning: B) -> Self

Create a new histogram from an arbitrary binning

source

pub fn binning(&self) -> &B

Get reference to underlying binning

Trait Implementations§

source§

impl<B, T> Histogram for GenericHist<B, T>
where B: Binning<T>,

source§

fn hist(&self) -> &Vec<usize>

the created histogram Read more
source§

fn any_bin_zero(&self) -> bool

check if any bin was not hit yet
source§

fn bin_count(&self) -> usize

How many bins the histogram contains Read more
source§

fn count_index(&mut self, index: usize) -> Result<(), HistErrors>

self.hist[index] += 1, Err() if index out of bounds Read more
source§

fn count_multiple_index( &mut self, index: usize, count: usize ) -> Result<(), HistErrors>

self.hist[index] += count, Err() if index out of bounds Read more
source§

fn reset(&mut self)

reset the histogram to zero
source§

impl<T, B> HistogramVal<T> for GenericHist<B, T>
where B: Binning<T>,

source§

fn get_bin_index<V: Borrow<T>>(&self, val: V) -> Result<usize, HistErrors>

convert val to the respective histogram index
source§

fn first_border(&self) -> T

get the left most border (inclusive)
source§

fn is_inside<V: Borrow<T>>(&self, val: V) -> bool

does a value correspond to a valid bin?
source§

fn count_val<V: Borrow<T>>(&mut self, val: V) -> Result<usize, HistErrors>

count val. Ok(index), if inside of hist, Err(_) if val is invalid
source§

fn not_inside<V: Borrow<T>>(&self, val: V) -> bool

opposite of is_inside
source§

fn last_border(&self) -> T

get last border from the right Read more
source§

fn last_border_is_inclusive(&self) -> bool

True if last border is inclusive, false otherwise Read more
source§

fn distance<V: Borrow<T>>(&self, val: V) -> f64

calculates some sort of absolute distance to the nearest valid bin Read more
source§

fn bin_enum_iter(&self) -> Box<dyn Iterator<Item = Bin<T>>>

binning borders Read more

Auto Trait Implementations§

§

impl<B, T> RefUnwindSafe for GenericHist<B, T>

§

impl<B, T> Send for GenericHist<B, T>
where B: Send, T: Send,

§

impl<B, T> Sync for GenericHist<B, T>
where B: Sync, T: Sync,

§

impl<B, T> Unpin for GenericHist<B, T>
where B: Unpin, T: Unpin,

§

impl<B, T> UnwindSafe for GenericHist<B, T>
where B: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<S, T> Cast<T> for S
where T: Conv<S>,

§

fn cast(self) -> T

Cast from Self to T Read more
§

fn try_cast(self) -> Result<T, Error>

Try converting from Self to T Read more
§

impl<S, T> CastApprox<T> for S
where T: ConvApprox<S>,

§

fn try_cast_approx(self) -> Result<T, Error>

Try approximate conversion from Self to T Read more
§

fn cast_approx(self) -> T

Cast approximately from Self to T Read more
§

impl<S, T> CastFloat<T> for S
where T: ConvFloat<S>,

§

fn cast_trunc(self) -> T

Cast to integer, truncating Read more
§

fn cast_nearest(self) -> T

Cast to the nearest integer Read more
§

fn cast_floor(self) -> T

Cast the floor to an integer Read more
§

fn cast_ceil(self) -> T

Cast the ceiling to an integer Read more
§

fn try_cast_trunc(self) -> Result<T, Error>

Try converting to integer with truncation Read more
§

fn try_cast_nearest(self) -> Result<T, Error>

Try converting to the nearest integer Read more
§

fn try_cast_floor(self) -> Result<T, Error>

Try converting the floor to an integer Read more
§

fn try_cast_ceil(self) -> Result<T, Error>

Try convert the ceiling to an integer Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V