Trait sprs::approx::RelativeEq[][src]

pub trait RelativeEq<Rhs = Self>: AbsDiffEq<Rhs> where
    Rhs: ?Sized
{ pub fn default_max_relative() -> Self::Epsilon;
pub fn relative_eq(
        &self,
        other: &Rhs,
        epsilon: Self::Epsilon,
        max_relative: Self::Epsilon
    ) -> bool; pub fn relative_ne(
        &self,
        other: &Rhs,
        epsilon: Self::Epsilon,
        max_relative: Self::Epsilon
    ) -> bool { ... } }

Equality comparisons between two numbers using both the absolute difference and relative based comparisons.

Required methods

pub fn default_max_relative() -> Self::Epsilon[src]

The default relative tolerance for testing values that are far-apart.

This is used when no max_relative value is supplied to the relative_eq macro.

pub fn relative_eq(
    &self,
    other: &Rhs,
    epsilon: Self::Epsilon,
    max_relative: Self::Epsilon
) -> bool
[src]

A test for equality that uses a relative comparison if the values are far apart.

Loading content...

Provided methods

pub fn relative_ne(
    &self,
    other: &Rhs,
    epsilon: Self::Epsilon,
    max_relative: Self::Epsilon
) -> bool
[src]

The inverse of ApproxEq::relative_eq.

Loading content...

Implementations on Foreign Types

impl<T> RelativeEq<RefCell<T>> for RefCell<T> where
    T: RelativeEq<T> + ?Sized
[src]

impl RelativeEq<f32> for f32[src]

impl<'a, T> RelativeEq<&'a T> for &'a T where
    T: RelativeEq<T> + ?Sized
[src]

impl<T> RelativeEq<Cell<T>> for Cell<T> where
    T: RelativeEq<T> + Copy
[src]

impl<A, B> RelativeEq<[B]> for [A] where
    A: RelativeEq<B>,
    <A as AbsDiffEq<B>>::Epsilon: Clone
[src]

impl<'a, T> RelativeEq<&'a mut T> for &'a mut T where
    T: RelativeEq<T> + ?Sized
[src]

impl RelativeEq<f64> for f64[src]

impl<O> RelativeEq<Id<O>> for Id<O> where
    O: Operator
[src]

Loading content...

Implementors

impl<N, I, IS1, DS1, IS2, DS2> RelativeEq<CsVecBase<IS2, DS2, N, I>> for CsVecBase<IS1, DS1, N, I> where
    I: SpIndex,
    CsVecBase<IS1, DS1, N, I>: PartialEq<CsVecBase<IS2, DS2, N, I>>,
    IS1: Deref<Target = [I]>,
    IS2: Deref<Target = [I]>,
    DS1: Deref<Target = [N]>,
    DS2: Deref<Target = [N]>,
    N: RelativeEq,
    N::Epsilon: Clone,
    N: Zero
[src]

impl<N, I, Iptr, IS1, DS1, ISptr1, IS2, ISptr2, DS2> RelativeEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>> for CsMatBase<N, I, ISptr1, IS1, DS1, Iptr> where
    I: SpIndex,
    Iptr: SpIndex,
    CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>: PartialEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>>,
    IS1: Deref<Target = [I]>,
    IS2: Deref<Target = [I]>,
    ISptr1: Deref<Target = [Iptr]>,
    ISptr2: Deref<Target = [Iptr]>,
    DS1: Deref<Target = [N]>,
    DS2: Deref<Target = [N]>,
    N: RelativeEq,
    N::Epsilon: Clone,
    N: Zero
[src]

Loading content...