36 #include <type_traits> 46 explicit EpsilonTest(
double epsilon = 1.0e-8) : eps(epsilon) {}
56 inline typename std::enable_if<std::is_integral<T>::value,
bool>
::type 57 less(
const T &x,
const T &y)
const 70 inline typename std::enable_if<std::is_floating_point<T>::value,
bool>
::type 71 less(
const T &x,
const T &y)
const 84 inline typename std::enable_if<std::is_integral<T>::value,
bool>
::type 85 leq(
const T &x,
const T &y)
const 98 inline typename std::enable_if<std::is_floating_point<T>::value,
bool>
::type 99 leq(
const T &x,
const T &y)
const 101 return x < (y +
eps);
112 inline typename std::enable_if<std::is_integral<T>::value,
bool>
::type 126 inline typename std::enable_if<std::is_floating_point<T>::value,
bool>
::type 129 return leq(x, y) &&
geq(x, y);
140 inline typename std::enable_if<std::is_integral<T>::value,
bool>
::type 141 geq(
const T &x,
const T &y)
const 154 inline typename std::enable_if<std::is_floating_point<T>::value,
bool>
::type 155 geq(
const T &x,
const T &y)
const 157 return x > (y -
eps);
168 inline typename std::enable_if<std::is_integral<T>::value,
bool>
::type 182 inline typename std::enable_if<std::is_floating_point<T>::value,
bool>
::type 185 return x > (y +
eps);
std::enable_if< std::is_integral< T >::value, bool >::type leq(const T &x, const T &y) const
Compare if x is LEQ than y for integral types.
std::enable_if< std::is_floating_point< T >::value, bool >::type geq(const T &x, const T &y) const
Compare if x is GEQ to y for floating point types, using the given epsilon.
std::enable_if< std::is_integral< T >::value, bool >::type equal(const T &x, const T &y) const
Compare if x is EQUAL to y for integral types.
std::enable_if< std::is_floating_point< T >::value, bool >::type leq(const T &x, const T &y) const
Compare if x is LEQ than y for floating point types, using the given epsilon.
const double eps
Epsilon for floating point comparisons.
EpsilonTest(double epsilon=1.0e-8)
Constructs an EpsilonTest with a given epsilon (double) for comparisons.
std::enable_if< std::is_integral< T >::value, bool >::type less(const T &x, const T &y) const
Compare if x is LESS than y for integral types.
std::enable_if< std::is_floating_point< T >::value, bool >::type equal(const T &x, const T &y) const
Compare if x is EQUAL to y for floating point types, using the given epsilon.
std::enable_if< std::is_floating_point< T >::value, bool >::type less(const T &x, const T &y) const
Compare if x is LESS than y for floating point types, using the given epsilon.
std::enable_if< std::is_integral< T >::value, bool >::type greater(const T &x, const T &y) const
Compare if x is GREATER than y for integral types.
Basic declarations, included by all source files.
std::enable_if< std::is_floating_point< T >::value, bool >::type greater(const T &x, const T &y) const
Compare if x is GREATER than y for floating point types, using the given epsilon. ...
The namespace for all OGDF objects.
std::enable_if< std::is_integral< T >::value, bool >::type geq(const T &x, const T &y) const
Compare if x is GEQ to y for integral types.