[][src]Struct rv::dist::DiscreteUniform

pub struct DiscreteUniform<T: Integer> {
    pub a: T,
    pub b: T,
}

Discrete uniform distribution, U(a, b) on the interval x in [a, b]

Fields

a: Tb: T

Methods

impl<T: Integer> DiscreteUniform<T>[src]

pub fn new(a: T, b: T) -> Result<Self>[src]

Trait Implementations

impl<X, T> Rv<X> for DiscreteUniform<T> where
    T: Integer + SampleUniform + Copy,
    X: Integer + From<T>, 
[src]

fn f(&self, x: &X) -> f64[src]

Probability function Read more

impl<X, T> Support<X> for DiscreteUniform<T> where
    X: Integer + From<T>,
    T: Integer + Copy
[src]

impl<X, T> Cdf<X> for DiscreteUniform<T> where
    X: Integer + From<T> + ToPrimitive + Copy,
    T: Integer + SampleUniform + ToPrimitive + Copy
[src]

fn sf(&self, x: &X) -> f64[src]

Survival function, 1 - CDF(x)

impl<X, T> InverseCdf<X> for DiscreteUniform<T> where
    X: Integer + From<T> + FromPrimitive,
    T: Integer + SampleUniform + ToPrimitive + Copy
[src]

fn quantile(&self, p: f64) -> X[src]

Alias for invcdf

fn interval(&self, p: f64) -> (X, X)[src]

Interval containing p proportion for the probability Read more

impl<X, T> DiscreteDistr<X> for DiscreteUniform<T> where
    X: Integer + From<T>,
    T: Integer + SampleUniform + Into<f64> + Copy
[src]

fn pmf(&self, x: &X) -> f64[src]

Probability mass function (PMF) at x Read more

fn ln_pmf(&self, x: &X) -> f64[src]

Natural logarithm of the probability mass function (PMF) Read more

impl<T> Mean<f64> for DiscreteUniform<T> where
    T: Integer + SampleUniform + Into<f64> + Copy
[src]

impl<T> Median<f64> for DiscreteUniform<T> where
    T: Integer + SampleUniform + Into<f64> + Copy
[src]

impl<T> Variance<f64> for DiscreteUniform<T> where
    T: Integer + SampleUniform + Into<f64> + Copy
[src]

impl<T> Entropy for DiscreteUniform<T> where
    T: Integer + Into<f64> + Copy
[src]

impl<T: Integer> Skewness for DiscreteUniform<T>[src]

impl<T: Integer> Kurtosis for DiscreteUniform<T>[src]

impl<T: PartialOrd + Integer> PartialOrd<DiscreteUniform<T>> for DiscreteUniform<T>[src]

impl<T, '_> From<&'_ DiscreteUniform<T>> for String where
    T: Integer + Display
[src]

impl<T: PartialEq + Integer> PartialEq<DiscreteUniform<T>> for DiscreteUniform<T>[src]

impl<T: Clone + Integer> Clone for DiscreteUniform<T>[src]

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

Performs copy-assignment from source. Read more

impl<T: Ord + Integer> Ord for DiscreteUniform<T>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

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

Restrict a value to a certain interval. Read more

impl<T: Eq + Integer> Eq for DiscreteUniform<T>[src]

impl<T> Display for DiscreteUniform<T> where
    T: Integer + Display
[src]

impl<T: Debug + Integer> Debug for DiscreteUniform<T>[src]

impl<T: Hash + Integer> Hash for DiscreteUniform<T>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<T> Send for DiscreteUniform<T> where
    T: Send

impl<T> Sync for DiscreteUniform<T> where
    T: Sync

Blanket Implementations

impl<T> ApiReady for T where
    T: Clone + Debug + PartialOrd<T> + PartialEq<T>, 
[src]

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>,