Struct rand::distributions::StandardNormal [−][src]
pub struct StandardNormal;
Samples floating-point numbers according to the normal distribution
N(0, 1) (a.k.a. a standard normal, or Gaussian). This is equivalent to
Normal::new(0.0, 1.0) but faster.
See Normal for the general normal distribution.
Implemented via the ZIGNOR variant1 of the Ziggurat method.
Example
use rand::prelude::*; use rand::distributions::StandardNormal; let val: f64 = SmallRng::from_entropy().sample(StandardNormal); println!("{}", val);
-
Jurgen A. Doornik (2005). An Improved Ziggurat Method to Generate Normal Random Samples. Nuffield College, Oxford ↩
Trait Implementations
impl Clone for StandardNormal[src]
impl Clone for StandardNormalfn clone(&self) -> StandardNormal[src]
fn clone(&self) -> StandardNormalReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Copy for StandardNormal[src]
impl Copy for StandardNormalimpl Debug for StandardNormal[src]
impl Debug for StandardNormalfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Distribution<f64> for StandardNormal[src]
impl Distribution<f64> for StandardNormalfn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f64Generate a random value of T, using rng as the source of randomness.
ⓘImportant traits for DistIter<'a, D, R, T>fn sample_iter<'a, R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
Self: Sized,
R: Rng, [src]
ⓘImportant traits for DistIter<'a, D, R, T>
fn sample_iter<'a, R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
Self: Sized,
R: Rng, Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Auto Trait Implementations
impl Send for StandardNormal
impl Send for StandardNormalimpl Sync for StandardNormal
impl Sync for StandardNormal