Struct rand_simple::Cauchy
source · pub struct Cauchy { /* private fields */ }Expand description
コーシー分布を計算する構造体
使用例 1 (new関数)
use rand_simple::Cauchy;
let cauchy = Cauchy::new(1192u32, 765u32);
let next = cauchy.sample(); // 位置母数 μ = 0, 尺度母数 θ = 1の標準コーシー分布
println!("乱数: {}", next); // 1.0046339315561652f64使用例 2 (マクロ・引数有り)
use rand_simple::create_cauchy;
let cauchy = create_cauchy!(1192u32, 765u32);
let next = cauchy.sample(); // 位置母数 μ = 0, 尺度母数 θ = 1の標準コーシー分布
println!("乱数: {}", next); // 1.0046339315561652f64使用例 3 (マクロ・引数無し)
use rand_simple::create_cauchy;
let cauchy = create_cauchy!();
let next = cauchy.sample(); // 位置母数 μ = 0, 尺度母数 θ = 1の標準コーシー分布
println!("乱数: {}", next); // 値不明Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Cauchy
impl Send for Cauchy
impl !Sync for Cauchy
impl Unpin for Cauchy
impl UnwindSafe for Cauchy
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