pub struct Cauchy<N> { /* 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))
§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<N: Float> Distribution<N> for Cauchy<N>where
Standard: Distribution<N>,
impl<N: Float> Distribution<N> for Cauchy<N>where
Standard: Distribution<N>,
impl<N: Copy> Copy for Cauchy<N>
Auto Trait Implementations§
impl<N> Freeze for Cauchy<N>where
N: Freeze,
impl<N> RefUnwindSafe for Cauchy<N>where
N: RefUnwindSafe,
impl<N> Send for Cauchy<N>where
N: Send,
impl<N> Sync for Cauchy<N>where
N: Sync,
impl<N> Unpin for Cauchy<N>where
N: Unpin,
impl<N> UnwindSafe for Cauchy<N>where
N: 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