Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
Tolerance.hpp File Reference

Namespaces

namespace  mundy

Functions

template<typename T>
constexpr T mundy::get_zero_tolerance ()
 Function to get the zero tolerance for a type. That is, the smallest value that we will consider non-zero. We use approximately 10 * std::numeric_limits<T>::epsilon() as the default tolerance for floats and doubles and 0 for integer types. To make this code GPU-compatable, we'll directly evaluate the epsilon instead of using std::numeric_limits.
template<typename T>
constexpr T mundy::get_relaxed_zero_tolerance ()
 Function to get the relaxed zero tolerance for a type. That is, the smallest value that we will consider non-zero. Our choice of relaxed tolerance is based on personal preference, not on a hard standard and is mostly used during testing. To make this code GPU-compatable, we'll directly evaluate the epsilon instead of using std::numeric_limits.
template<typename T1, typename T2>
constexpr auto mundy::get_comparison_tolerance ()
 A helper function for getting the tolerance to use when comparing two different types.
template<typename T1, typename T2>
constexpr auto mundy::get_comparison_tolerance_promote_ints ()
 A helper function for getting the tolerance to use when comparing two different types. int - int -> double float - int -> float double - int -> double.
template<typename T1, typename T2>
constexpr auto mundy::get_relaxed_comparison_tolerance ()
 A helper function for getting the relaxed tolerance to use when comparing two different types. This class chooses the tolerance based on the smaller of the two types.
template<typename T1, typename T2>
constexpr auto mundy::get_relaxed_comparison_tolerance_promote_ints ()
 A helper function for getting the relaxed tolerance to use when comparing two different types.