/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* treating also values of different sign.
*/
template <typename FloatType>
-gmx_uint64_t calculateUlpDifference(const FloatingPoint<FloatType> &value1,
- const FloatingPoint<FloatType> &value2)
+uint64_t calculateUlpDifference(const FloatingPoint<FloatType> &value1,
+ const FloatingPoint<FloatType> &value2)
{
typename FloatingPoint<FloatType>::Bits biased1
= floatingPointToBiasedInteger(value1);
*/
template <typename FloatType>
void initDifference(FloatType raw1, FloatType raw2, double *absoluteDifference,
- gmx_uint64_t *ulpDifference, bool *bSignDifference)
+ uint64_t *ulpDifference, bool *bSignDifference)
{
FloatingPoint<FloatType> value1(raw1);
FloatingPoint<FloatType> value2(raw2);
* Converts a relative tolerance into an ULP difference.
*/
template <typename FloatType>
-gmx_uint64_t relativeToleranceToUlp(FloatType tolerance)
+uint64_t relativeToleranceToUlp(FloatType tolerance)
{
FloatingPoint<FloatType> m(1.0);
FloatingPoint<FloatType> t(1.0 + tolerance);
relDiffStr = formatString("Inf");
}
- return formatString("%g (%" GMX_PRIu64 " %s-prec. ULPs, rel. %s)%s",
+ return formatString("%g (%" PRIu64 " %s-prec. ULPs, rel. %s)%s",
absoluteDifference_, ulpDifference_,
isDouble() ? "double" : "single",
relDiffStr.c_str(),
return true;
}
- const gmx_uint64_t ulpTolerance
+ const uint64_t ulpTolerance
= difference.isDouble() ? doubleUlpTolerance_ : singleUlpTolerance_;
- if (ulpTolerance < GMX_UINT64_MAX && difference.asUlps() <= ulpTolerance)
+ if (ulpTolerance < UINT64_MAX && difference.asUlps() <= ulpTolerance)
{
return true;
}
= difference.isDouble() ? doubleAbsoluteTolerance_ : singleAbsoluteTolerance_;
const double relativeTolerance
= difference.isDouble() ? doubleRelativeTolerance_ : singleRelativeTolerance_;
- const gmx_uint64_t ulpTolerance
+ const uint64_t ulpTolerance
= difference.isDouble() ? doubleUlpTolerance_ : singleUlpTolerance_;
if (absoluteTolerance > 0.0)
}
result.append(formatString("rel. %.3g", relativeTolerance));
}
- if (ulpTolerance < GMX_UINT64_MAX)
+ if (ulpTolerance < UINT64_MAX)
{
if (!result.empty())
{
result.append(", ");
}
- result.append(formatString("%" GMX_PRIu64 " ULPs", ulpTolerance));
+ result.append(formatString("%" PRIu64 " ULPs", ulpTolerance));
}
if (bSignMustMatch_)
{
const double absoluteTolerance = std::abs(magnitude) * tolerance;
return FloatingPointTolerance(absoluteTolerance, absoluteTolerance,
tolerance, tolerance,
- GMX_UINT64_MAX, GMX_UINT64_MAX,
+ UINT64_MAX, UINT64_MAX,
false);
}
//! \endcond