Struct net_ensembles::sampling::HistogramFloat [−][src]
pub struct HistogramFloat<T> { /* fields omitted */ }
Expand description
Generic Histogram struct
Implementations
Create a new Historgram
- right exclusive, left inclusive
- if you want
right
to behave (almost) the same as an inclusive border, consider usingnew(left, right + T::EPSILON, bins)
(make sure, that adding Epsilon actually changes the value!)
Returns the length of the interval
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<HistogramFloat<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<HistogramFloat<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
self.hist[index] += count
, Err()
if index
out of bounds
self.hist[index] += 1
, Err()
if index
out of bounds
check if any bin was not hit yet
impl<T> HistogramIntervalDistance<T> for HistogramFloat<T> where
T: Float + FromPrimitive + Zero + NumCast,
impl<T> HistogramIntervalDistance<T> for HistogramFloat<T> where
T: Float + FromPrimitive + Zero + NumCast,
pub fn interval_distance_overlap<V>(
&self,
val: V,
overlap: NonZeroUsize
) -> usize where
V: Borrow<T>,
pub fn interval_distance_overlap<V>(
&self,
val: V,
overlap: NonZeroUsize
) -> usize where
V: Borrow<T>,
Distance metric for how far a value is from a valid interval Read more
consider using self.borders()
calculates some sort of absolute distance to the nearest valid bin Read more
get the left most border (inclusive)
let b = self.borders_clone().expect("overflow"); assert_eq!(self.second_last_border(), b[b.len()-2])
does a value correspond to a valid bin?
opposite of is_inside
convert val to the respective histogram index
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for HistogramFloat<T> where
T: RefUnwindSafe,
impl<T> Send for HistogramFloat<T> where
T: Send,
impl<T> Sync for HistogramFloat<T> where
T: Sync,
impl<T> Unpin for HistogramFloat<T> where
T: Unpin,
impl<T> UnwindSafe for HistogramFloat<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn cast_trunc(self) -> T
pub fn cast_trunc(self) -> T
Cast to integer, truncating Read more
pub fn cast_nearest(self) -> T
pub fn cast_nearest(self) -> T
Cast to the nearest integer Read more
pub fn cast_floor(self) -> T
pub fn cast_floor(self) -> T
Cast the floor to an integer Read more
pub fn try_cast_trunc(self) -> Result<T, Error>
pub fn try_cast_trunc(self) -> Result<T, Error>
Try converting to integer with truncation Read more
pub fn try_cast_nearest(self) -> Result<T, Error>
pub fn try_cast_nearest(self) -> Result<T, Error>
Try converting to the nearest integer Read more
pub fn try_cast_floor(self) -> Result<T, Error>
pub fn try_cast_floor(self) -> Result<T, Error>
Try converting the floor to an integer Read more
pub fn try_cast_ceil(self) -> Result<T, Error>
pub fn try_cast_ceil(self) -> Result<T, Error>
Try convert the ceiling to an integer Read more