Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::EpsilonTest Class Reference

#include <ogdf/basic/EpsilonTest.h>

Public Member Functions

 EpsilonTest (double epsilon=1.0e-8)
 Constructs an EpsilonTest with a given epsilon (double) for comparisons.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 
template<typename T >
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.
 

Private Attributes

const double eps
 Epsilon for floating point comparisons.
 

Detailed Description

Definition at line 41 of file EpsilonTest.h.

Constructor & Destructor Documentation

◆ EpsilonTest()

ogdf::EpsilonTest::EpsilonTest ( double  epsilon = 1.0e-8)
inlineexplicit

Constructs an EpsilonTest with a given epsilon (double) for comparisons.

Definition at line 47 of file EpsilonTest.h.

Member Function Documentation

◆ equal() [1/2]

template<typename T >
std::enable_if< std::is_integral< T >::value, bool >::type ogdf::EpsilonTest::equal ( const T &  x,
const T &  y 
) const
inline

Compare if x is EQUAL to y for integral types.

Parameters
xis the left parameter of the operator EQUAL
yis the right parameter of the operator EQUAL
Precondition
x and y are of integral type

Definition at line 109 of file EpsilonTest.h.

◆ equal() [2/2]

template<typename T >
std::enable_if< std::is_floating_point< T >::value, bool >::type ogdf::EpsilonTest::equal ( const T &  x,
const T &  y 
) const
inline

Compare if x is EQUAL to y for floating point types, using the given epsilon.

Parameters
xis the left parameter of the operator EQUAL
yis the right parameter of the operator EQUAL
Precondition
x and y are of floating point type

Definition at line 122 of file EpsilonTest.h.

◆ geq() [1/2]

template<typename T >
std::enable_if< std::is_integral< T >::value, bool >::type ogdf::EpsilonTest::geq ( const T &  x,
const T &  y 
) const
inline

Compare if x is GEQ to y for integral types.

Parameters
xis the left parameter of the operator GEQ
yis the right parameter of the operator GEQ
Precondition
x and y are of integral type

Definition at line 135 of file EpsilonTest.h.

◆ geq() [2/2]

template<typename T >
std::enable_if< std::is_floating_point< T >::value, bool >::type ogdf::EpsilonTest::geq ( const T &  x,
const T &  y 
) const
inline

Compare if x is GEQ to y for floating point types, using the given epsilon.

Parameters
xis the left parameter of the operator GEQ
yis the right parameter of the operator GEQ
Precondition
x and y are of floating point type

Definition at line 148 of file EpsilonTest.h.

◆ greater() [1/2]

template<typename T >
std::enable_if< std::is_integral< T >::value, bool >::type ogdf::EpsilonTest::greater ( const T &  x,
const T &  y 
) const
inline

Compare if x is GREATER than y for integral types.

Parameters
xis the left parameter of the operator GREATER
yis the right parameter of the operator GREATER
Precondition
x and y are of integral type

Definition at line 161 of file EpsilonTest.h.

◆ greater() [2/2]

template<typename T >
std::enable_if< std::is_floating_point< T >::value, bool >::type ogdf::EpsilonTest::greater ( const T &  x,
const T &  y 
) const
inline

Compare if x is GREATER than y for floating point types, using the given epsilon.

Parameters
xis the left parameter of the operator GREATER
yis the right parameter of the operator GREATER
Precondition
x and y are of floating point type

Definition at line 174 of file EpsilonTest.h.

◆ leq() [1/2]

template<typename T >
std::enable_if< std::is_integral< T >::value, bool >::type ogdf::EpsilonTest::leq ( const T &  x,
const T &  y 
) const
inline

Compare if x is LEQ than y for integral types.

Parameters
xis the left parameter of the operator LEQ
yis the right parameter of the operator LEQ
Precondition
x and y are of integral type

Definition at line 83 of file EpsilonTest.h.

◆ leq() [2/2]

template<typename T >
std::enable_if< std::is_floating_point< T >::value, bool >::type ogdf::EpsilonTest::leq ( const T &  x,
const T &  y 
) const
inline

Compare if x is LEQ than y for floating point types, using the given epsilon.

Parameters
xis the left parameter of the operator LEQ
yis the right parameter of the operator LEQ
Precondition
x and y are of floating point type

Definition at line 96 of file EpsilonTest.h.

◆ less() [1/2]

template<typename T >
std::enable_if< std::is_integral< T >::value, bool >::type ogdf::EpsilonTest::less ( const T &  x,
const T &  y 
) const
inline

Compare if x is LESS than y for integral types.

Parameters
xis the left parameter of the operator LESS
yis the right parameter of the operator LESS
Precondition
x and y are of integral type

Definition at line 57 of file EpsilonTest.h.

◆ less() [2/2]

template<typename T >
std::enable_if< std::is_floating_point< T >::value, bool >::type ogdf::EpsilonTest::less ( const T &  x,
const T &  y 
) const
inline

Compare if x is LESS than y for floating point types, using the given epsilon.

Parameters
xis the left parameter of the operator LESS
yis the right parameter of the operator LESS
Precondition
x and y are of floating point type

Definition at line 70 of file EpsilonTest.h.

Member Data Documentation

◆ eps

const double ogdf::EpsilonTest::eps
private

Epsilon for floating point comparisons.

Definition at line 43 of file EpsilonTest.h.


The documentation for this class was generated from the following file: