Loading...
Searching...
No Matches
Dune::MathOverloads Namespace Reference
Common » Dense Matrix and Vector Template Library

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.
| DUNE_COMMON_MATH_ISFUNCTION (isNaN, isnan)
| DUNE_COMMON_MATH_ISFUNCTION (isInf, isinf)
| DUNE_COMMON_MATH_ISFUNCTION (isFinite, isfinite)
template<class T>
auto | isUnordered (const T &t1, const T &t2, PriorityTag< 1 >, ADLTag) -> decltype(isUnordered(t1, t2))
template<class T>
auto | isUnordered (const T &t1, const T &t2, PriorityTag< 0 >, ADLTag)
template<class T, class = std::enable_if_t<Impl::isComplexLike<T>::value>>
auto | isNaN (const T &t, PriorityTag< 2 >, ADLTag)
template<class T, class = std::enable_if_t<Impl::isComplexLike<T>::value>>
auto | isInf (const T &t, PriorityTag< 2 >, ADLTag)
template<class T, class = std::enable_if_t<Impl::isComplexLike<T>::value>>
auto | isFinite (const T &t, PriorityTag< 2 >, ADLTag)
template<class T, std::size_t S, std::size_t A>
auto | isNaN (const LoopSIMD< T, S, A > &v, PriorityTag< 3 >, ADLTag)
template<class T, std::size_t S, std::size_t A>
auto | isInf (const LoopSIMD< T, S, A > &v, PriorityTag< 3 >, ADLTag)
template<class T, std::size_t S, std::size_t A>
auto | isFinite (const LoopSIMD< T, S, A > &v, PriorityTag< 3 >, ADLTag)

## 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.

## Function Documentation

## DUNE_COMMON_MATH_ISFUNCTION() [1/3]

Dune::MathOverloads::DUNE_COMMON_MATH_ISFUNCTION | ( | isFinite | ,
|  | isfinite | )

## DUNE_COMMON_MATH_ISFUNCTION() [2/3]

Dune::MathOverloads::DUNE_COMMON_MATH_ISFUNCTION | ( | isInf | ,
|  | isinf | )

## DUNE_COMMON_MATH_ISFUNCTION() [3/3]

Dune::MathOverloads::DUNE_COMMON_MATH_ISFUNCTION | ( | isNaN | ,
|  | isnan | )

## isFinite() [1/3]

template<class K, int SIZE>

auto Dune::MathOverloads::isFinite | ( | const FieldVector< K, SIZE > & | b,
|  | PriorityTag< 2 > | ,
|  | ADLTag | )

Returns whether all entries are finite.

## isFinite() [2/3]

template<class T, std::size_t S, std::size_t A>

auto Dune::MathOverloads::isFinite | ( | const LoopSIMD< T, S, A > & | v,
|  | PriorityTag< 3 > | ,
|  | ADLTag | )

## isFinite() [3/3]

template<class T, class = std::enable_if_t<Impl::isComplexLike<T>::value>>

auto Dune::MathOverloads::isFinite | ( | const T & | t,
|  | PriorityTag< 2 > | ,
|  | ADLTag | )

## isInf() [1/3]

template<class K, int SIZE>

bool Dune::MathOverloads::isInf | ( | const FieldVector< K, SIZE > & | b,
|  | PriorityTag< 2 > | ,
|  | ADLTag | )

Returns whether any entry is infinite.

## isInf() [2/3]

template<class T, std::size_t S, std::size_t A>

auto Dune::MathOverloads::isInf | ( | const LoopSIMD< T, S, A > & | v,
|  | PriorityTag< 3 > | ,
|  | ADLTag | )

## isInf() [3/3]

template<class T, class = std::enable_if_t<Impl::isComplexLike<T>::value>>

auto Dune::MathOverloads::isInf | ( | const T & | t,
|  | PriorityTag< 2 > | ,
|  | ADLTag | )

## isNaN() [1/3]

template<class K, int SIZE, std::enable_if_t< HasNaN< K >::value, int > = 0>

bool Dune::MathOverloads::isNaN | ( | const FieldVector< K, SIZE > & | b,
|  | PriorityTag< 2 > | ,
|  | ADLTag | )

Returns whether any entry is NaN.

## isNaN() [2/3]

template<class T, std::size_t S, std::size_t A>

auto Dune::MathOverloads::isNaN | ( | const LoopSIMD< T, S, A > & | v,
|  | PriorityTag< 3 > | ,
|  | ADLTag | )

## isNaN() [3/3]

template<class T, class = std::enable_if_t<Impl::isComplexLike<T>::value>>

auto Dune::MathOverloads::isNaN | ( | const T & | t,
|  | PriorityTag< 2 > | ,
|  | ADLTag | )

## isUnordered() [1/3]

template<class K, std::enable_if_t< HasNaN< K >::value, int > = 0>

bool Dune::MathOverloads::isUnordered | ( | const FieldVector< K, 1 > & | b,
|  | const FieldVector< K, 1 > & | c,
|  | PriorityTag< 2 > | ,
|  | ADLTag | )

Returns true if either b or c is NaN.

## isUnordered() [2/3]

template<class T>

auto Dune::MathOverloads::isUnordered | ( | const T & | t1,
|  | const T & | t2,
|  | PriorityTag< 0 > | ,
|  | ADLTag | )

## isUnordered() [3/3]

template<class T>

auto Dune::MathOverloads::isUnordered | ( | const T & | t1,
|  | const T & | t2,
|  | PriorityTag< 1 > | ,
|  | ADLTag | )->decltype(isUnordered(t1, t2))