Hermes
hermes::Check Struct Reference

Number checks. More...

Static Public Member Functions

template<typename T >
static constexpr HERMES_DEVICE_CALLABLE bool is_zero (T a)
 Checks if number is 0. More...
 
template<typename T >
static constexpr HERMES_DEVICE_CALLABLE bool is_equal (T a, T b)
 Checks if two numbers are at most 1e-8 apart. More...
 
template<typename T >
static constexpr HERMES_DEVICE_CALLABLE bool is_equal (T a, T b, T e)
 Checks if two numbers are at most to a threshold apart. More...
 
template<typename T >
static constexpr bool is_between (T x, T a, T b)
 Checks if a number is in a open interval. More...
 
template<typename T >
static constexpr bool is_between_closed (T x, T a, T b)
 Checks if a number is in a closed interval. More...
 
template<typename T >
static HERMES_DEVICE_CALLABLE std::enable_if_t< std::is_floating_point< T >::value, bool > is_nan (T v)
 Checks if number representation is nan More...
 

Detailed Description

Number checks.

Member Function Documentation

◆ is_between()

template<typename T >
static constexpr bool hermes::Check::is_between ( x,
a,
b 
)
inlinestaticconstexpr

Checks if a number is in a open interval.

Template Parameters
T
Parameters
x[in]
a[in]
b[in]
Returns
constexpr bool

◆ is_between_closed()

template<typename T >
static constexpr bool hermes::Check::is_between_closed ( x,
a,
b 
)
inlinestaticconstexpr

Checks if a number is in a closed interval.

Template Parameters
T
Parameters
x[in]
a[in]
b[in]
Returns
constexpr bool

◆ is_equal() [1/2]

template<typename T >
static constexpr HERMES_DEVICE_CALLABLE bool hermes::Check::is_equal ( a,
b 
)
inlinestaticconstexpr

Checks if two numbers are at most 1e-8 apart.

Template Parameters
T
Parameters
a[in]
b[in]
Returns
constexpr bool

◆ is_equal() [2/2]

template<typename T >
static constexpr HERMES_DEVICE_CALLABLE bool hermes::Check::is_equal ( a,
b,
e 
)
inlinestaticconstexpr

Checks if two numbers are at most to a threshold apart.

Template Parameters
T
Parameters
a[in]
b[in]
e[in]
Returns
constexpr bool

◆ is_nan()

template<typename T >
static HERMES_DEVICE_CALLABLE std::enable_if_t<std::is_floating_point<T>::value, bool> hermes::Check::is_nan ( v)
inlinestatic

Checks if number representation is nan

Template Parameters
T
Parameters
v
Returns

◆ is_zero()

template<typename T >
static constexpr HERMES_DEVICE_CALLABLE bool hermes::Check::is_zero ( a)
inlinestaticconstexpr

Checks if number is 0.

Template Parameters
T
Parameters
a[in]
Returns
constexpr bool

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