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

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]

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 Clone for Cauchy
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Cauchy
[src]

impl Debug for Cauchy
[src]

Formats the value using the given formatter. Read more

impl Distribution<f64> for Cauchy
[src]

Generate a random value of T, using rng as the source of randomness.

Important traits for DistIter<'a, D, R, T>

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

Auto Trait Implementations

impl Send for Cauchy

impl Sync for Cauchy