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

Namespaces

namespace  mundy

Functions

template<typename T>
constexpr auto 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 auto 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 ()
 The tolerance to use when comparing two scalar types. The choice is made on the passive (underlying) type, so a custom scalar such as an autodiff dual resolves to its passive tolerance.
template<typename T1, typename T2>
constexpr auto mundy::get_relaxed_comparison_tolerance ()
 The relaxed tolerance to use when comparing two scalar types. Like get_comparison_tolerance, the choice is made on the passive (underlying) type.