Struct rand_simple::HalfNormal
source · pub struct HalfNormal { /* private fields */ }Expand description
半正規分布を計算する構造体
使用例 1 (new関数)
use rand_simple::HalfNormal;
let half_normal = HalfNormal::new(1192u32, 765u32);
let next = half_normal.sample(); // 標準偏差 1 の標準半正規分布
println!("乱数: {}", next); // 2.5308912695634582使用例 2 (マクロ・引数有り)
use rand_simple::create_half_normal;
let half_normal = create_half_normal!(1192u32, 765u32);
let next = half_normal.sample(); // 標準偏差 1 の標準半正規分布
println!("乱数: {}", next); // 2.5308912695634582使用例 3 (マクロ・引数無し)
use rand_simple::create_half_normal;
let half_normal = create_half_normal!();
let next = half_normal.sample(); // 標準偏差 1 の標準半正規分布
println!("乱数: {}", next); // 値不明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