Struct rand_distr::Exp [−][src]
pub struct Exp<F> where
F: Float,
Exp1: Distribution<F>, { /* fields omitted */ }
The exponential distribution Exp(lambda)
.
This distribution has density function: f(x) = lambda * exp(-lambda * x)
for x > 0
, when lambda > 0
. For lambda = 0
, all samples yield infinity.
Note that Exp1
is an optimised implementation for lambda = 1
.
Example
use rand_distr::{Exp, Distribution}; let exp = Exp::new(2.0).unwrap(); let v = exp.sample(&mut rand::thread_rng()); println!("{} is from a Exp(2) distribution", v);
Implementations
impl<F: Float> Exp<F> where
F: Float,
Exp1: Distribution<F>,
[src]
impl<F: Float> Exp<F> where
F: Float,
Exp1: Distribution<F>,
[src]Trait Implementations
impl<F> Distribution<F> for Exp<F> where
F: Float,
Exp1: Distribution<F>,
[src]
impl<F> Distribution<F> for Exp<F> where
F: Float,
Exp1: Distribution<F>,
[src]impl<F: Copy> Copy for Exp<F> where
F: Float,
Exp1: Distribution<F>,
[src]
F: Float,
Exp1: Distribution<F>,
Auto Trait Implementations
impl<F> RefUnwindSafe for Exp<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for Exp<F> where
F: Send,
F: Send,
impl<F> Sync for Exp<F> where
F: Sync,
F: Sync,
impl<F> Unpin for Exp<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for Exp<F> where
F: UnwindSafe,
F: UnwindSafe,