Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::SoftZero< RealType > Class Template Reference

Functor for floating point equality. More...

#include <SoftEqual.hh>

Public Types

Type aliases
using argument_type = RealType
 
using value_type = RealType
 

Public Member Functions

CELER_CONSTEXPR_FUNCTION SoftZero ()
 Construct with default relative/absolute precision.
 
CELER_FUNCTION SoftZero (value_type abs)
 Construct with specified precision. More...
 
CELER_FUNCTION bool operator() (value_type actual) const
 See if the value is within absolute tolerance of zero. More...
 
CELER_CONSTEXPR_FUNCTION value_type abs () const
 Absolute tolerance.
 

Detailed Description

template<class RealType = ::celeritas::real_type>
class celeritas::SoftZero< RealType >

Functor for floating point equality.

Constructor & Destructor Documentation

◆ SoftZero()

template<class RealType >
CELER_FUNCTION celeritas::SoftZero< RealType >::SoftZero ( value_type  abs)
explicit

Construct with specified precision.

Parameters
absthreshold for absolute error (default 1.0e-14 for doubles)

Member Function Documentation

◆ operator()()

template<class RealType >
CELER_FUNCTION bool celeritas::SoftZero< RealType >::operator() ( value_type  actual) const
inline

See if the value is within absolute tolerance of zero.

Parameters
actualscalar floating point value

The documentation for this class was generated from the following file: