Trait rv::traits::Support[][src]

pub trait Support<X> {
    fn contains(&self, x: &X) -> bool;
}

Identifies the support of the Rv

Required Methods

Returns true if x is in the support of the Rv

Example

use rv::dist::Uniform;
use rv::traits::Support;

// Create uniform with support on the interval [0, 1]
let u = Uniform::new(0.0, 1.0).unwrap();

assert!(u.contains(&0.5_f64));
assert!(!u.contains(&-0.1_f64));
assert!(!u.contains(&1.1_f64));

Implementors