1#ifndef VIENNASHE_TESTS_COMMON_HPP
2#define VIENNASHE_TESTS_COMMON_HPP
39 inline bool fuzzy_equal(
double is,
double should,
double tol = 1e-1)
41 if ( (is < should || is > should)
42 && std::fabs(is - should) / std::max(std::abs(is), std::fabs(should)) > tol)
47 viennashe::log::error() <<
"fuzzy_equal(): diff = " << std::fabs(is - should) / std::max(std::fabs(is), std::fabs(should)) << std::endl;
Contains forward declarations and definition of small classes that must be defined at an early stage.
A logging facility providing fine-grained control over logging in ViennaSHE.
logger< true > error()
Used to log errors. The logging level is logERROR.
bool fuzzy_equal(double is, double should, double tol=1e-1)
Performs a fuzzy (up to a tolerance) equal. Returns true if is and should are equal within the tolera...
The main ViennaSHE namespace. All functionality resides inside this namespace.