Struct rand_simple::Cauchy
source · pub struct Cauchy { /* private fields */ }Expand description
コーシー分布
使用例
let mut cauchy = rand_simple::Cauchy::new(1192u32, 765u32);
println!("位置母数 μ = 0, 尺度母数 θ = 1 の標準コーシー分布に従う乱数を生成する -> {}", cauchy.sample());
// 確率変数のパラメータを変更する場合
let location: f64 = -2f64;
let scale: f64 = 1.5f64;
let result: Result<(f64, f64), &str> = cauchy.try_set_params(location, scale);
println!("位置母数 μ = {}, 尺度母数 θ = {} のコーシー分布に従う乱数を生成する -> {}", location, scale, cauchy.sample());Implementations§
Trait 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