Struct rand_distr::Normal [−][src]
pub struct Normal<F> where
F: Float,
StandardNormal: Distribution<F>, { /* 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<F> Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]
impl<F> Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]Trait Implementations
impl<F: Clone> Clone for Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]
impl<F: Clone> Clone for Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]impl<F: Debug> Debug for Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]
impl<F: Debug> Debug for Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]impl<F> Distribution<F> for Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]
impl<F> Distribution<F> for Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]impl<F: Copy> Copy for Normal<F> where
F: Float,
StandardNormal: Distribution<F>,
[src]
F: Float,
StandardNormal: Distribution<F>,
Auto Trait Implementations
impl<F> RefUnwindSafe for Normal<F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<F> Send for Normal<F> where
F: Send,
F: Send,
impl<F> Sync for Normal<F> where
F: Sync,
F: Sync,
impl<F> Unpin for Normal<F> where
F: Unpin,
F: Unpin,
impl<F> UnwindSafe for Normal<F> where
F: UnwindSafe,
F: UnwindSafe,