Struct rand_simple::LogNormal
source · pub struct LogNormal { /* private fields */ }Expand description
使用例
let log_normal = rand_simple::LogNormal::new(1192u32, 765u32);
// 初期設定の場合、平均値 0, 標準偏差 1 の標準対数正規分布に従う乱数を返す
assert_eq!(log_normal.sample(), 1.1216353517595588f64);
// 確率変数のパラメータを変更する場合
let mean: f64 = -3f64;
let variance: f64 = 2f64;
let result: Result<(f64, f64), &str> = log_normal.try_set_params(mean, variance);
assert_eq!(log_normal.sample(), 1.1216353890566597f64);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