[][src]Struct rand_distr::Pert

pub struct Pert<N> { /* fields omitted */ }

The PERT distribution.

Similar to the Triangular distribution, the PERT distribution is parameterised by a range and a mode within that range. Unlike the Triangular distribution, the probability density function of the PERT distribution is smooth, with a configurable weighting around the mode.

Example

use rand_distr::{Pert, Distribution};

let d = Pert::new(0., 5., 2.5).unwrap();
let v = d.sample(&mut rand::thread_rng());
println!("{} is from a PERT distribution", v);

Methods

impl<N: Float> Pert<N> where
    StandardNormal: Distribution<N>,
    Exp1: Distribution<N>,
    Open01: Distribution<N>, 
[src]

pub fn new(min: N, max: N, mode: N) -> Result<Pert<N>, PertError>[src]

Set up the PERT distribution with defined min, max and mode.

This is equivalent to calling Pert::new_shape with shape == 4.0.

pub fn new_with_shape(
    min: N,
    max: N,
    mode: N,
    shape: N
) -> Result<Pert<N>, PertError>
[src]

Set up the PERT distribution with defined min, max, mode and shape.

Trait Implementations

impl<N: Clone> Clone for Pert<N>[src]

impl<N: Copy> Copy for Pert<N>[src]

impl<N: Debug> Debug for Pert<N>[src]

impl<N: Float> Distribution<N> for Pert<N> where
    StandardNormal: Distribution<N>,
    Exp1: Distribution<N>,
    Open01: Distribution<N>, 
[src]

Auto Trait Implementations

impl<N> Unpin for Pert<N> where
    N: Unpin

impl<N> Sync for Pert<N> where
    N: Sync

impl<N> Send for Pert<N> where
    N: Send

impl<N> UnwindSafe for Pert<N> where
    N: UnwindSafe

impl<N> RefUnwindSafe for Pert<N> where
    N: RefUnwindSafe

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

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