Gromacs
5.1
|
#include "gmxpre.h"
#include "testasserts.h"
#include <cmath>
#include <limits>
#include <gtest/gtest.h>
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/stringutil.h"
Implements floating-point comparison routines from testasserts.h.
Functions | |
Helper functions for computing floating-point differences | |
These routines are used to initialize FloatingPointDifference. They peek into some internal types from Google Test (gtest-internal.h), and duplicate some other functionality from there, but that is likely a better alternative than just copying all that code here. | |
template<typename FloatType > | |
FloatingPoint< FloatType >::Bits | gmx::test::anonymous_namespace{testasserts.cpp}::floatingPointToBiasedInteger (const FloatingPoint< FloatType > &value) |
Computes biased integer representation for a floating-point value. More... | |
template<typename FloatType > | |
gmx_uint64_t | gmx::test::anonymous_namespace{testasserts.cpp}::calculateUlpDifference (const FloatingPoint< FloatType > &value1, const FloatingPoint< FloatType > &value2) |
Computes the magnitude of the difference in ULPs between two numbers, treating also values of different sign. | |
template<typename FloatType > | |
void | gmx::test::anonymous_namespace{testasserts.cpp}::initDifference (FloatType raw1, FloatType raw2, double *absoluteDifference, gmx_uint64_t *ulpDifference, bool *bSignDifference) |
Helper to implement the constructors for FloatingPointDifference. | |
template<typename FloatType > | |
gmx_uint64_t | gmx::test::anonymous_namespace{testasserts.cpp}::relativeToleranceToUlp (FloatType tolerance) |
Converts a relative tolerance into an ULP difference. | |