Loading...
Searching...
No Matches
Dune::FloatCmp Namespace Reference
Common » Numbers » FloatCmp

Various ways to compare floating-point numbers. More...

## Classes

struct | EpsilonType
| Mapping of value type to epsilon type. More...
struct | EpsilonType< std::vector< T, A > >
| Specialization of EpsilonType for std::vector. More...
struct | EpsilonType< FieldVector< T, n > >
| Specialization of EpsilonType for Dune::FieldVector. More...
struct | DefaultEpsilon< T, relativeWeak >
struct | DefaultEpsilon< T, relativeStrong >
struct | DefaultEpsilon< T, absolute >
struct | DefaultEpsilon
| mapping from a value type and a compare style to a default epsilon More...

## Enumerations

enum | CmpStyle { relativeWeak , relativeStrong , absolute , defaultCmpStyle = relativeWeak }
enum | RoundingStyle { towardZero , towardInf , downward , upward , defaultRoundingStyle = towardZero }

## Functions

template<class T, CmpStyle style>
bool | eq (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, style >::value())
| test for equality using epsilon
template<class T, CmpStyle style>
bool | ne (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, style >::value())
| test for inequality using epsilon
template<class T, CmpStyle style>
bool | gt (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, style >::value())
| test if first greater than second
template<class T, CmpStyle style>
bool | lt (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, style >::value())
| test if first lesser than second
template<class T, CmpStyle style>
bool | ge (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, style >::value())
| test if first greater or equal second
template<class T, CmpStyle style>
bool | le (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, style >::value())
| test if first lesser or equal second
template<class T>
bool | eq (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class T>
bool | ne (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class T>
bool | gt (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class T>
bool | lt (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class T>
bool | ge (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class T>
bool | le (const T &first, const T &second, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class I, class T, CmpStyle cstyle, RoundingStyle rstyle>
I | round (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, cstyle >::value())
| round using epsilon
template<class I, class T, CmpStyle cstyle>
I | round (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, cstyle >::value())
template<class I, class T, RoundingStyle rstyle>
I | round (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class I, class T>
I | round (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class I, class T, CmpStyle cstyle, RoundingStyle rstyle>
I | trunc (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, cstyle >::value())
| truncate using epsilon
template<class I, class T, CmpStyle cstyle>
I | trunc (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, cstyle >::value())
template<class I, class T, RoundingStyle rstyle>
I | trunc (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())
template<class I, class T>
I | trunc (const T &val, typename EpsilonType< T >::Type epsilon=DefaultEpsilon< T, defaultCmpStyle >::value())

## Detailed Description

Various ways to compare floating-point numbers.

See FloatCmp for details!

## Function Documentation

## eq()

template<class T>

bool Dune::FloatCmp::eq | ( | const T & | first,
|  | const T & | second,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## ge()

template<class T>

bool Dune::FloatCmp::ge | ( | const T & | first,
|  | const T & | second,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## gt()

template<class T>

bool Dune::FloatCmp::gt | ( | const T & | first,
|  | const T & | second,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## le()

template<class T>

bool Dune::FloatCmp::le | ( | const T & | first,
|  | const T & | second,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## lt()

template<class T>

bool Dune::FloatCmp::lt | ( | const T & | first,
|  | const T & | second,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## ne()

template<class T>

bool Dune::FloatCmp::ne | ( | const T & | first,
|  | const T & | second,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## round() [1/3]

template<class I, class T, CmpStyle cstyle>

I Dune::FloatCmp::round | ( | const T & | val,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, cstyle>::value() )

## round() [2/3]

template<class I, class T>

I Dune::FloatCmp::round | ( | const T & | val,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## round() [3/3]

template<class I, class T, RoundingStyle rstyle>

I Dune::FloatCmp::round | ( | const T & | val,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## trunc() [1/3]

template<class I, class T, CmpStyle cstyle>

I Dune::FloatCmp::trunc | ( | const T & | val,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, cstyle>::value() )

## trunc() [2/3]

template<class I, class T>

I Dune::FloatCmp::trunc | ( | const T & | val,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )

## trunc() [3/3]

template<class I, class T, RoundingStyle rstyle>

I Dune::FloatCmp::trunc | ( | const T & | val,
|  | typename EpsilonType< T >::Type | epsilon = DefaultEpsilon<T, defaultCmpStyle>::value() )