[][src]Struct nikisas_test::error::ErrorBounds

pub struct ErrorBounds<F> { /* fields omitted */ }

Bounds for errors to be asserted. By default, all are empty and therefore not checked. By specifying a bound for given error type, you enable checking it.

Examples

use nikisas_test::error::ErrorBounds;
// Specify bounds for relative and absolute errors.
let bounds = ErrorBounds::new().rel(0.001).abs(0.0001);

Implementations

impl<F: FloatExt> ErrorBounds<F>[src]

pub fn new() -> Self[src]

Creates empty bounds, that is, none is checked.

pub fn rel(self, bound: F) -> Self[src]

Specifies the bound for maximum relative error.

pub fn abs(self, bound: F) -> Self[src]

Specifies the bound for maximum absolute error.

pub fn rms(self, bound: F) -> Self[src]

Specifies the bound for root-mean-square error.

pub fn check_rel_or_abs(&self, rel_err: F, abs_err: F) -> bool[src]

Checks if the relative and absolute errors satisfy specified bounds.

pub fn check_abs(&self, abs_error: F) -> bool[src]

Checks if the absolute error satisfies specified bound. This is mainly used when the relative error is undefined due to dividing by zero.

pub fn check_rms(&self, rms_error: F) -> bool[src]

Checks if the root-mean-square error satisfies specified bound.

Auto Trait Implementations

impl<F> RefUnwindSafe for ErrorBounds<F> where
    F: RefUnwindSafe

impl<F> Send for ErrorBounds<F> where
    F: Send

impl<F> Sync for ErrorBounds<F> where
    F: Sync

impl<F> Unpin for ErrorBounds<F> where
    F: Unpin

impl<F> UnwindSafe for ErrorBounds<F> where
    F: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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