Struct rand_distr::Gumbel
source · [−]pub struct Gumbel<F> where
F: Float,
OpenClosed01: Distribution<F>, { /* private fields */ }
Expand description
Samples floating-point numbers according to the Gumbel distribution
This distribution has density function:
f(x) = exp(-(z + exp(-z))) / σ
, where z = (x - μ) / σ
,
μ
is the location parameter, and σ
the scale parameter.
Example
use rand::prelude::*;
use rand_distr::Gumbel;
let val: f64 = thread_rng().sample(Gumbel::new(0.0, 1.0).unwrap());
println!("{}", val);
Implementations
Trait Implementations
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘ where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Auto Trait Implementations
impl<F> RefUnwindSafe for Gumbel<F> where
F: RefUnwindSafe,
impl<F> UnwindSafe for Gumbel<F> where
F: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more