Struct lattice_qcd_rs::statistics::distribution::ModifiedNormal
source · pub struct ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd,
OpenClosed01: Distribution<T>,{ /* private fields */ }
Expand description
Distribution given by x^2 e^{- 2 a x^2}
, x >= 0
where x
is the random variable and a
a parameter of the distribution.
Example
use lattice_qcd_rs::error::ImplementationError;
use lattice_qcd_rs::statistics::ModifiedNormal;
use rand::{Rng, SeedableRng};
let mut rng = rand::rngs::StdRng::seed_from_u64(0);
let mn = ModifiedNormal::new(0.5_f64).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let r_number = rng.sample(&mn);
Implementations§
source§impl<T> ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + PartialOrd,
OpenClosed01: Distribution<T>,
impl<T> ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + PartialOrd, OpenClosed01: Distribution<T>,
Trait Implementations§
source§impl<T> Clone for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Clone,
OpenClosed01: Distribution<T>,
impl<T> Clone for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Clone, OpenClosed01: Distribution<T>,
source§fn clone(&self) -> ModifiedNormal<T>
fn clone(&self) -> ModifiedNormal<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 for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Debug,
OpenClosed01: Distribution<T>,
impl<T> Debug for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Debug, OpenClosed01: Distribution<T>,
source§impl<'de, T> Deserialize<'de> for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Deserialize<'de>,
OpenClosed01: Distribution<T>,
impl<'de, T> Deserialize<'de> for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Deserialize<'de>, OpenClosed01: Distribution<T>,
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<T> Display for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Display,
OpenClosed01: Distribution<T>,
impl<T> Display for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Display, OpenClosed01: Distribution<T>,
source§impl<T> Distribution<T> for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + SampleUniform + PartialOrd,
OpenClosed01: Distribution<T>,
impl<T> Distribution<T> for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + SampleUniform + PartialOrd, OpenClosed01: Distribution<T>,
source§fn sample<R>(&self, rng: &mut R) -> Twhere
R: Rng + ?Sized,
fn sample<R>(&self, rng: &mut R) -> Twhere R: Rng + ?Sized,
Generate a random value of
T
, using rng
as the source of randomness.source§impl<T> Hash for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Hash,
OpenClosed01: Distribution<T>,
impl<T> Hash for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Hash, OpenClosed01: Distribution<T>,
source§impl<T> PartialEq<ModifiedNormal<T>> for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + PartialEq,
OpenClosed01: Distribution<T>,
impl<T> PartialEq<ModifiedNormal<T>> for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + PartialEq, OpenClosed01: Distribution<T>,
source§fn eq(&self, other: &ModifiedNormal<T>) -> bool
fn eq(&self, other: &ModifiedNormal<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T> Serialize for ModifiedNormal<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Serialize,
OpenClosed01: Distribution<T>,
impl<T> Serialize for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Serialize, OpenClosed01: Distribution<T>,
impl<T> Copy for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Copy, OpenClosed01: Distribution<T>,
impl<T> Eq for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd + Eq, OpenClosed01: Distribution<T>,
impl<T> StructuralEq for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd, OpenClosed01: Distribution<T>,
impl<T> StructuralPartialEq for ModifiedNormal<T>where T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Neg<Output = T> + Float + FloatConst + PartialOrd, OpenClosed01: Distribution<T>,
Auto Trait Implementations§
impl<T> RefUnwindSafe for ModifiedNormal<T>where T: RefUnwindSafe,
impl<T> Send for ModifiedNormal<T>where T: Send,
impl<T> Sync for ModifiedNormal<T>where T: Sync,
impl<T> Unpin for ModifiedNormal<T>where T: Unpin,
impl<T> UnwindSafe for ModifiedNormal<T>where T: UnwindSafe,
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.