pub trait Uncertainty:
Sized
+ Copy
+ Into<AbsUncertainty<Self::Float>>
+ Into<RelUncertainty<Self::Float>>
+ Add<Self, Output = Self>
+ Div<Self, Output = Self>
+ Mul<Self, Output = Self>
+ Sub<Self, Output = Self>
+ Zero {
type Float: Float + Zero;
// Required methods
fn new(value: Self::Float, uncertainty: Self::Float) -> Self;
fn mean(&self) -> Self::Float;
fn standard_deviation(&self) -> Self::Float;
fn coefficient_of_variation(&self) -> Self::Float;
fn uncertainty(&self) -> Self::Float;
// Provided methods
fn is_certain(&self) -> bool { ... }
fn powi(&self, n: i32) -> Self { ... }
}Expand description
Used to define behaviour for values which have associated uncertainty.
Required Associated Types§
Required Methods§
fn new(value: Self::Float, uncertainty: Self::Float) -> Self
Sourcefn standard_deviation(&self) -> Self::Float
fn standard_deviation(&self) -> Self::Float
The standard deviation of the value
Sourcefn coefficient_of_variation(&self) -> Self::Float
fn coefficient_of_variation(&self) -> Self::Float
The coefficient of variation is the ratio of the standard deviation and the mean.
It describes the relative error.
Sourcefn uncertainty(&self) -> Self::Float
fn uncertainty(&self) -> Self::Float
The actual uncertainty of the concrete type. This will depend on whether the implementor represent a relative or absolute uncertainty.
Provided Methods§
Sourcefn is_certain(&self) -> bool
fn is_certain(&self) -> bool
Returns true if the uncertainty is zero.
This method is useful when the type may be used in a method which divides by the uncertainties.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.