Struct net_ensembles::sampling::HistogramInt[][src]

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

Implementations

similar to self.borders_clone but does not allocate memory

Create a new histogram

  • right: exclusive border
  • left: inclusive border
  • bins: how many bins do you need?

Note

  • (right - left) % bins == 0 has to be true, otherwise the bins cannot all have the same length!

Create a new histogram

Note:

  • Due to implementation details, right cannot be T::MAX - if you try, you will get Err(HistErrors::Overflow)

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

How many bins the histogram contains

the created histogram

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

reset the histogram to zero

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

check if any bin was not hit yet

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

partition the interval Read more

None if not inside Hist covered zone

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

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

    does a value correspond to a valid bin?

    opposite of is_inside

    binning borders Read more

    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.