Predicate for approximate equality (for floating point) More...
#include <Test.h>
Public Member Functions | |
CloseTo (const double eps=1e-6) | |
boost::format | Name () const |
template<typename T > | |
bool | operator() (const T &lhs, const T &rhs) const |
Protected Member Functions | |
template<typename T > | |
bool | IsCloseAbs (const T &lhs, const T &rhs) const |
bool | IsCloseAbs (const utl::Triple &lhs, const utl::Triple &rhs) const |
template<typename T > | |
bool | IsCloseRel (const T &lhs, const T &rhs) const |
else return | IsCloseRel (lhs, rhs) |
Static Protected Member Functions | |
template<typename Head , typename Tail > | |
static double | TupleDist2 (const boost::tuples::cons< Head, Tail > &lhs, const boost::tuples::cons< Head, Tail > &rhs) |
static double | TupleDist2 (const boost::tuples::null_type &, const boost::tuples::null_type &) |
Protected Attributes | |
bool | const |
double | fEpsilon |
Predicate for approximate equality (for floating point)
The default precision is 1e-6, but it can be changed at construction time.
|
inlineprotected |
Definition at line 104 of file Test.h.
References utl::abs(), and fEpsilon.
Referenced by utl::CloseAbs::operator()().
|
inlineprotected |
Definition at line 107 of file Test.h.
References fEpsilon, sqrt(), and TupleDist2().
|
inlineprotected |
Definition at line 111 of file Test.h.
References utl::abs(), and fEpsilon.
Referenced by utl::CloseRel::operator()().
|
protected |
|
inline |
|
inlinestaticprotected |
Definition at line 138 of file Test.h.
Referenced by IsCloseAbs().
|
protected |
|
protected |
Definition at line 149 of file Test.h.
Referenced by IsCloseAbs(), IsCloseRel(), Name(), utl::CloseAbs::Name(), and utl::CloseRel::Name().