Extend support for float/double tolerances in testing
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 31 Aug 2014 03:54:50 +0000 (06:54 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sat, 13 Sep 2014 03:20:23 +0000 (05:20 +0200)
commitae045993e6925e7f316fd4dc81212bb3bb156c93
tree56ec8de85e574607b0e3f5ee6bcc910502d7355d
parent22fcfd13dde2ce31faf8b38b4de078756aa2e124
Extend support for float/double tolerances in testing

Comparisons based only on ULP are awkward when comparing quantities
computed in single and double precision when the accuracy of the
algorithm / implementation does not vary significantly with the
precision.  For example, the total energy when using an Ewald method
will vary with precision, but an acceptable result has nothing to do
with the precision in which it is computed.

Add relativeToleranceAsFloatingPoint to permit expressing the tolerance
as a floating-point number to mean a relative tolerance, but the
implementation is still expressed in ULP.  Make the tolerance class
support different tolerances for single and double precision numbers to
allow this, as well as for other flexibility.

Add tests for the various tolerance construction functions.

Chang variables containing ULP values to be gmx_uint64_t.

Change-Id: I25f7ddf8f4f9a5f1317b1cafd0159d8dd7d62b8c
src/gromacs/fft/tests/fft.cpp
src/testutils/testasserts.cpp
src/testutils/testasserts.h
src/testutils/tests/testasserts_tests.cpp