Struct rand_simple::LogNormal
source · pub struct LogNormal { /* private fields */ }Expand description
Log Normal Distribution
Example
let mut log_normal = rand_simple::LogNormal::new([1192_u32, 765_u32]);
assert_eq!(format!("{log_normal}"), "LN(Mean, Std^2) = LN(0, 1^2)");
println!("Returns a random number -> {}", log_normal.sample());
// If you want to change the parameters of the random variable
let mean: f64 = -3_f64;
let variance: f64 = 2_f64;
let result: Result<(f64, f64), &str> = log_normal.try_set_params(mean, variance);
assert_eq!(format!("{log_normal}"), "LN(Mean, Std^2) = LN(-3, 2^2)");
println!("Returns a random number -> {}", log_normal.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for LogNormal
impl Send for LogNormal
impl Sync for LogNormal
impl Unpin for LogNormal
impl UnwindSafe for LogNormal
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