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