pub struct StandardNormal;
Expand description
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_distr::StandardNormal;
let val: f64 = thread_rng().sample(StandardNormal);
println!("{}", val);
Jurgen A. Doornik (2005). An Improved Ziggurat Method to Generate Normal Random Samples. Nuffield College, Oxford ↩
Trait Implementations§
Source§impl Clone for StandardNormal
impl Clone for StandardNormal
Source§fn clone(&self) -> StandardNormal
fn clone(&self) -> StandardNormal
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StandardNormal
impl Debug for StandardNormal
Source§impl Distribution<f32> for StandardNormal
impl Distribution<f32> for StandardNormal
Source§impl Distribution<f64> for StandardNormal
impl Distribution<f64> for StandardNormal
impl Copy for StandardNormal
Auto Trait Implementations§
impl Freeze for StandardNormal
impl RefUnwindSafe for StandardNormal
impl Send for StandardNormal
impl Sync for StandardNormal
impl Unpin for StandardNormal
impl UnwindSafe for StandardNormal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 0 bytes