Struct rand_simple::Laplace
source · pub struct Laplace { /* private fields */ }Expand description
ラプラス分布を計算する構造体
使用例 1 (new関数)
use rand_simple::Laplace;
let laplace = Laplace::new(1192u32);
let next = laplace.sample(); // 位置母数 μ = 0, 尺度母数 θ = 1の標準ラプラス分布
println!("乱数: {}", next); // -0.7214398300954756f64使用例 2 (マクロ・引数有り)
use rand_simple::create_laplace;
let laplace = create_laplace!(1192u32);
let next = laplace.sample(); // 位置母数 μ = 0, 尺度母数 θ = 1の標準ラプラス分布
println!("乱数: {}", next); // -0.7214398300954756f64使用例 3 (マクロ・引数無し)
use rand_simple::create_laplace;
let laplace = create_laplace!();
let next = laplace.sample(); // 位置母数 μ = 0, 尺度母数 θ = 1の標準ラプラス分布
println!("乱数: {}", next); // 値不明Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Laplace
impl Send for Laplace
impl !Sync for Laplace
impl Unpin for Laplace
impl UnwindSafe for Laplace
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