Struct rand_distr::Pareto
source · [−]pub struct Pareto<F> where
F: Float,
OpenClosed01: Distribution<F>, { /* private fields */ }
Expand description
Samples floating-point numbers according to the Pareto distribution
Example
use rand::prelude::*;
use rand_distr::Pareto;
let val: f64 = thread_rng().sample(Pareto::new(1., 2.).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 Pareto<F> where
F: RefUnwindSafe,
impl<F> UnwindSafe for Pareto<F> where
F: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more