Struct rand_distr::Triangular[][src]

pub struct Triangular<F> where
    F: Float,
    Standard: Distribution<F>, 
{ /* fields omitted */ }

The triangular distribution.

A continuous probability distribution parameterised by a range, and a mode (most likely value) within that range.

The probability density function is triangular. For a similar distribution with a smooth PDF, see the Pert distribution.

Example

use rand_distr::{Triangular, Distribution};

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

Implementations

impl<F> Triangular<F> where
    F: Float,
    Standard: Distribution<F>, 
[src]

pub fn new(min: F, max: F, mode: F) -> Result<Triangular<F>, TriangularError>[src]

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

Trait Implementations

impl<F: Clone> Clone for Triangular<F> where
    F: Float,
    Standard: Distribution<F>, 
[src]

impl<F: Debug> Debug for Triangular<F> where
    F: Float,
    Standard: Distribution<F>, 
[src]

impl<F> Distribution<F> for Triangular<F> where
    F: Float,
    Standard: Distribution<F>, 
[src]

impl<F: Copy> Copy for Triangular<F> where
    F: Float,
    Standard: Distribution<F>, 
[src]

Auto Trait Implementations

impl<F> RefUnwindSafe for Triangular<F> where
    F: RefUnwindSafe

impl<F> Send for Triangular<F> where
    F: Send

impl<F> Sync for Triangular<F> where
    F: Sync

impl<F> Unpin for Triangular<F> where
    F: Unpin

impl<F> UnwindSafe for Triangular<F> where
    F: UnwindSafe

Blanket Implementations

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

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]