Struct rv::dist::DiscreteUniform
source · pub struct DiscreteUniform<T: DuParam> { /* private fields */ }
Expand description
Discrete uniform distribution, U(a, b) on the interval x in [a, b]
Implementations§
source§impl<T: DuParam> DiscreteUniform<T>
impl<T: DuParam> DiscreteUniform<T>
sourcepub fn new(a: T, b: T) -> Result<Self, DiscreteUniformError>
pub fn new(a: T, b: T) -> Result<Self, DiscreteUniformError>
sourcepub fn new_unchecked(a: T, b: T) -> Self
pub fn new_unchecked(a: T, b: T) -> Self
Creates a new DiscreteUniform without checking whether the parameters are valid.
Trait Implementations§
source§impl<X, T> Cdf<X> for DiscreteUniform<T>
impl<X, T> Cdf<X> for DiscreteUniform<T>
source§impl<T: Clone + DuParam> Clone for DiscreteUniform<T>
impl<T: Clone + DuParam> Clone for DiscreteUniform<T>
source§fn clone(&self) -> DiscreteUniform<T>
fn clone(&self) -> DiscreteUniform<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + DuParam> Debug for DiscreteUniform<T>
impl<T: Debug + DuParam> Debug for DiscreteUniform<T>
source§impl<'de, T> Deserialize<'de> for DiscreteUniform<T>where
T: Deserialize<'de> + DuParam,
impl<'de, T> Deserialize<'de> for DiscreteUniform<T>where
T: Deserialize<'de> + DuParam,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<X, T> DiscreteDistr<X> for DiscreteUniform<T>
impl<X, T> DiscreteDistr<X> for DiscreteUniform<T>
source§impl<T> Display for DiscreteUniform<T>where
T: DuParam + Display,
impl<T> Display for DiscreteUniform<T>where
T: DuParam + Display,
source§impl<T> Entropy for DiscreteUniform<T>
impl<T> Entropy for DiscreteUniform<T>
source§impl<T> From<&DiscreteUniform<T>> for Stringwhere
T: DuParam + Display,
impl<T> From<&DiscreteUniform<T>> for Stringwhere
T: DuParam + Display,
source§fn from(u: &DiscreteUniform<T>) -> String
fn from(u: &DiscreteUniform<T>) -> String
Converts to this type from the input type.
source§impl<X, T> InverseCdf<X> for DiscreteUniform<T>
impl<X, T> InverseCdf<X> for DiscreteUniform<T>
source§impl<T> Mean<f64> for DiscreteUniform<T>
impl<T> Mean<f64> for DiscreteUniform<T>
source§impl<T> Median<f64> for DiscreteUniform<T>
impl<T> Median<f64> for DiscreteUniform<T>
source§impl<T: PartialEq + DuParam> PartialEq for DiscreteUniform<T>
impl<T: PartialEq + DuParam> PartialEq for DiscreteUniform<T>
source§fn eq(&self, other: &DiscreteUniform<T>) -> bool
fn eq(&self, other: &DiscreteUniform<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<X, T> Rv<X> for DiscreteUniform<T>
impl<X, T> Rv<X> for DiscreteUniform<T>
source§impl<T> Serialize for DiscreteUniform<T>where
T: Serialize + DuParam,
impl<T> Serialize for DiscreteUniform<T>where
T: Serialize + DuParam,
source§impl<X, T> Support<X> for DiscreteUniform<T>
impl<X, T> Support<X> for DiscreteUniform<T>
source§impl<T> Variance<f64> for DiscreteUniform<T>
impl<T> Variance<f64> for DiscreteUniform<T>
impl<T: Eq + DuParam> Eq for DiscreteUniform<T>
impl<T: DuParam> StructuralPartialEq for DiscreteUniform<T>
Auto Trait Implementations§
impl<T> Freeze for DiscreteUniform<T>where
T: Freeze,
impl<T> RefUnwindSafe for DiscreteUniform<T>where
T: RefUnwindSafe,
impl<T> Send for DiscreteUniform<T>where
T: Send,
impl<T> Sync for DiscreteUniform<T>where
T: Sync,
impl<T> Unpin for DiscreteUniform<T>where
T: Unpin,
impl<T> UnwindSafe for DiscreteUniform<T>where
T: 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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.