[][src]Enum arctk::math::rng::probability::Probability

pub enum Probability {
    Point {
        c: f64,
    },
    Points {
        cs: Array1<f64>,
    },
    Uniform {
        min: f64,
        max: f64,
    },
    Linear {
        t: f64,
        delta: f64,
        lambda: f64,
    },
    Gaussian {
        mu: f64,
        sigma: f64,
    },
    ConstantSpline {
        cdf: Formula,
    },
}

Probability distribution formulae.

Variants

Point

Point.

Fields of Point

c: f64

Constant value.

Points

Points.

Fields of Points

cs: Array1<f64>

Possible values.

Uniform

Uniform range.

Fields of Uniform

min: f64

Minimum value.

max: f64

Maximum value.

Linear

Linear function.

Fields of Linear

t: f64

Constant t.

delta: f64

Offset constant delta.

lambda: f64

Scaling value lambda.

Gaussian

Gaussian distribution.

Fields of Gaussian

mu: f64

Average value.

sigma: f64

Variance.

ConstantSpline

Constant spline.

Fields of ConstantSpline

cdf: Formula

Cumulative distribution function.

Implementations

impl Probability[src]

#[must_use]pub const fn new_point(c: f64) -> Self[src]

Construct a new point instance.

#[must_use]pub fn new_points(cs: Array1<f64>) -> Self[src]

Construct a new points instance.

#[must_use]pub fn new_uniform(min: f64, max: f64) -> Self[src]

Construct a new uniform instance.

#[must_use]pub fn new_linear(min: f64, max: f64, grad: f64, c: f64) -> Self[src]

Construct a new linear instance.

#[must_use]pub fn new_gaussian(mu: f64, sigma: f64) -> Self[src]

Construct a new gaussian instance.

#[must_use]pub fn new_constant_spline(xs: Array1<f64>, ps: &Array1<f64>) -> Self[src]

Construct a new constant spline instance.

#[must_use]pub fn sample(&self, rng: &mut ThreadRng) -> f64[src]

Sample a number from the described distribution.

Trait Implementations

impl Clone for Probability[src]

impl Display for Probability[src]

Auto Trait Implementations

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Background for T[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> Foreground for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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