Trait approx::RelativeEq

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

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

Required Methods§

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.

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

Provided Methods§

The inverse of RelativeEq::relative_eq.

Implementations on Foreign Types§

Implementors§

impl<T, R: Dim, C: Dim, S> RelativeEq<Matrix<T, R, C, S>> for Matrix<T, R, C, S>where
    T: Scalar + RelativeEq,
    S: Storage<T, R, C>,
    T::Epsilon: Copy,

impl<T, R: Dim, C: Dim, S> RelativeEq<Unit<Matrix<T, R, C, S>>> for Unit<Matrix<T, R, C, S>>where
    T: Scalar + RelativeEq,
    S: Storage<T, R, C>,
    T::Epsilon: Copy,

impl<T: Scalar + RelativeEq, const D: usize> RelativeEq<Point<T, D>> for Point<T, D>where
    T::Epsilon: Copy,

impl<T, const D: usize> RelativeEq<Rotation<T, D>> for Rotation<T, D>where
    T: Scalar + RelativeEq,
    T::Epsilon: Copy,

impl<T: RealField + RelativeEq<Epsilon = T>> RelativeEq<Quaternion<T>> for Quaternion<T>

impl<T: RealField + RelativeEq<Epsilon = T>> RelativeEq<Unit<Quaternion<T>>> for UnitQuaternion<T>

impl<T: RealField + RelativeEq<Epsilon = T>> RelativeEq<DualQuaternion<T>> for DualQuaternion<T>

impl<T: Scalar + RelativeEq, const D: usize> RelativeEq<Translation<T, D>> for Translation<T, D>where
    T::Epsilon: Copy,

impl<T: RealField, R, const D: usize> RelativeEq<Isometry<T, R, D>> for Isometry<T, R, D>where
    R: AbstractRotation<T, D> + RelativeEq<Epsilon = T::Epsilon>,
    T::Epsilon: Copy,

impl<T: RealField, R, const D: usize> RelativeEq<Similarity<T, R, D>> for Similarity<T, R, D>where
    R: AbstractRotation<T, D> + RelativeEq<Epsilon = T::Epsilon>,
    T::Epsilon: Copy,

impl<T: RealField, C: TCategory, const D: usize> RelativeEq<Transform<T, C, D>> for Transform<T, C, D>where
    Const<D>: DimNameAdd<U1>,
    T::Epsilon: Copy,
    DefaultAllocator: Allocator<T, DimNameSum<Const<D>, U1>, DimNameSum<Const<D>, U1>>,