Struct rand_simple::Chi
source · pub struct Chi { /* private fields */ }Expand description
χ分布
使用例
let mut chi = rand_simple::Chi::new([1192_u32, 765_u32, 1543_u32, 2003_u32]);
println!("初期設定の場合、自由度 1のχ二乗分布に従う乱数を返す -> {}", chi.sample());
// 確率変数のパラメータを変更する場合
let degree_of_freedom: u64 = 2_u64;
let result: Result<u64, &str> = chi.try_set_params(degree_of_freedom);
println!("自由度 {}の乱数を生成する -> {}", degree_of_freedom, chi.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Chi
impl Send for Chi
impl Sync for Chi
impl Unpin for Chi
impl UnwindSafe for Chi
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