pub struct Cauchy<F>{ /* private fields */ }
Expand description
The Cauchy distribution Cauchy(median, scale)
.
This distribution has a density function:
f(x) = 1 / (pi * scale * (1 + ((x - median) / scale)^2))
Note that at least for f32
, results are not fully portable due to minor
differences in the target system’s tan implementation, tanf
.
§Example
use rand_distr::{Cauchy, Distribution};
let cau = Cauchy::new(2.0, 5.0).unwrap();
let v = cau.sample(&mut rand::thread_rng());
println!("{} is from a Cauchy(2, 5) distribution", v);
Implementations§
Trait Implementations§
Source§impl<F> Distribution<F> for Cauchy<F>
impl<F> Distribution<F> for Cauchy<F>
impl<F> Copy for Cauchy<F>
Auto Trait Implementations§
impl<F> Freeze for Cauchy<F>where
F: Freeze,
impl<F> RefUnwindSafe for Cauchy<F>where
F: RefUnwindSafe,
impl<F> Send for Cauchy<F>where
F: Send,
impl<F> Sync for Cauchy<F>where
F: Sync,
impl<F> Unpin for Cauchy<F>where
F: Unpin,
impl<F> UnwindSafe for Cauchy<F>where
F: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.