Enum rv::data::Datum

source ·
#[non_exhaustive]
pub enum Datum {
Show 17 variants F64(f64), F32(f32), Bool(bool), U8(u8), U16(u16), U32(u32), U64(u64), I8(i8), I16(i16), I32(i32), I64(i64), ISize(isize), USize(usize), Vec(Vec<f64>), DVector(DVector<f64>), DMatrix(DMatrix<f64>), Compound(Vec<Datum>),
}
Expand description

Represents any Datum/Value, X, for which Rv may be implemented on a Distribution.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

F64(f64)

§

F32(f32)

§

Bool(bool)

§

U8(u8)

§

U16(u16)

§

U32(u32)

§

U64(u64)

§

I8(i8)

§

I16(i16)

§

I32(i32)

§

I64(i64)

§

ISize(isize)

§

USize(usize)

§

Vec(Vec<f64>)

§

DVector(DVector<f64>)

§

DMatrix(DMatrix<f64>)

§

Compound(Vec<Datum>)

Trait Implementations§

source§

impl Clone for Datum

source§

fn clone(&self) -> Datum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Datum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Datum

source§

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 From<Datum> for DVector<f64>

source§

fn from(datum: Datum) -> DVector<f64>

Converts to this type from the input type.
source§

impl From<Datum> for DMatrix<f64>

source§

fn from(datum: Datum) -> DMatrix<f64>

Converts to this type from the input type.
source§

impl From<Datum> for Vec<Datum>

source§

fn from(x: Datum) -> Self

Converts to this type from the input type.
source§

impl From<Datum> for Vec<f64>

source§

fn from(datum: Datum) -> Vec<f64>

Converts to this type from the input type.
source§

impl From<Datum> for bool

source§

fn from(datum: Datum) -> bool

Converts to this type from the input type.
source§

impl From<Datum> for f32

source§

fn from(datum: Datum) -> f32

Converts to this type from the input type.
source§

impl From<Datum> for f64

source§

fn from(datum: Datum) -> f64

Converts to this type from the input type.
source§

impl From<Datum> for i16

source§

fn from(datum: Datum) -> i16

Converts to this type from the input type.
source§

impl From<Datum> for i32

source§

fn from(datum: Datum) -> i32

Converts to this type from the input type.
source§

impl From<Datum> for i64

source§

fn from(datum: Datum) -> i64

Converts to this type from the input type.
source§

impl From<Datum> for i8

source§

fn from(datum: Datum) -> i8

Converts to this type from the input type.
source§

impl From<Datum> for isize

source§

fn from(datum: Datum) -> isize

Converts to this type from the input type.
source§

impl From<Datum> for u16

source§

fn from(datum: Datum) -> u16

Converts to this type from the input type.
source§

impl From<Datum> for u32

source§

fn from(datum: Datum) -> u32

Converts to this type from the input type.
source§

impl From<Datum> for u64

source§

fn from(datum: Datum) -> u64

Converts to this type from the input type.
source§

impl From<Datum> for u8

source§

fn from(datum: Datum) -> u8

Converts to this type from the input type.
source§

impl From<Datum> for usize

source§

fn from(datum: Datum) -> usize

Converts to this type from the input type.
source§

impl From<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>> for Datum

source§

fn from(x: DVector<f64>) -> Datum

Converts to this type from the input type.
source§

impl From<Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>> for Datum

source§

fn from(x: DMatrix<f64>) -> Datum

Converts to this type from the input type.
source§

impl From<Vec<Datum>> for Datum

source§

fn from(xs: Vec<Datum>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<f64>> for Datum

source§

fn from(x: Vec<f64>) -> Datum

Converts to this type from the input type.
source§

impl From<bool> for Datum

source§

fn from(x: bool) -> Datum

Converts to this type from the input type.
source§

impl From<f32> for Datum

source§

fn from(x: f32) -> Datum

Converts to this type from the input type.
source§

impl From<f64> for Datum

source§

fn from(x: f64) -> Datum

Converts to this type from the input type.
source§

impl From<i16> for Datum

source§

fn from(x: i16) -> Datum

Converts to this type from the input type.
source§

impl From<i32> for Datum

source§

fn from(x: i32) -> Datum

Converts to this type from the input type.
source§

impl From<i64> for Datum

source§

fn from(x: i64) -> Datum

Converts to this type from the input type.
source§

impl From<i8> for Datum

source§

fn from(x: i8) -> Datum

Converts to this type from the input type.
source§

impl From<isize> for Datum

source§

fn from(x: isize) -> Datum

Converts to this type from the input type.
source§

impl From<u16> for Datum

source§

fn from(x: u16) -> Datum

Converts to this type from the input type.
source§

impl From<u32> for Datum

source§

fn from(x: u32) -> Datum

Converts to this type from the input type.
source§

impl From<u64> for Datum

source§

fn from(x: u64) -> Datum

Converts to this type from the input type.
source§

impl From<u8> for Datum

source§

fn from(x: u8) -> Datum

Converts to this type from the input type.
source§

impl From<usize> for Datum

source§

fn from(x: usize) -> Datum

Converts to this type from the input type.
source§

impl PartialEq for Datum

source§

fn eq(&self, other: &Datum) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Datum

source§

fn partial_cmp(&self, other: &Datum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Rv<Datum> for Distribution

source§

fn f(&self, x: &Datum) -> f64

Probability function Read more
source§

fn ln_f(&self, x: &Datum) -> f64

Probability function Read more
source§

fn draw<R: Rng>(&self, rng: &mut R) -> Datum

Single draw from the Rv Read more
source§

fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<Datum>

Multiple draws of the Rv Read more
source§

fn sample_stream<'r, R: Rng>( &'r self, rng: &'r mut R ) -> Box<dyn Iterator<Item = Datum> + 'r>

Create a never-ending iterator of samples Read more
source§

impl Rv<Datum> for Mixture<Vec<Distribution>>

source§

fn ln_f(&self, x: &Datum) -> f64

Probability function Read more
source§

fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<Datum>

Multiple draws of the Rv Read more
source§

fn draw<R: Rng>(&self, rng: &mut R) -> Datum

Single draw from the Rv Read more
source§

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

Probability function Read more
source§

fn sample_stream<'r, R: Rng>( &'r self, rng: &'r mut R ) -> Box<dyn Iterator<Item = X> + 'r>

Create a never-ending iterator of samples Read more
source§

impl Rv<Datum> for ProductDistribution

source§

fn ln_f(&self, x: &Datum) -> f64

Probability function Read more
source§

fn draw<R: Rng>(&self, rng: &mut R) -> Datum

Single draw from the Rv Read more
source§

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

Probability function Read more
source§

fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>

Multiple draws of the Rv Read more
source§

fn sample_stream<'r, R: Rng>( &'r self, rng: &'r mut R ) -> Box<dyn Iterator<Item = X> + 'r>

Create a never-ending iterator of samples Read more
source§

impl Serialize for Datum

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Datum

Auto Trait Implementations§

§

impl Freeze for Datum

§

impl RefUnwindSafe for Datum

§

impl Send for Datum

§

impl Sync for Datum

§

impl Unpin for Datum

§

impl UnwindSafe for Datum

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Fx> Rv<Datum> for Fx
where Fx: RvDatum,

source§

fn ln_f(&self, x: &Datum) -> f64

Probability function Read more
source§

fn draw<R>(&self, rng: &mut R) -> Datum
where R: Rng,

Single draw from the Rv Read more
source§

fn sample<R>(&self, n: usize, rng: &mut R) -> Vec<Datum>
where R: Rng,

Multiple draws of the Rv Read more
source§

fn sample_stream<'r, R>( &'r self, rng: &'r mut R ) -> Box<dyn Iterator<Item = Datum> + 'r>
where R: Rng,

Create a never-ending iterator of samples Read more
source§

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

Probability function Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> DeserializeOwnedAlias for T

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

source§

impl<T> SendAlias for T

source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,

source§

impl<T> SerializeAlias for T
where T: Serialize,

source§

impl<T> SyncAlias for T