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