Skip to main content

MarsagliaPolarGaussian

Trait MarsagliaPolarGaussian 

Source
pub trait MarsagliaPolarGaussian: Random {
    // Required methods
    fn stored_next_gaussian(&self) -> Option<f64>;
    fn set_stored_next_gaussian(&mut self, value: Option<f64>);

    // Provided method
    fn calculate_gaussian(&mut self) -> f64 { ... }
}
Expand description

A trait for generating gaussian random numbers using the Marsaglia polar method.

Required Methods§

Source

fn stored_next_gaussian(&self) -> Option<f64>

Gets the stored next gaussian.

Source

fn set_stored_next_gaussian(&mut self, value: Option<f64>)

Sets the stored next gaussian.

Provided Methods§

Source

fn calculate_gaussian(&mut self) -> f64

Calculates the next gaussian.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§