Struct rand_simple::Normal
source · pub struct Normal { /* private fields */ }Expand description
正規分布
使用例
let mut normal = rand_simple::Normal::new([1192_u32, 765_u32]);
println!("平均値 μ = 0, 分散 σ^2 = 1 の標準正規分布乱数を生成する -> {}", normal.sample());
// 確率変数のパラメータを変更する場合
let mean: f64 = -3_f64;
let variance: f64 = 2_f64;
let result: Result<(f64, f64), &str> = normal.try_set_params(mean, variance);
println!("平均値 μ = {}, 分散 σ^2 = {} の正規分布乱数を生成する -> {}", mean, variance, normal.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Normal
impl Send for Normal
impl Sync for Normal
impl Unpin for Normal
impl UnwindSafe for Normal
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