Dune Core Modules (unstable)
namespace for customization of math functions with Dune-Semantics More...
Classes | |
struct | ADLTag |
Tag to make sure the functions in this namespace can be found by ADL. More... | |
Functions | |
template<class K , int SIZE> | |
auto | isFinite (const FieldVector< K, SIZE > &b, PriorityTag< 2 >, ADLTag) |
Returns whether all entries are finite. | |
template<class K , int SIZE> | |
bool | isInf (const FieldVector< K, SIZE > &b, PriorityTag< 2 >, ADLTag) |
Returns whether any entry is infinite. | |
template<class K , int SIZE, std::enable_if_t< HasNaN< K >::value, int > = 0> | |
bool | isNaN (const FieldVector< K, SIZE > &b, PriorityTag< 2 >, ADLTag) |
Returns whether any entry is NaN. | |
template<class K , std::enable_if_t< HasNaN< K >::value, int > = 0> | |
bool | isUnordered (const FieldVector< K, 1 > &b, const FieldVector< K, 1 > &c, PriorityTag< 2 >, ADLTag) |
Returns true if either b or c is NaN. | |
Detailed Description
namespace for customization of math functions with Dune-Semantics
You can add overloads for the Dune-semantics of math-functions in this namespace. These overloads will be used by functors like Dune::isNaN
to implement these functions, and will be preferred over functions found by ADL, or the corresponding functions from the standard (whether they are found by ADL or in the namespace std
.
PriorityTag
There are two predefined priorities:
<1> provides a default implementation, only applicable if the camelCase-Version of the function (e.g. isNaN
) can be found via ADL for an argument of type T
. (Otherwise the overload should not participate in overload resolution.)
<0> provides a default implementation that forwards the call to the lower-case version of the function (e.g. isnan
), found via ADL and the namespace std
.
Any higher priority up to 10 can be used by other overloads.