Struct rand_simple::Geometric
source · pub struct Geometric { /* private fields */ }Expand description
幾何分布
使用例
let mut geometric = rand_simple::Geometric::new(1192u32);
println!("発生確率 θ = 0.5 の事象が生じるまでの試行回数 -> {}", geometric.sample());
// 確率変数のパラメータを変更する場合
let probability: f64 = 0.8f64;
let result: Result<f64, &str> = geometric.try_set_params(probability);
println!("発生確率 θ = {} の事象が生じるまでの試行回数 -> {}", probability, geometric.sample());Implementations§
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Geometric
impl Send for Geometric
impl Sync for Geometric
impl Unpin for Geometric
impl UnwindSafe for Geometric
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