[−][src]Struct ndarray_rand::rand_distr::Pert
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> Pert<N> where
N: Float,
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
[src]
N: Float,
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
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]
min: N,
max: N,
mode: N,
shape: N
) -> Result<Pert<N>, PertError>
Set up the PERT distribution with defined min
, max
, mode
and
shape
.
Trait Implementations
impl<N> Debug for Pert<N> where
N: Debug,
[src]
N: Debug,
impl<N> Copy for Pert<N> where
N: Copy,
[src]
N: Copy,
impl<N> Clone for Pert<N> where
N: Clone,
[src]
N: Clone,
impl<N> Distribution<N> for Pert<N> where
N: Float,
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
[src]
N: Float,
StandardNormal: Distribution<N>,
Exp1: Distribution<N>,
Open01: Distribution<N>,
Auto Trait Implementations
impl<N> Unpin for Pert<N> where
N: Unpin,
N: Unpin,
impl<N> Sync for Pert<N> where
N: Sync,
N: Sync,
impl<N> Send for Pert<N> where
N: Send,
N: Send,
impl<N> UnwindSafe for Pert<N> where
N: UnwindSafe,
N: UnwindSafe,
impl<N> RefUnwindSafe for Pert<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,