Struct rand_simple::Exponential
source · pub struct Exponential { /* private fields */ }Expand description
指数分布を計算する構造体
使用例
let exponential = rand_simple::Exponential::new(1192u32);
// 初期設定の場合、尺度母数 θ = 1の標準指数分布に従う乱数を返す
assert_eq!(exponential.sample(), 1.9053655174552453f64);
// 確率変数のパラメータを変更する場合
let scale: f64 = 1.5f64;
let result: Result<f64, &str> = exponential.try_set_params(scale);
assert_eq!(exponential.sample(), 0.187586182253475f64);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Exponential
impl Send for Exponential
impl !Sync for Exponential
impl Unpin for Exponential
impl UnwindSafe for Exponential
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