Celeritas  0.5.0-86+4a8eea4
Classes | Functions
SoftEqual.hh File Reference
#include <cmath>
#include "corecel/Assert.hh"
#include "corecel/Macros.hh"
#include "corecel/Types.hh"
#include "detail/SoftEqualTraits.hh"
This graph shows which files directly or indirectly include this file:

Classes

class  celeritas::SoftEqual< RealType >
 Functor for noninfinite floating point equality. More...
 
class  celeritas::EqualOr< F >
 Compare for equality before checking with the given functor. More...
 
class  celeritas::SoftZero< RealType >
 Functor for floating point equality. More...
 

Functions

CELER_CONSTEXPR_FUNCTION real_type celeritas::sqrt_tol ()
 Square root of the soft equivalence tolerance for Celeritas. More...
 
template<class T >
CELER_FUNCTION celeritas::SoftEqual (T) -> SoftEqual< T >
 
template<class T >
CELER_FUNCTION celeritas::SoftEqual (T, T) -> SoftEqual< T >
 
template<class F >
CELER_FUNCTION celeritas::EqualOr (F &&) -> EqualOr< F >
 
template<class RealType >
CELER_FUNCTION bool celeritas::soft_equal (RealType expected, RealType actual)
 Soft equivalence with default tolerance.
 
template<class RealType >
CELER_FUNCTION bool celeritas::soft_near (RealType expected, RealType actual, RealType rel_error)
 Soft equivalence with relative error.
 
template<class RealType >
CELER_FUNCTION bool celeritas::soft_zero (RealType actual)
 Soft equivalence to zero, with default tolerance.
 
template<class RealType >
CELER_FUNCTION bool celeritas::soft_mod (RealType dividend, RealType divisor)
 Soft modulo operator.
 

Function Documentation

◆ sqrt_tol()

CELER_CONSTEXPR_FUNCTION real_type celeritas::sqrt_tol ( )

Square root of the soft equivalence tolerance for Celeritas.

This tolerance is needed for operations where the accuracy is limited by the square root of machine precision.

Todo:
Move orange tolerance and related operations into corecel/math alongside this, revisit ArrayUtils soft comparisons.