Struct net_ensembles::sampling::HistogramFast[][src]

pub struct HistogramFast<T> { /* fields omitted */ }
Expand description

Faster version of HistogramInt for Integers

provided the bins should be: (left, left +1, …, right - 1) then you should use this version!

Implementations

Create a new interval

  • same as Self::new_inclusive(left, right - 1) though with checks
  • That makes left an inclusive and right an exclusive border

Create new histogram with inclusive borders

  • Err if left > right
  • left is inclusive border
  • right is inclusive border

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

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

the created histogram

How many bins the histogram contains

reset the histogram to zero

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

check if any bin was not hit yet

Create a histogram, which encapsulates the histograms passed Read more

Get bin difference between histograms Read more

Distance metric for how far a value is from a valid interval Read more

partition the interval Read more

Creates a vector containing borders (last border is exclusive)

  • returns Err(Overflow) if right border is T::MAX
  • creates and returns borders otherwise
  • Note: even if Err(Overflow) is returned, this does not provide any problems for the rest of the implementation, as the border vector is not used internally for HistogramFast

get the left most border (inclusive)

  • get second last border from the right
  • should be the same as let b = self.borders_clone().expect("overflow"); assert_eq!(self.second_last_border(), b[b.len()-2])
  • Read more

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

    convert val to the respective histogram index

    does a value correspond to a valid bin?

    opposite of is_inside

    count val. Some(index), if inside of hist, None if val is invalid

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations

    Blanket Implementations

    Gets the TypeId of self. Read more

    Immutably borrows from an owned value. Read more

    Mutably borrows from an owned value. Read more

    Cast from Self to T

    Try converting from Self to T

    Cast to integer, truncating Read more

    Cast to the nearest integer Read more

    Cast the floor to an integer Read more

    Cast the ceiling to an integer Read more

    Try converting to integer with truncation Read more

    Try converting to the nearest integer Read more

    Try converting the floor to an integer Read more

    Try convert the ceiling to an integer Read more

    Convert from T to Self

    Try converting from T to Self

    Performs the conversion.

    Performs the conversion.

    The alignment of pointer.

    The type for initializers.

    Initializes a with the given initializer. Read more

    Dereferences the given pointer. Read more

    Mutably dereferences the given pointer. Read more

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

    The resulting type after obtaining ownership.

    Creates owned data from borrowed data, usually by cloning. Read more

    🔬 This is a nightly-only experimental API. (toowned_clone_into)

    recently added

    Uses borrowed data to replace owned data, usually by cloning. Read more

    The type returned in the event of a conversion error.

    Performs the conversion.

    The type returned in the event of a conversion error.

    Performs the conversion.