Struct sgx_rand::distributions::exponential::Exp
source · [−]pub struct Exp { /* private fields */ }
Expand description
The exponential distribution Exp(lambda)
.
This distribution has density function: f(x) = lambda * exp(-lambda * x)
for x > 0
.
Example
use sgx_rand::distributions::{Exp, IndependentSample};
let exp = Exp::new(2.0);
let v = exp.ind_sample(&mut sgx_rand::thread_rng());
println!("{} is from a Exp(2) distribution", v);
Implementations
Trait Implementations
sourceimpl IndependentSample<f64> for Exp
impl IndependentSample<f64> for Exp
sourcefn ind_sample<R: Rng>(&self, rng: &mut R) -> f64
fn ind_sample<R: Rng>(&self, rng: &mut R) -> f64
Generate a random value.
impl Copy for Exp
Auto Trait Implementations
impl RefUnwindSafe for Exp
impl Send for Exp
impl Sync for Exp
impl Unpin for Exp
impl UnwindSafe for Exp
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more