[][src]Trait uncertainty::Uncertainty

pub trait Uncertainty: Sized + Copy {
    fn to_ab(self) -> AbUnc;
fn to_rel(self) -> RelUnc;
fn val(&self) -> f64;
fn unc(&self) -> f64; fn min(&self) -> f64 { ... }
fn max(&self) -> f64 { ... }
fn overlap<T: Uncertainty>(&self, other: &T) -> bool { ... } }

Used to define behaviour for values which have uncertain values.

Required methods

fn to_ab(self) -> AbUnc

Convert any uncertainty value into one which has an absolute uncertain value.

fn to_rel(self) -> RelUnc

Convert any uncertainty value into one which has a relative uncertain value.

fn val(&self) -> f64

Get the base value of the uncertainty.

fn unc(&self) -> f64

Get the uncertainty value; this will depend on whether the base type is a relative or absolute uncertainty.

Loading content...

Provided methods

fn min(&self) -> f64

Return the minimum possible value of the uncertainty. This is functionally the base value - the uncertainty value.

fn max(&self) -> f64

Return the maximum possible value of the uncertainty. This is functionally the base value + the uncertainty value.

fn overlap<T: Uncertainty>(&self, other: &T) -> bool

Given two uncertainty values, determine whether they overlap. This is done by comparing the minimums and maximums to see whether they intersect. Intersecting uncertainties are said to be equal or overlap.

Loading content...

Implementors

impl Uncertainty for AbUnc[src]

impl Uncertainty for RelUnc[src]

Loading content...