Struct rand_distr::Normal [−][src]
pub struct Normal<N> { /* fields omitted */ }
The normal distribution N(mean, std_dev**2)
.
This uses the ZIGNOR variant of the Ziggurat method, see StandardNormal
for more details.
Note that StandardNormal
is an optimised implementation for mean 0, and
standard deviation 1.
Example
use rand_distr::{Normal, Distribution}; // mean 2, standard deviation 3 let normal = Normal::new(2.0, 3.0).unwrap(); let v = normal.sample(&mut rand::thread_rng()); println!("{} is from a N(2, 9) distribution", v)
Implementations
impl<N: Float> Normal<N> where
StandardNormal: Distribution<N>,
[src]
impl<N: Float> Normal<N> where
StandardNormal: Distribution<N>,
[src]Trait Implementations
impl<N: Float> Distribution<N> for Normal<N> where
StandardNormal: Distribution<N>,
[src]
impl<N: Float> Distribution<N> for Normal<N> where
StandardNormal: Distribution<N>,
[src]impl<N: Copy> Copy for Normal<N>
[src]
Auto Trait Implementations
impl<N> RefUnwindSafe for Normal<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Normal<N> where
N: Send,
N: Send,
impl<N> Sync for Normal<N> where
N: Sync,
N: Sync,
impl<N> Unpin for Normal<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for Normal<N> where
N: UnwindSafe,
N: UnwindSafe,