[][src]Struct rand::distributions::Cauchy

pub struct Cauchy { /* fields omitted */ }

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::distributions::{Cauchy, Distribution};

let cau = Cauchy::new(2.0, 5.0);
let v = cau.sample(&mut rand::thread_rng());
println!("{} is from a Cauchy(2, 5) distribution", v);

Methods

impl Cauchy
[src]

pub fn new(median: f64, scale: f64) -> Cauchy
[src]

Construct a new Cauchy with the given shape parameters median the peak location and scale the scale factor. Panics if scale <= 0.

Trait Implementations

impl Distribution<f64> for Cauchy
[src]

Important traits for DistIter<'a, D, R, T>
fn sample_iter<'a, R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
    Self: Sized,
    R: Rng
[src]

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl Copy for Cauchy
[src]

impl Clone for Cauchy
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Cauchy
[src]

Auto Trait Implementations

impl Send for Cauchy

impl Sync for Cauchy

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]