Struct rand_distr::Frechet
source · [−]pub struct Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,{ /* private fields */ }
Expand description
Samples floating-point numbers according to the Fréchet distribution
This distribution has density function:
f(x) = [(x - μ) / σ]^(-1 - α) exp[-(x - μ) / σ]^(-α) α / σ
,
where μ
is the location parameter, σ
the scale parameter, and α
the shape parameter.
Example
use rand::prelude::*;
use rand_distr::Frechet;
let val: f64 = thread_rng().sample(Frechet::new(0.0, 1.0, 1.0).unwrap());
println!("{}", val);
Implementations
sourceimpl<F> Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
impl<F> Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
Trait Implementations
sourceimpl<F: Clone> Clone for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
impl<F: Clone> Clone for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
sourceimpl<F: Debug> Debug for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
impl<F: Debug> Debug for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
sourceimpl<F> Distribution<F> for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
impl<F> Distribution<F> for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
sourcefn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> F
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> F
Generate a random value of
T
, using rng
as the source of randomness.sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘNotable traits for DistIter<D, R, T>impl<D, R, T> Iterator for DistIter<D, R, T>where
D: Distribution<T>,
R: Rng, type Item = T;
where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>ⓘNotable traits for DistIter<D, R, T>impl<D, R, T> Iterator for DistIter<D, R, T>where
D: Distribution<T>,
R: Rng, type Item = T;
where
R: Rng,
D: Distribution<T>,
R: Rng, type Item = T;
Create an iterator that generates random values of
T
, using rng
as
the source of randomness. Read moreimpl<F: Copy> Copy for Frechet<F>where
F: Float,
OpenClosed01: Distribution<F>,
Auto Trait Implementations
impl<F> RefUnwindSafe for Frechet<F>where
F: RefUnwindSafe,
impl<F> Send for Frechet<F>where
F: Send,
impl<F> Sync for Frechet<F>where
F: Sync,
impl<F> Unpin for Frechet<F>where
F: Unpin,
impl<F> UnwindSafe for Frechet<F>where
F: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more