pub enum AxisMeasure {
Uniform,
Named {
name: MeasureName,
params: Vec<f64>,
},
}Expand description
The measure of one continuous axis, with its parameters resolved
(see MeasureName::parameter_names).
Variants§
Uniform
Lebesgue measure scaled to the interval.
Named
A named distribution with its parameters.
Fields
name: MeasureNameThe distribution.
params: Vec<f64>Its parameters, in the order of MeasureName::parameter_names.
Implementations§
Source§impl AxisMeasure
impl AxisMeasure
Sourcepub fn from_product(
measure: &ProductMeasure,
axis: usize,
) -> Result<Self, String>
pub fn from_product( measure: &ProductMeasure, axis: usize, ) -> Result<Self, String>
The measure of the axis-th continuous axis of measure: a
Product is indexed, Uniform and Named apply to every
axis. Named measures here carry no parameters, so they take
the standard ones; a Source::Distribution supplies its
own through AxisMeasure::named.
Sourcepub fn named(name: MeasureName, params: &[f64]) -> Result<Self, String>
pub fn named(name: MeasureName, params: &[f64]) -> Result<Self, String>
A named measure with params resolved against the measure’s
parameter table.
Sourcepub fn cdf(&self, x: f64) -> Option<f64>
pub fn cdf(&self, x: f64) -> Option<f64>
The CDF of a named measure at x; None for Uniform,
whose CDF depends on the interval.
Sourcepub fn quantile(&self, p: f64) -> Option<f64>
pub fn quantile(&self, p: f64) -> Option<f64>
The quantile of a named measure at p ∈ [0, 1]; None for
Uniform.
Sourcepub fn map_unit(&self, u: f64, interval: &Interval) -> f64
pub fn map_unit(&self, u: f64, interval: &Interval) -> f64
Carry a unit point u ∈ [0, 1) onto interval under this
measure. Uniform is affine; a named measure inverts its CDF
between the CDF values of the interval’s ends. The result
lies in the interval, and an open end is never returned: a
point that lands on it moves to the next float inside.
Trait Implementations§
Source§impl Clone for AxisMeasure
impl Clone for AxisMeasure
Source§impl Debug for AxisMeasure
impl Debug for AxisMeasure
Source§impl PartialEq for AxisMeasure
impl PartialEq for AxisMeasure
impl StructuralPartialEq for AxisMeasure
Auto Trait Implementations§
impl Freeze for AxisMeasure
impl RefUnwindSafe for AxisMeasure
impl Send for AxisMeasure
impl Sync for AxisMeasure
impl Unpin for AxisMeasure
impl UnsafeUnpin for AxisMeasure
impl UnwindSafe for AxisMeasure
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more