EXPECT_TRUE( std::equal( vec.begin(), vec.end(), hello ) );
}{
- std::size_t offset = 3u; std::size_t length = 4u;
+ std::size_t offset = 3U; std::size_t length = 4U;
std::vector<string_view::value_type> vec( length );
sv.copy( data(vec), length, offset );
void
SetAtoms::checkAbilityDependencies(unsigned long abilities) const
{
- if ((abilities & convertFlag(moduleRequirements_)) == 0u)
+ if ((abilities & convertFlag(moduleRequirements_)) == 0U)
{
std::string errorMessage = "Output file type does not support writing atom information. "
"You need to use PDB, GRO or TNG as the file type for this.";
void
SetForces::checkAbilityDependencies(unsigned long abilities) const
{
- if ((abilities & convertFlag(moduleRequirements_)) == 0u)
+ if ((abilities & convertFlag(moduleRequirements_)) == 0U)
{
std::string errorMessage = "Output file type does not support writing forces. "
"Only TNG and TRR support this output.";
void
SetPrecision::checkAbilityDependencies(unsigned long abilities) const
{
- if ((abilities & convertFlag(moduleRequirements_)) == 0u)
+ if ((abilities & convertFlag(moduleRequirements_)) == 0U)
{
std::string errorMessage = "Output file type does not support writing variable precision. "
"Only XTC and TNG support variable precision.";
void
SetVelocities::checkAbilityDependencies(unsigned long abilities) const
{
- if ((abilities & convertFlag(moduleRequirements_)) == 0u)
+ if ((abilities & convertFlag(moduleRequirements_)) == 0U)
{
std::string errorMessage = "Output file type does not support writing velocities. "
"Only GRO, TRR and TNG support this output.";
void DummyOutputModule::checkAbilityDependencies(const unsigned long abilities) const
{
- if ((abilities & convertFlag(moduleRequirements_)) == 0u)
+ if ((abilities & convertFlag(moduleRequirements_)) == 0U)
{
std::string errorMessage = "Unhandled module requirements.";
GMX_THROW(InconsistentInputError(errorMessage.c_str()));
/* The actual time could be anywhere between 0 and
* waitCyclesEstimate. Using half is the best we can do.
*/
- const float unknownWaitEstimateFactor = 0.5f;
+ const float unknownWaitEstimateFactor = 0.5F;
waitGpuCyclesEstimate *= unknownWaitEstimateFactor;
}
static gmx_bool dd_check_ftype(int ftype, gmx_bool bBCheck,
gmx_bool bConstr, gmx_bool bSettle)
{
- return ((((interaction_function[ftype].flags & IF_BOND) != 0u) &&
- ((interaction_function[ftype].flags & IF_VSITE) == 0u) &&
- (bBCheck || ((interaction_function[ftype].flags & IF_LIMZERO) == 0u))) ||
+ return ((((interaction_function[ftype].flags & IF_BOND) != 0U) &&
+ ((interaction_function[ftype].flags & IF_VSITE) == 0U) &&
+ (bBCheck || ((interaction_function[ftype].flags & IF_LIMZERO) == 0U))) ||
(bConstr && (ftype == F_CONSTR || ftype == F_CONSTRNC)) ||
(bSettle && ftype == F_SETTLE));
}
(bConstr && (ftype == F_CONSTR || ftype == F_CONSTRNC)) ||
(bSettle && ftype == F_SETTLE))
{
- const bool bVSite = ((interaction_function[ftype].flags & IF_VSITE) != 0u);
+ const bool bVSite = ((interaction_function[ftype].flags & IF_VSITE) != 0U);
const int nral = NRAL(ftype);
const auto &il = il_mt[ftype];
for (int i = 0; i < il.size(); i += 1+nral)
{
if (dd->comm->load[0].sum > 0)
{
- return dd->comm->load[0].max*dd->nnodes/dd->comm->load[0].sum - 1.0f;
+ return dd->comm->load[0].max*dd->nnodes/dd->comm->load[0].sum - 1.0F;
}
else
{
/* Something is wrong in the cycle counting, report no load imbalance */
- return 0.0f;
+ return 0.0F;
}
}
if (DDMASTER(dd))
{
/* Add the measured cycles to the running average */
- const float averageFactor = 0.1f;
+ const float averageFactor = 0.1F;
comm->cyclesPerStepDlbExpAverage =
(1 - averageFactor)*comm->cyclesPerStepDlbExpAverage +
averageFactor*comm->cycl[ddCyclStep]/comm->cycl_n[ddCyclStep];
copy_mat(cnb.box, box);
*lambda_q = cnb.lambda_q;
*lambda_lj = cnb.lambda_lj;
- *bEnerVir = ((cnb.flags & PP_PME_ENER_VIR) != 0u);
+ *bEnerVir = ((cnb.flags & PP_PME_ENER_VIR) != 0U);
*step = cnb.step;
/* Receive the coordinates in place */
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019, 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.
{
// normal box
Matrix3x3 {{
- 8.0f, 0.0f, 0.0f,
- 0.0f, 3.4f, 0.0f,
- 0.0f, 0.0f, 2.0f
+ 8.0F, 0.0F, 0.0F,
+ 0.0F, 3.4F, 0.0F,
+ 0.0F, 0.0F, 2.0F
}},
// triclinic box
Matrix3x3 {{
- 7.0f, 0.0f, 0.0f,
- 0.0f, 4.1f, 0.0f,
- 3.5f, 2.0f, 12.2f
+ 7.0F, 0.0F, 0.0F,
+ 0.0F, 4.1F, 0.0F,
+ 3.5F, 2.0F, 12.2F
}},
};
//! Random charges
std::vector<real> const c_sampleChargesFull
{
- 4.95f, 3.11f, 3.97f, 1.08f, 2.09f, 1.1f, 4.13f, 3.31f, 2.8f, 5.83f, 5.09f, 6.1f, 2.86f, 0.24f, 5.76f, 5.19f, 0.72f
+ 4.95F, 3.11F, 3.97F, 1.08F, 2.09F, 1.1F, 4.13F, 3.31F, 2.8F, 5.83F, 5.09F, 6.1F, 2.86F, 0.24F, 5.76F, 5.19F, 0.72F
};
//! All the input atom gridline indices
//! A lot of bogus input spline values - should have at list (max PME order = 5) * (DIM = 3) * (total unique atom number in all test cases = 16) values
std::vector<real> const c_sampleSplineValuesFull
{
- 0.12f, 0.81f, 0.29f, 0.22f, 0.13f, 0.19f, 0.12f, 0.8f, 0.44f, 0.38f, 0.32f, 0.36f, 0.27f, 0.11f, 0.17f, 0.94f, 0.07f, 0.9f, 0.98f, 0.96f, 0.07f, 0.94f, 0.77f, 0.24f, 0.84f, 0.16f, 0.77f, 0.57f, 0.52f, 0.27f, 0.39f, 0.45f, 0.6f, 0.59f, 0.44f, 0.91f, 0.97f, 0.43f, 0.24f, 0.52f, 0.73f, 0.55f, 0.99f, 0.39f, 0.97f, 0.35f, 0.1f, 0.68f, 0.19f, 0.1f, 0.77f, 0.2f, 0.43f, 0.69f, 0.76f, 0.32f, 0.31f, 0.94f, 0.53f, 0.6f, 0.93f, 0.57f, 0.94f, 0.88f, 0.75f, 0.77f, 0.91f, 0.72f, 0.07f, 0.78f, 0.09f, 0.02f, 0.48f, 0.97f, 0.89f, 0.39f, 0.48f, 0.19f, 0.02f, 0.92f, 0.8f, 0.41f, 0.53f, 0.32f, 0.38f, 0.58f, 0.36f, 0.46f, 0.92f, 0.91f, 0.01f, 0.86f, 0.54f, 0.86f, 0.94f, 0.37f, 0.35f, 0.81f, 0.89f, 0.48f,
- 0.34f, 0.18f, 0.11f, 0.02f, 0.87f, 0.95f, 0.66f, 0.67f, 0.38f, 0.45f, 0.04f, 0.94f, 0.54f, 0.76f, 0.58f, 0.83f, 0.31f, 0.73f, 0.71f, 0.06f, 0.35f, 0.32f, 0.35f, 0.61f, 0.27f, 0.98f, 0.83f, 0.11f, 0.3f, 0.42f, 0.95f, 0.69f, 0.58f, 0.29f, 0.1f, 0.68f, 0.94f, 0.62f, 0.51f, 0.47f, 0.04f, 0.47f, 0.34f, 0.71f, 0.52f, 0.19f, 0.69f, 0.5f, 0.59f, 0.05f, 0.74f, 0.11f, 0.4f, 0.81f, 0.24f, 0.53f, 0.71f, 0.07f, 0.17f, 0.41f, 0.23f, 0.78f, 0.27f, 0.1f, 0.71f, 0.36f, 0.67f, 0.6f, 0.94f, 0.69f, 0.19f, 0.58f, 0.68f, 0.5f, 0.62f, 0.38f, 0.29f, 0.44f, 0.04f, 0.89f, 0.0f, 0.76f, 0.22f, 0.16f, 0.08f, 0.62f, 0.51f, 0.62f, 0.83f, 0.72f, 0.96f, 0.99f, 0.4f, 0.79f, 0.83f, 0.21f, 0.43f, 0.32f, 0.44f, 0.72f,
- 0.21f, 0.4f, 0.93f, 0.07f, 0.11f, 0.41f, 0.24f, 0.04f, 0.36f, 0.15f, 0.92f, 0.08f, 0.99f, 0.35f, 0.42f, 0.7f, 0.17f, 0.39f, 0.69f, 0.0f, 0.86f, 0.89f, 0.59f, 0.81f, 0.77f, 0.15f, 0.89f, 0.17f, 0.76f, 0.67f, 0.58f, 0.78f, 0.26f, 0.19f, 0.69f, 0.18f, 0.46f, 0.6f, 0.69f, 0.23f, 0.34f, 0.3f, 0.64f, 0.34f, 0.6f, 0.99f, 0.69f, 0.57f, 0.75f, 0.07f, 0.36f, 0.75f, 0.81f, 0.8f, 0.42f, 0.09f, 0.94f, 0.66f, 0.35f, 0.67f, 0.34f, 0.66f, 0.02f, 0.47f, 0.78f, 0.21f, 0.02f, 0.18f, 0.42f, 0.2f, 0.46f, 0.34f, 0.4f, 0.46f, 0.96f, 0.86f, 0.25f, 0.25f, 0.22f, 0.37f, 0.59f, 0.19f, 0.45f, 0.61f, 0.04f, 0.71f, 0.77f, 0.51f, 0.77f, 0.15f, 0.78f, 0.36f, 0.62f, 0.24f, 0.86f, 0.2f, 0.77f, 0.08f, 0.09f, 0.3f,
- 0.0f, 0.6f, 0.99f, 0.69f,
+ 0.12F, 0.81F, 0.29F, 0.22F, 0.13F, 0.19F, 0.12F, 0.8F, 0.44F, 0.38F, 0.32F, 0.36F, 0.27F, 0.11F, 0.17F, 0.94F, 0.07F, 0.9F, 0.98F, 0.96F, 0.07F, 0.94F, 0.77F, 0.24F, 0.84F, 0.16F, 0.77F, 0.57F, 0.52F, 0.27F, 0.39F, 0.45F, 0.6F, 0.59F, 0.44F, 0.91F, 0.97F, 0.43F, 0.24F, 0.52F, 0.73F, 0.55F, 0.99F, 0.39F, 0.97F, 0.35F, 0.1F, 0.68F, 0.19F, 0.1F, 0.77F, 0.2F, 0.43F, 0.69F, 0.76F, 0.32F, 0.31F, 0.94F, 0.53F, 0.6F, 0.93F, 0.57F, 0.94F, 0.88F, 0.75F, 0.77F, 0.91F, 0.72F, 0.07F, 0.78F, 0.09F, 0.02F, 0.48F, 0.97F, 0.89F, 0.39F, 0.48F, 0.19F, 0.02F, 0.92F, 0.8F, 0.41F, 0.53F, 0.32F, 0.38F, 0.58F, 0.36F, 0.46F, 0.92F, 0.91F, 0.01F, 0.86F, 0.54F, 0.86F, 0.94F, 0.37F, 0.35F, 0.81F, 0.89F, 0.48F,
+ 0.34F, 0.18F, 0.11F, 0.02F, 0.87F, 0.95F, 0.66F, 0.67F, 0.38F, 0.45F, 0.04F, 0.94F, 0.54F, 0.76F, 0.58F, 0.83F, 0.31F, 0.73F, 0.71F, 0.06F, 0.35F, 0.32F, 0.35F, 0.61F, 0.27F, 0.98F, 0.83F, 0.11F, 0.3F, 0.42F, 0.95F, 0.69F, 0.58F, 0.29F, 0.1F, 0.68F, 0.94F, 0.62F, 0.51F, 0.47F, 0.04F, 0.47F, 0.34F, 0.71F, 0.52F, 0.19F, 0.69F, 0.5F, 0.59F, 0.05F, 0.74F, 0.11F, 0.4F, 0.81F, 0.24F, 0.53F, 0.71F, 0.07F, 0.17F, 0.41F, 0.23F, 0.78F, 0.27F, 0.1F, 0.71F, 0.36F, 0.67F, 0.6F, 0.94F, 0.69F, 0.19F, 0.58F, 0.68F, 0.5F, 0.62F, 0.38F, 0.29F, 0.44F, 0.04F, 0.89F, 0.0F, 0.76F, 0.22F, 0.16F, 0.08F, 0.62F, 0.51F, 0.62F, 0.83F, 0.72F, 0.96F, 0.99F, 0.4F, 0.79F, 0.83F, 0.21F, 0.43F, 0.32F, 0.44F, 0.72F,
+ 0.21F, 0.4F, 0.93F, 0.07F, 0.11F, 0.41F, 0.24F, 0.04F, 0.36F, 0.15F, 0.92F, 0.08F, 0.99F, 0.35F, 0.42F, 0.7F, 0.17F, 0.39F, 0.69F, 0.0F, 0.86F, 0.89F, 0.59F, 0.81F, 0.77F, 0.15F, 0.89F, 0.17F, 0.76F, 0.67F, 0.58F, 0.78F, 0.26F, 0.19F, 0.69F, 0.18F, 0.46F, 0.6F, 0.69F, 0.23F, 0.34F, 0.3F, 0.64F, 0.34F, 0.6F, 0.99F, 0.69F, 0.57F, 0.75F, 0.07F, 0.36F, 0.75F, 0.81F, 0.8F, 0.42F, 0.09F, 0.94F, 0.66F, 0.35F, 0.67F, 0.34F, 0.66F, 0.02F, 0.47F, 0.78F, 0.21F, 0.02F, 0.18F, 0.42F, 0.2F, 0.46F, 0.34F, 0.4F, 0.46F, 0.96F, 0.86F, 0.25F, 0.25F, 0.22F, 0.37F, 0.59F, 0.19F, 0.45F, 0.61F, 0.04F, 0.71F, 0.77F, 0.51F, 0.77F, 0.15F, 0.78F, 0.36F, 0.62F, 0.24F, 0.86F, 0.2F, 0.77F, 0.08F, 0.09F, 0.3F,
+ 0.0F, 0.6F, 0.99F, 0.69F,
};
//! A lot of bogus input spline derivatives - should have at list (max PME order = 5) * (DIM = 3) * (total unique atom number in all test cases = 16) values
std::vector<real> const c_sampleSplineDerivativesFull
{
- 0.82f, 0.88f, 0.83f, 0.11f, 0.93f, 0.32f, 0.71f, 0.37f, 0.69f, 0.88f, 0.11f, 0.38f, 0.25f, 0.5f, 0.36f, 0.81f, 0.78f, 0.31f, 0.66f, 0.32f, 0.27f, 0.35f, 0.53f, 0.83f, 0.08f, 0.08f, 0.94f, 0.71f, 0.65f, 0.24f, 0.13f, 0.01f, 0.33f, 0.65f, 0.24f, 0.53f, 0.45f, 0.84f, 0.33f, 0.97f, 0.31f, 0.7f, 0.03f, 0.31f, 0.41f, 0.76f, 0.12f, 0.3f, 0.57f, 0.65f, 0.87f, 0.99f, 0.42f, 0.97f, 0.32f, 0.39f, 0.73f, 0.23f, 0.03f, 0.67f, 0.97f, 0.57f, 0.42f, 0.38f, 0.54f, 0.17f, 0.53f, 0.54f, 0.18f, 0.8f, 0.76f, 0.13f, 0.29f, 0.83f, 0.77f, 0.56f, 0.4f, 0.87f, 0.36f, 0.18f, 0.59f, 0.04f, 0.05f, 0.61f, 0.26f, 0.91f, 0.62f, 0.16f, 0.89f, 0.23f, 0.26f, 0.59f, 0.33f, 0.2f, 0.49f, 0.41f, 0.25f, 0.4f, 0.16f, 0.83f,
- 0.44f, 0.82f, 0.21f, 0.95f, 0.14f, 0.8f, 0.37f, 0.31f, 0.41f, 0.53f, 0.15f, 0.85f, 0.78f, 0.17f, 0.92f, 0.03f, 0.13f, 0.2f, 0.03f, 0.33f, 0.87f, 0.38f, 0, 0.08f, 0.79f, 0.36f, 0.53f, 0.05f, 0.07f, 0.94f, 0.23f, 0.85f, 0.13f, 0.27f, 0.23f, 0.22f, 0.26f, 0.38f, 0.15f, 0.48f, 0.18f, 0.33f, 0.23f, 0.62f, 0.1f, 0.36f, 0.99f, 0.07f, 0.02f, 0.04f, 0.09f, 0.29f, 0.52f, 0.29f, 0.83f, 0.97f, 0.61f, 0.81f, 0.49f, 0.56f, 0.08f, 0.09f, 0.03f, 0.65f, 0.46f, 0.1f, 0.06f, 0.06f, 0.39f, 0.29f, 0.04f, 0.03f, 0.1f, 0.83f, 0.94f, 0.59f, 0.97f, 0.82f, 0.2f, 0.66f, 0.23f, 0.11f, 0.03f, 0.16f, 0.27f, 0.53f, 0.94f, 0.46f, 0.43f, 0.29f, 0.97f, 0.64f, 0.46f, 0.37f, 0.43f, 0.48f, 0.37f, 0.93f, 0.5f, 0.2f,
- 0.92f, 0.09f, 0.74f, 0.55f, 0.44f, 0.05f, 0.13f, 0.17f, 0.79f, 0.44f, 0.11f, 0.6f, 0.64f, 0.05f, 0.96f, 0.3f, 0.45f, 0.47f, 0.42f, 0.74f, 0.91f, 0.06f, 0.89f, 0.24f, 0.26f, 0.68f, 0.4f, 0.88f, 0.5f, 0.65f, 0.48f, 0.15f, 0.0f, 0.41f, 0.67f, 0.4f, 0.31f, 0.73f, 0.77f, 0.36f, 0.26f, 0.74f, 0.46f, 0.56f, 0.78f, 0.92f, 0.32f, 0.9f, 0.06f, 0.55f, 0.6f, 0.13f, 0.38f, 0.93f, 0.5f, 0.92f, 0.96f, 0.82f, 0.0f, 0.04f, 0.9f, 0.55f, 0.97f, 1.0f, 0.23f, 0.46f, 0.52f, 0.49f, 0.0f, 0.32f, 0.16f, 0.4f, 0.62f, 0.36f, 0.03f, 0.63f, 0.16f, 0.58f, 0.97f, 0.03f, 0.44f, 0.07f, 0.22f, 0.75f, 0.32f, 0.61f, 0.94f, 0.33f, 0.7f, 0.57f, 0.5f, 0.84f, 0.7f, 0.47f, 0.18f, 0.09f, 0.25f, 0.77f, 0.94f, 0.85f,
- 0.09f, 0.83f, 0.02f, 0.91f,
+ 0.82F, 0.88F, 0.83F, 0.11F, 0.93F, 0.32F, 0.71F, 0.37F, 0.69F, 0.88F, 0.11F, 0.38F, 0.25F, 0.5F, 0.36F, 0.81F, 0.78F, 0.31F, 0.66F, 0.32F, 0.27F, 0.35F, 0.53F, 0.83F, 0.08F, 0.08F, 0.94F, 0.71F, 0.65F, 0.24F, 0.13F, 0.01F, 0.33F, 0.65F, 0.24F, 0.53F, 0.45F, 0.84F, 0.33F, 0.97F, 0.31F, 0.7F, 0.03F, 0.31F, 0.41F, 0.76F, 0.12F, 0.3F, 0.57F, 0.65F, 0.87F, 0.99F, 0.42F, 0.97F, 0.32F, 0.39F, 0.73F, 0.23F, 0.03F, 0.67F, 0.97F, 0.57F, 0.42F, 0.38F, 0.54F, 0.17F, 0.53F, 0.54F, 0.18F, 0.8F, 0.76F, 0.13F, 0.29F, 0.83F, 0.77F, 0.56F, 0.4F, 0.87F, 0.36F, 0.18F, 0.59F, 0.04F, 0.05F, 0.61F, 0.26F, 0.91F, 0.62F, 0.16F, 0.89F, 0.23F, 0.26F, 0.59F, 0.33F, 0.2F, 0.49F, 0.41F, 0.25F, 0.4F, 0.16F, 0.83F,
+ 0.44F, 0.82F, 0.21F, 0.95F, 0.14F, 0.8F, 0.37F, 0.31F, 0.41F, 0.53F, 0.15F, 0.85F, 0.78F, 0.17F, 0.92F, 0.03F, 0.13F, 0.2F, 0.03F, 0.33F, 0.87F, 0.38F, 0, 0.08F, 0.79F, 0.36F, 0.53F, 0.05F, 0.07F, 0.94F, 0.23F, 0.85F, 0.13F, 0.27F, 0.23F, 0.22F, 0.26F, 0.38F, 0.15F, 0.48F, 0.18F, 0.33F, 0.23F, 0.62F, 0.1F, 0.36F, 0.99F, 0.07F, 0.02F, 0.04F, 0.09F, 0.29F, 0.52F, 0.29F, 0.83F, 0.97F, 0.61F, 0.81F, 0.49F, 0.56F, 0.08F, 0.09F, 0.03F, 0.65F, 0.46F, 0.1F, 0.06F, 0.06F, 0.39F, 0.29F, 0.04F, 0.03F, 0.1F, 0.83F, 0.94F, 0.59F, 0.97F, 0.82F, 0.2F, 0.66F, 0.23F, 0.11F, 0.03F, 0.16F, 0.27F, 0.53F, 0.94F, 0.46F, 0.43F, 0.29F, 0.97F, 0.64F, 0.46F, 0.37F, 0.43F, 0.48F, 0.37F, 0.93F, 0.5F, 0.2F,
+ 0.92F, 0.09F, 0.74F, 0.55F, 0.44F, 0.05F, 0.13F, 0.17F, 0.79F, 0.44F, 0.11F, 0.6F, 0.64F, 0.05F, 0.96F, 0.3F, 0.45F, 0.47F, 0.42F, 0.74F, 0.91F, 0.06F, 0.89F, 0.24F, 0.26F, 0.68F, 0.4F, 0.88F, 0.5F, 0.65F, 0.48F, 0.15F, 0.0F, 0.41F, 0.67F, 0.4F, 0.31F, 0.73F, 0.77F, 0.36F, 0.26F, 0.74F, 0.46F, 0.56F, 0.78F, 0.92F, 0.32F, 0.9F, 0.06F, 0.55F, 0.6F, 0.13F, 0.38F, 0.93F, 0.5F, 0.92F, 0.96F, 0.82F, 0.0F, 0.04F, 0.9F, 0.55F, 0.97F, 1.0F, 0.23F, 0.46F, 0.52F, 0.49F, 0.0F, 0.32F, 0.16F, 0.4F, 0.62F, 0.36F, 0.03F, 0.63F, 0.16F, 0.58F, 0.97F, 0.03F, 0.44F, 0.07F, 0.22F, 0.75F, 0.32F, 0.61F, 0.94F, 0.33F, 0.7F, 0.57F, 0.5F, 0.84F, 0.7F, 0.47F, 0.18F, 0.09F, 0.25F, 0.77F, 0.94F, 0.85F,
+ 0.09F, 0.83F, 0.02F, 0.91F,
};
//! 2 c_sample grids - only non-zero values have to be listed
SparseRealGridValuesInput {{
IVec {
0, 0, 0
- }, 3.5f
+ }, 3.5F
}, {
IVec {
7, 0, 0
- }, -2.5f
+ }, -2.5F
},
{
IVec {
3, 5, 7
- }, -0.006f
+ }, -0.006F
}, {
IVec {
1, 6, 7
- }, -2.76f
+ }, -2.76F
}, {
IVec {
3, 1, 2
- }, 0.6f
+ }, 0.6F
}, {
IVec {
6, 2, 4
- }, 7.1f
+ }, 7.1F
}, {
IVec {
4, 5, 6
- }, 4.1f
+ }, 4.1F
}, {
IVec {
4, 4, 6
- }, -3.7f
+ }, -3.7F
}, },
SparseRealGridValuesInput {{
IVec {
0, 4, 0
- }, 6.f
+ }, 6.F
}, {
IVec {
4, 2, 7
- }, 13.76f
+ }, 13.76F
}, {
IVec {
0, 6, 7
- }, 3.6f
+ }, 3.6F
}, {
IVec {
3, 2, 8
- }, 0.61f
+ }, 0.61F
},
{
IVec {
5, 4, 3
- }, 2.1f
+ }, 2.1F
},
{
IVec {
2, 5, 10
- }, 3.6f
+ }, 3.6F
}, {
IVec {
5, 3, 6
- }, 2.1f
+ }, 2.1F
}, {
IVec {
6, 6, 6
- }, 6.1f
+ }, 6.1F
}, }
};
//! Input forces for reduction
std::vector<RVec> const c_sampleForcesFull {
RVec {
- 0.02f, 0.87f, 0.95f
+ 0.02F, 0.87F, 0.95F
}, RVec {
- 0.66f, 0.67f, 0.38f
+ 0.66F, 0.67F, 0.38F
}, RVec {
- 0.45f, 0.04f, 0.94f
+ 0.45F, 0.04F, 0.94F
}, RVec {
- 0.54f, 0.76f, 0.58f
+ 0.54F, 0.76F, 0.58F
},
RVec {
- 0.83f, 0.31f, 0.73f
+ 0.83F, 0.31F, 0.73F
}, RVec {
- 0.71f, 0.06f, 0.35f
+ 0.71F, 0.06F, 0.35F
}, RVec {
- 0.32f, 0.35f, 0.61f
+ 0.32F, 0.35F, 0.61F
}, RVec {
- 0.27f, 0.98f, 0.83f
+ 0.27F, 0.98F, 0.83F
},
RVec {
- 0.11f, 0.3f, 0.42f
+ 0.11F, 0.3F, 0.42F
}, RVec {
- 0.95f, 0.69f, 0.58f
+ 0.95F, 0.69F, 0.58F
}, RVec {
- 0.29f, 0.1f, 0.68f
+ 0.29F, 0.1F, 0.68F
}, RVec {
- 0.94f, 0.62f, 0.51f
+ 0.94F, 0.62F, 0.51F
},
RVec {
- 0.47f, 0.04f, 0.47f
+ 0.47F, 0.04F, 0.47F
}, RVec {
- 0.34f, 0.71f, 0.52f
+ 0.34F, 0.71F, 0.52F
}
};
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019, 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.
{
// normal box
Matrix3x3 {{
- 8.0f, 0.0f, 0.0f,
- 0.0f, 3.4f, 0.0f,
- 0.0f, 0.0f, 2.0f
+ 8.0F, 0.0F, 0.0F,
+ 0.0F, 3.4F, 0.0F,
+ 0.0F, 0.0F, 2.0F
}},
// triclinic box
Matrix3x3 {{
- 7.0f, 0.0f, 0.0f,
- 0.0f, 4.1f, 0.0f,
- 3.5f, 2.0f, 12.2f
+ 7.0F, 0.0F, 0.0F,
+ 0.0F, 4.1F, 0.0F,
+ 3.5F, 2.0F, 12.2F
}},
};
IVec {
0, 0, 0
}, t_complex {
- 3.5f, 6.7f
+ 3.5F, 6.7F
}
}, {
IVec {
7, 0, 0
}, t_complex {
- -2.5f, -0.7f
+ -2.5F, -0.7F
}
}, {
IVec {
3, 5, 7
}, t_complex {
- -0.006f, 1e-8f
+ -0.006F, 1e-8F
}
}, {
IVec {
3, 1, 2
}, t_complex {
- 0.6f, 7.9f
+ 0.6F, 7.9F
}
}, {
IVec {
6, 2, 4
}, t_complex {
- 30.1f, 2.45f
+ 30.1F, 2.45F
}
}, },
SparseComplexGridValuesInput {{
IVec {
0, 4, 0
}, t_complex {
- 0.0f, 0.3f
+ 0.0F, 0.3F
}
}, {
IVec {
4, 2, 7
}, t_complex {
- 13.76f, -40.0f
+ 13.76F, -40.0F
}
}, {
IVec {
0, 6, 7
}, t_complex {
- 3.6f, 0.0f
+ 3.6F, 0.0F
}
}, {
IVec {
2, 5, 10
}, t_complex {
- 3.6f, 10.65f
+ 3.6F, 10.65F
}
}, }
};
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019, 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.
{
// normal box
Matrix3x3 {{
- 8.0f, 0.0f, 0.0f,
- 0.0f, 3.4f, 0.0f,
- 0.0f, 0.0f, 2.0f
+ 8.0F, 0.0F, 0.0F,
+ 0.0F, 3.4F, 0.0F,
+ 0.0F, 0.0F, 2.0F
}},
// triclinic box
Matrix3x3 {{
- 7.0f, 0.0f, 0.0f,
- 0.0f, 4.1f, 0.0f,
- 3.5f, 2.0f, 12.2f
+ 7.0F, 0.0F, 0.0F,
+ 0.0F, 4.1F, 0.0F,
+ 3.5F, 2.0F, 12.2F
}},
};
//! Random charges
std::vector<real> const c_sampleChargesFull
{
- 4.95f, 3.11f, 3.97f, 1.08f, 2.09f, 1.1f, 4.13f, 3.31f, 2.8f, 5.83f, 5.09f, 6.1f, 2.86f, 0.24f, 5.76f, 5.19f, 0.72f
+ 4.95F, 3.11F, 3.97F, 1.08F, 2.09F, 1.1F, 4.13F, 3.31F, 2.8F, 5.83F, 5.09F, 6.1F, 2.86F, 0.24F, 5.76F, 5.19F, 0.72F
};
//! 1 charge
auto const c_sampleCharges1 = ChargesVector(c_sampleChargesFull).subArray(0, 1);
CoordinatesVector const c_sampleCoordinatesFull
{
{
- 5.59f, 1.37f, 0.95f
+ 5.59F, 1.37F, 0.95F
}, {
- 16.0f, 1.02f, 0.22f // 2 box lengths in x
+ 16.0F, 1.02F, 0.22F // 2 box lengths in x
}, {
- 0.034f, 1.65f, 0.22f
+ 0.034F, 1.65F, 0.22F
}, {
- 0.33f, 0.92f, 1.56f
+ 0.33F, 0.92F, 1.56F
}, {
- 1.16f, 0.75f, 0.39f
+ 1.16F, 0.75F, 0.39F
}, {
- 0.5f, 1.63f, 1.14f
+ 0.5F, 1.63F, 1.14F
}, {
- 16.0001f, 1.52f, 1.19f // > 2 box lengths in x
+ 16.0001F, 1.52F, 1.19F // > 2 box lengths in x
}, {
- 1.43f, 1.1f, 4.1f // > 2 box lengths in z
+ 1.43F, 1.1F, 4.1F // > 2 box lengths in z
}, {
- -1.08f, 1.19f, 0.08f // negative x
+ -1.08F, 1.19F, 0.08F // negative x
}, {
- 1.6f, 0.93f, 0.53f
+ 1.6F, 0.93F, 0.53F
}, {
- 1.32f, -1.48f, 0.16f // negative y
+ 1.32F, -1.48F, 0.16F // negative y
}, {
- 0.87f, 0.0f, 0.33f
+ 0.87F, 0.0F, 0.33F
}, {
- 0.95f, 7.7f, -0.48f // > 2 box lengths in y, negative z
+ 0.95F, 7.7F, -0.48F // > 2 box lengths in y, negative z
}, {
- 1.23f, 0.91f, 0.68f
+ 1.23F, 0.91F, 0.68F
}, {
- 0.19f, 1.45f, 0.94f
+ 0.19F, 1.45F, 0.94F
}, {
- 1.28f, 0.46f, 0.38f
+ 1.28F, 0.46F, 0.38F
}, {
- 1.21f, 0.23f, 1.0f
+ 1.21F, 0.23F, 1.0F
}
};
//! 1 coordinate vector
const gmx_device_info_t *gpuInfo,
PmeGpuProgramHandle pmeGpuProgram,
const Matrix3x3 &box,
- real ewaldCoeff_q = 1.0f,
- real ewaldCoeff_lj = 1.0f
+ real ewaldCoeff_q = 1.0F,
+ real ewaldCoeff_lj = 1.0F
)
{
const MDLogger dummyLogger;
CodePath mode = CodePath::CPU,
const gmx_device_info_t *gpuInfo = nullptr,
PmeGpuProgramHandle pmeGpuProgram = nullptr,
- const Matrix3x3 &box = {{1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}},
- real ewaldCoeff_q = 0.0f, real ewaldCoeff_lj = 0.0f);
+ const Matrix3x3 &box = {{1.0F, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.0F, 1.0F}},
+ real ewaldCoeff_q = 0.0F, real ewaldCoeff_lj = 0.0F);
//! PME initialization with atom data and system box
PmeSafePointer pmeInitAtoms(const t_inputrec *inputRec,
CodePath mode,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
fprintf(out, "BOX\n");
fprintf(out, "%15.9f%15.9f%15.9f",
fr->box[XX][XX], fr->box[YY][YY], fr->box[ZZ][ZZ]);
- if ((fr->box[XX][YY] != 0.0f) || (fr->box[XX][ZZ] != 0.0f) || (fr->box[YY][XX] != 0.0f) ||
- (fr->box[YY][ZZ] != 0.0f) || (fr->box[ZZ][XX] != 0.0f) || (fr->box[ZZ][YY] != 0.0f))
+ if ((fr->box[XX][YY] != 0.0F) || (fr->box[XX][ZZ] != 0.0F) || (fr->box[YY][XX] != 0.0F) ||
+ (fr->box[YY][ZZ] != 0.0F) || (fr->box[ZZ][XX] != 0.0F) || (fr->box[ZZ][YY] != 0.0F))
{
fprintf(out, "%15.9f%15.9f%15.9f%15.9f%15.9f%15.9f",
fr->box[XX][YY], fr->box[XX][ZZ], fr->box[YY][XX],
static void write_hconf_box(FILE *out, const matrix box)
{
- if ((box[XX][YY] != 0.0f) || (box[XX][ZZ] != 0.0f) || (box[YY][XX] != 0.0f) || (box[YY][ZZ] != 0.0f) ||
- (box[ZZ][XX] != 0.0f) || (box[ZZ][YY] != 0.0f))
+ if ((box[XX][YY] != 0.0F) || (box[XX][ZZ] != 0.0F) || (box[YY][XX] != 0.0F) || (box[YY][ZZ] != 0.0F) ||
+ (box[ZZ][XX] != 0.0F) || (box[ZZ][YY] != 0.0F))
{
fprintf(out, "%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n",
box[XX][XX], box[YY][YY], box[ZZ][ZZ],
write_xpm_header(out, title, legend, label_x, label_y, FALSE);
write_xpm_map3(out, n_x, n_y, nlevels, lo, mid, hi, rlo, rmid, rhi);
- writeXpmAxis(out, "x", ArrayRef<real>(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0u ? 1 : 0)));
- writeXpmAxis(out, "y", ArrayRef<real>(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0u ? 1 : 0)));
+ writeXpmAxis(out, "x", ArrayRef<real>(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0U ? 1 : 0)));
+ writeXpmAxis(out, "y", ArrayRef<real>(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0U ? 1 : 0)));
write_xpm_data3(out, n_x, n_y, mat, lo, mid, hi, *nlevels);
}
write_xpm_header(out, title, legend, label_x, label_y, FALSE);
write_xpm_map_split(out, n_x, n_y, nlevel_top, lo_top, hi_top, rlo_top, rhi_top,
bDiscreteColor, nlevel_bot, lo_bot, hi_bot, rlo_bot, rhi_bot);
- writeXpmAxis(out, "x", ArrayRef<real>(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0u ? 1 : 0)));
- writeXpmAxis(out, "y", ArrayRef<real>(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0u ? 1 : 0)));
+ writeXpmAxis(out, "x", ArrayRef<real>(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0U ? 1 : 0)));
+ writeXpmAxis(out, "y", ArrayRef<real>(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0U ? 1 : 0)));
write_xpm_data_split(out, n_x, n_y, mat, lo_top, hi_top, *nlevel_top,
lo_bot, hi_bot, *nlevel_bot);
}
write_xpm_header(out, title, legend, label_x, label_y, FALSE);
write_xpm_map(out, n_x, n_y, nlevels, lo, hi, rlo, rhi);
- writeXpmAxis(out, "x", ArrayRef<real>(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0u ? 1 : 0)));
- writeXpmAxis(out, "y", ArrayRef<real>(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0u ? 1 : 0)));
+ writeXpmAxis(out, "x", ArrayRef<real>(axis_x, axis_x + n_x + ((flags & MAT_SPATIAL_X) != 0U ? 1 : 0)));
+ writeXpmAxis(out, "y", ArrayRef<real>(axis_y, axis_y + n_y + ((flags & MAT_SPATIAL_Y) != 0U ? 1 : 0)));
write_xpm_data(out, n_x, n_y, mat, lo, hi, *nlevels);
}
fprintf(out, "TITLE %s\n", (title && title[0]) ? title : gmx::bromacs().c_str());
- if (box && ( (norm2(box[XX]) != 0.0f) || (norm2(box[YY]) != 0.0f) || (norm2(box[ZZ]) != 0.0f) ) )
+ if (box && ( (norm2(box[XX]) != 0.0F) || (norm2(box[YY]) != 0.0F) || (norm2(box[ZZ]) != 0.0F) ) )
{
gmx_write_pdb_box(out, ePBC, box);
}
}
printf("\n");
- if (filtlen != 0.0f)
+ if (filtlen != 0.0F)
{
filter(filtlen, n, nset, val, dt);
}
{
for (j = i+1; j < n1; j++)
{
- if (mcpy[i][j] != 0.0f)
+ if (mcpy[i][j] != 0.0F)
{
diff = c[j].clust - c[i].clust;
if (diff)
{
for (i1 = i2+1; (i1 < nf); i1++)
{
- if (rms->mat[i1][i2] != 0.0f)
+ if (rms->mat[i1][i2] != 0.0F)
{
rms->mat[i1][i2] = rms->maxrms;
}
int type;
bool bNterm;
- if (at->atom[atom].m != 0.0f)
+ if (at->atom[atom].m != 0.0F)
{
type = at->atom[atom].type;
}
real mass;
bool bNterm;
- if (at->atom[atom].m != 0.0f)
+ if (at->atom[atom].m != 0.0F)
{
mass = at->atom[atom].m;
}
(pindex[atom].functionType() == F_VSITE4FD ) ||
(pindex[atom].functionType() == F_VSITE4FDN ) );
bool bThisOUT = ( (pindex[atom].functionType() == F_VSITE3OUT) &&
- ((interaction_function[cftype].flags & IF_CONSTRAINT) != 0u) );
+ ((interaction_function[cftype].flags & IF_CONSTRAINT) != 0U) );
bAllFD = bAllFD && bThisFD;
if (bThisFD || bThisOUT)
{
// Check whether Hyper-threading is really possible to enable in the hardware,
// not just technically supported by this generation of processors
- if ((features->count(CpuInfo::Feature::X86_Htt) != 0u) && maxStdLevel >= 0x4)
+ if ((features->count(CpuInfo::Feature::X86_Htt) != 0U) && maxStdLevel >= 0x4)
{
executeX86CpuID(0x1, 0, &eax, &ebx, &ecx, &edx);
unsigned int maxLogicalCores = (ebx >> 16) & 0x0ff;
executeX86CpuID(0x1, 0, &eax, &ebx, &ecx, &edx);
int family = ((eax & 0x0ff00000) >> 20) + ((eax & 0x00000f00) >> 8);
executeX86CpuID(0x80000001, 0, &eax, &ebx, &ecx, &edx);
- bool haveExtendedTopology = (ecx & (1 << 22)) != 0u;
+ bool haveExtendedTopology = (ecx & (1 << 22)) != 0U;
// NOTE: Here we assume 1 thread per core, unless we have family >= 17h
layout.hwThreadBits = 0;
if (maxStdLevel >= 0x1)
{
executeX86CpuID(0x1, 0, &eax, &ebx, &ecx, &edx);
- haveX2Apic = ((ecx & (1 << 21)) != 0u) && maxStdLevel >= 0xb;
- haveApic = ((edx & (1 << 9)) != 0u) && maxExtLevel >= 0x80000008;
+ haveX2Apic = ((ecx & (1 << 21)) != 0U) && maxStdLevel >= 0xb;
+ haveApic = ((edx & (1 << 9)) != 0U) && maxExtLevel >= 0x80000008;
}
else
{
// testNames map above, and if it's a match return the vendor.
for (auto &l : { "vendor_id", "vendor", "manufacture", "model", "processor", "cpu" })
{
- if (cpuInfo.count(l) != 0u)
+ if (cpuInfo.count(l) != 0U)
{
// there was a line with this left-hand side in /proc/cpuinfo
const std::string &s1 = cpuInfo.at(l);
std::set<CpuInfo::Feature> * features)
{
// Get brand string from 'cpu' label if present, otherwise 'Processor'
- if (cpuInfo.count("cpu") != 0u)
+ if (cpuInfo.count("cpu") != 0U)
{
*brand = cpuInfo.at("cpu");
}
- else if (cpuInfo.count("Processor") != 0u)
+ else if (cpuInfo.count("Processor") != 0U)
{
*brand = cpuInfo.at("Processor");
}
for (auto &l : { "model name", "model", "Processor", "cpu" })
{
- if (cpuInfo.count(l) != 0u)
+ if (cpuInfo.count(l) != 0U)
{
std::string s1 = cpuInfo.at(l);
std::transform(s1.begin(), s1.end(), s1.begin(), ::tolower);
int * stepping,
std::set<CpuInfo::Feature> * features)
{
- if (cpuInfo.count("Processor") != 0u)
+ if (cpuInfo.count("Processor") != 0U)
{
*brand = cpuInfo.at("Processor");
}
- else if (cpuInfo.count("model name") != 0u)
+ else if (cpuInfo.count("model name") != 0U)
{
*brand = cpuInfo.at("model name");
}
- if (cpuInfo.count("CPU architecture") != 0u)
+ if (cpuInfo.count("CPU architecture") != 0U)
{
*family = std::strtol(cpuInfo.at("CPU architecture").c_str(), nullptr, 10);
// For some 64-bit CPUs it appears to say 'AArch64' instead
*family = 8; // fragile - no idea how a future ARMv9 will be represented in this case
}
}
- if (cpuInfo.count("CPU variant") != 0u)
+ if (cpuInfo.count("CPU variant") != 0U)
{
*model = std::strtol(cpuInfo.at("CPU variant").c_str(), nullptr, 16);
}
- if (cpuInfo.count("CPU revision") != 0u)
+ if (cpuInfo.count("CPU revision") != 0U)
{
*stepping = std::strtol(cpuInfo.at("CPU revision").c_str(), nullptr, 10);
}
- if (cpuInfo.count("Features") != 0u)
+ if (cpuInfo.count("Features") != 0U)
{
const std::string &s = cpuInfo.at("Features");
if (s.find("neon") != std::string::npos)
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2004 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2018,2019, 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.
*rnorm = F77_FUNC(dnrm2, DNRM2) (n, &resid[1], &c__1);
}
- if (*rnorm > workd[*n * 3 + 4] * .717f)
+ if (*rnorm > workd[*n * 3 + 4] * .717F)
{
goto L50;
}
*rnorm = F77_FUNC(dnrm2, DNRM2) (n, &resid[1], &c__1);
}
- if (*rnorm > workd[*n * 3 + 3] * .717f)
+ if (*rnorm > workd[*n * 3 + 3] * .717F)
{
goto L100;
}
}
- if (workd[*n * 3 + 2] > *rnorm * .717f)
+ if (workd[*n * 3 + 2] > *rnorm * .717F)
{
*rnorm = workd[*n * 3 + 2];
*rnorm = F77_FUNC(snrm2, SNRM2) (n, &resid[1], &c__1);
}
- if (*rnorm > workd[*n * 3 + 4] * .717f)
+ if (*rnorm > workd[*n * 3 + 4] * .717F)
{
goto L50;
}
*rnorm = F77_FUNC(snrm2, SNRM2) (n, &resid[1], &c__1);
}
- if (*rnorm > workd[*n * 3 + 3] * .717f)
+ if (*rnorm > workd[*n * 3 + 3] * .717F)
{
goto L100;
}
}
- if (workd[*n * 3 + 2] > *rnorm * .717f)
+ if (workd[*n * 3 + 2] > *rnorm * .717F)
{
*rnorm = workd[*n * 3 + 2];
std::vector<iListInput> c_InputBonds =
{
{ iListInput().setHarmonic(F_BONDS, 0.15, 500.0) },
- { iListInput(2e-6f, 1e-8).setHarmonic(F_BONDS, 0.15, 500.0, 0.17, 400.0) },
- { iListInput(1e-4f, 1e-8).setHarmonic(F_G96BONDS, 0.15, 50.0) },
+ { iListInput(2e-6F, 1e-8).setHarmonic(F_BONDS, 0.15, 500.0, 0.17, 400.0) },
+ { iListInput(1e-4F, 1e-8).setHarmonic(F_G96BONDS, 0.15, 50.0) },
{ iListInput().setHarmonic(F_G96BONDS, 0.15, 50.0, 0.17, 40.0) },
{ iListInput().setCubic(0.16, 50.0, 2.0) },
- { iListInput(2e-6f, 1e-8).setMorse(0.15, 50.0, 2.0, 0.17, 40.0, 1.6) },
- { iListInput(2e-6f, 1e-8).setMorse(0.15, 30.0, 2.7) },
+ { iListInput(2e-6F, 1e-8).setMorse(0.15, 50.0, 2.0, 0.17, 40.0, 1.6) },
+ { iListInput(2e-6F, 1e-8).setMorse(0.15, 30.0, 2.7) },
{ iListInput().setFene(0.4, 5.0) }
};
ftype_is_bonded_potential(int ftype)
{
return
- ((interaction_function[ftype].flags & IF_BOND) != 0u) &&
+ ((interaction_function[ftype].flags & IF_BOND) != 0U) &&
!(ftype == F_CONNBONDS || ftype == F_POSRES || ftype == F_FBPOSRES);
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2019, 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.
{
float xabs = std::abs(x);
- if (xabs > 1.0f)
+ if (xabs > 1.0F)
{
return std::nan("");
}
- if (x == 1.0f)
+ if (x == 1.0F)
{
return std::numeric_limits<float>::infinity();
}
- if (x == -1.0f)
+ if (x == -1.0F)
{
return -std::numeric_limits<float>::infinity();
}
float res;
- if (xabs <= 0.7f)
+ if (xabs <= 0.7F)
{
// Rational approximation in range [0,0.7]
float z = x*x;
- float P = (((-0.140543331f * z + 0.914624893f) * z - 1.645349621f) * z + 0.886226899f);
- float Q = ((((0.012229801f * z - 0.329097515f) * z + 1.442710462f) * z - 2.118377725f) * z + 1.0f);
+ float P = (((-0.140543331F * z + 0.914624893F) * z - 1.645349621F) * z + 0.886226899F);
+ float Q = ((((0.012229801F * z - 0.329097515F) * z + 1.442710462F) * z - 2.118377725F) * z + 1.0F);
res = x * P/Q;
}
else
{
// Rational approximation in range [0.7,1)
- float z = std::sqrt(-std::log((1.0 - std::abs(x))/2.0f));
- float P = ((1.641345311f * z + 3.429567803f) * z - 1.624906493f) * z - 1.970840454f;
- float Q = (1.637067800f * z + 3.543889200f) * z + 1.0f;
- res = std::copysign(1.0f, x) * P/Q;
+ float z = std::sqrt(-std::log((1.0 - std::abs(x))/2.0F));
+ float P = ((1.641345311F * z + 3.429567803F) * z - 1.624906493F) * z - 1.970840454F;
+ float Q = (1.637067800F * z + 3.543889200F) * z + 1.0F;
+ res = std::copysign(1.0F, x) * P/Q;
}
// Single N-R iteration sufficient for single precision
- res = res - (std::erf(res) - x)/( (2.0f/std::sqrt(M_PI))*std::exp(-res*res));
+ res = res - (std::erf(res) - x)/( (2.0F/std::sqrt(M_PI))*std::exp(-res*res));
return res;
}
static inline float
invsqrt(float x)
{
- return 1.0f/std::sqrt(x);
+ return 1.0F/std::sqrt(x);
}
/*! \brief Calculate 1.0/sqrt(x) in double precision, but single range
static inline float
invcbrt(float x)
{
- return 1.0f/std::cbrt(x);
+ return 1.0F/std::cbrt(x);
}
/*! \brief Calculate inverse sixth root of x in double precision
case epctSURFACETENSION:
/* ir->ref_p[0/1] is the reference surface-tension times *
* the number of surfaces */
- if (ir->compress[ZZ][ZZ] != 0.0f)
+ if (ir->compress[ZZ][ZZ] != 0.0F)
{
p_corr_z = dt/ir->tau_p*(ir->ref_p[ZZ][ZZ] - pres[ZZ][ZZ]);
}
* but even with a step of 0.1 ms the difference is less than 1%
* of the step time.
*/
- const float gpuWaitApiOverheadMargin = 2e6f; /* cycles */
+ const float gpuWaitApiOverheadMargin = 2e6F; /* cycles */
wallcycle_start(wcycle, ewcWAIT_GPU_NB_L);
Nbnxm::gpu_wait_finish_task(nbv->gpu_nbv,
if (!ir->bContinuation)
{
- if (state->flags & (1u << estV))
+ if (state->flags & (1U << estV))
{
auto v = makeArrayRef(state->v);
/* Set the velocities of vsites, shells and frozen atoms to zero */
/* With all integrators, except VV, we need to retain the pressure
* at the current step for coupling at the next step.
*/
- if ((state->flags & (1u<<estPRES_PREV)) &&
+ if ((state->flags & (1U<<estPRES_PREV)) &&
(bGStatEveryStep ||
(ir->nstpcouple > 0 && step % ir->nstpcouple == 0)))
{
struct mpi_in_place_buf_t;
struct gmx_domdec_t;
-#define DUTY_PP (1u<<0u)
-#define DUTY_PME (1u<<1u)
+#define DUTY_PP (1U<<0U)
+#define DUTY_PME (1U<<1U)
typedef struct {
int bUse;
//! Returns whether any atom in the cluster is perturbed
bool clusterIsPerturbed(int clusterIndex) const
{
- return fep_[clusterIndex] != 0u;
+ return fep_[clusterIndex] != 0U;
}
//! Returns whether the given atom in the cluster is perturbed
bool atomIsPerturbed(int clusterIndex,
int atomIndexInCluster) const
{
- return (fep_[clusterIndex] & (1 << atomIndexInCluster)) != 0u;
+ return (fep_[clusterIndex] & (1 << atomIndexInCluster)) != 0U;
}
//! Returns the free-energy perturbation bits for the cluster
break;
}
rvec_sub(newCom, com, shift);
- if (norm2(shift) != 0.0f)
+ if (norm2(shift) != 0.0F)
{
if (debug)
{
else if (ir->eI == eiBD)
{
real mbd;
- if (ir->bd_fric != 0.0f)
+ if (ir->bd_fric != 0.0F)
{
mbd = ir->bd_fric*ir->delta_t;
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019, 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.
simd4SetZeroF()
{
return {
- vdupq_n_f32(0.0f)
+ vdupq_n_f32(0.0F)
};
}
{
// Convert x to nearest integer
float32x4_t signBitOfX = vreinterpretq_f32_u32(vandq_u32(vdupq_n_u32(0x80000000), vreinterpretq_u32_f32(x.simdInternal_)));
- float32x4_t half = vdupq_n_f32(0.5f);
+ float32x4_t half = vdupq_n_f32(0.5F);
float32x4_t corr = vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(half), vreinterpretq_u32_f32(signBitOfX)));
int32x4_t integerX = vcvtq_s32_f32(vaddq_f32(x.simdInternal_, corr));
c = a * b;
/* set 4th element to 0, then add all of them */
- c.simdInternal_ = vsetq_lane_f32(0.0f, c.simdInternal_, 3);
+ c.simdInternal_ = vsetq_lane_f32(0.0F, c.simdInternal_, 3);
return reduce(c);
}
#endif
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2019, 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.
setZeroF()
{
return {
- vdupq_n_f32(0.0f)
+ vdupq_n_f32(0.0F)
};
}
// The result will always be correct since we mask the result with m, but
// for debug builds we also want to make sure not to generate FP exceptions
#ifndef NDEBUG
- x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0f));
+ x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0F));
#endif
return {
vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vrsqrteq_f32(x.simdInternal_)),
// The result will always be correct since we mask the result with m, but
// for debug builds we also want to make sure not to generate FP exceptions
#ifndef NDEBUG
- x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0f));
+ x.simdInternal_ = vbslq_f32(m.simdInternal_, x.simdInternal_, vdupq_n_f32(1.0F));
#endif
return {
vreinterpretq_f32_u32(vandq_u32(vreinterpretq_u32_f32(vrecpeq_f32(x.simdInternal_)),
const int32x4_t exponentMask = vdupq_n_s32(0x7F800000);
const int32x4_t mantissaMask = vdupq_n_s32(0x807FFFFF);
const int32x4_t exponentBias = vdupq_n_s32(126); // add 1 to make our definition identical to frexp()
- const float32x4_t half = vdupq_n_f32(0.5f);
+ const float32x4_t half = vdupq_n_f32(0.5F);
int32x4_t iExponent;
iExponent = vandq_s32(vreinterpretq_s32_f32(value.simdInternal_), exponentMask);
cvtR2I(SimdFloat a)
{
float32x4_t signBitOfA = vreinterpretq_f32_u32(vandq_u32(vdupq_n_u32(0x80000000), vreinterpretq_u32_f32(a.simdInternal_)));
- float32x4_t half = vdupq_n_f32(0.5f);
+ float32x4_t half = vdupq_n_f32(0.5F);
float32x4_t corr = vreinterpretq_f32_u32(vorrq_u32(vreinterpretq_u32_f32(half), vreinterpretq_u32_f32(signBitOfA)));
return {
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019, 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.
{
// Extra elements means we can use full width-4 load/store operations
float32x4x2_t t0 = vuzpq_f32(v0.simdInternal_, v2.simdInternal_);
- float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0f));
+ float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0F));
float32x4x2_t t2 = vtrnq_f32(t0.val[0], t1.val[0]);
float32x4x2_t t3 = vtrnq_f32(t0.val[1], t1.val[1]);
float32x4_t t4 = t2.val[0];
{
// Extra elements means we can use full width-4 load/store operations
float32x4x2_t t0 = vuzpq_f32(v0.simdInternal_, v2.simdInternal_);
- float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0f));
+ float32x4x2_t t1 = vuzpq_f32(v1.simdInternal_, vdupq_n_f32(0.0F));
float32x4x2_t t2 = vtrnq_f32(t0.val[0], t1.val[0]);
float32x4x2_t t3 = vtrnq_f32(t0.val[1], t1.val[1]);
float32x4_t t4 = t2.val[0];
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019, 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.
c = a * b;
/* set 4th element to 0, then add all of them */
- c.simdInternal_ = vsetq_lane_f32(0.0f, c.simdInternal_, 3);
+ c.simdInternal_ = vsetq_lane_f32(0.0F, c.simdInternal_, 3);
return reduce(c);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2019, 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.
maskzRsqrt(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- SimdFloat one(1.0f);
+ SimdFloat one(1.0F);
x.simdInternal_ = vec_sel(one.simdInternal_, x.simdInternal_, m.simdInternal_);
#endif
return {
maskzRcp(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- SimdFloat one(1.0f);
+ SimdFloat one(1.0F);
x.simdInternal_ = vec_sel(one.simdInternal_, x.simdInternal_, m.simdInternal_);
#endif
return {
const __vector signed int exponentMask = vec_sl(vec_add(vec_splat_s32(15), vec_sl(vec_splat_s32(15), vec_splat_u32(4))),
vec_add(vec_splat_u32(15), vec_splat_u32(8))); // 0x7F800000
const __vector signed int exponentBias = vec_sub(vec_sl(vec_splat_s32(1), vec_splat_u32(7)), vec_splat_s32(2)); // 126
- const SimdFloat half(0.5f);
+ const SimdFloat half(0.5F);
__vector signed int iExponent;
iExponent = vec_and(reinterpret_cast<__vector signed int>(value.simdInternal_), exponentMask);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018,2019, 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.
simd4SetZeroF()
{
return {
- vec_splats(0.0f)
+ vec_splats(0.0F)
};
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019, 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.
setZeroF()
{
return {
- vec_splats(0.0f)
+ vec_splats(0.0F)
};
}
maskzRsqrt(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = vec_sel(vec_splats(1.0f), x.simdInternal_, m.simdInternal_);
+ x.simdInternal_ = vec_sel(vec_splats(1.0F), x.simdInternal_, m.simdInternal_);
#endif
return {
vec_and(vec_rsqrte(x.simdInternal_), reinterpret_cast<__vector float>(m.simdInternal_))
maskzRcp(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = vec_sel(vec_splats(1.0f), x.simdInternal_, m.simdInternal_);
+ x.simdInternal_ = vec_sel(vec_splats(1.0F), x.simdInternal_, m.simdInternal_);
#endif
return {
vec_and(vec_re(x.simdInternal_), reinterpret_cast<__vector float>(m.simdInternal_))
{
const __vector float exponentMask = reinterpret_cast<__vector float>(vec_splats(0x7F800000U));
const __vector signed int exponentBias = vec_splats(126);
- const __vector float half = vec_splats(0.5f);
+ const __vector float half = vec_splats(0.5F);
__vector signed int iExponent;
iExponent = reinterpret_cast<__vector signed int>(vec_and(value.simdInternal_, exponentMask));
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019, 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.
SimdFloat v3;
__vector float t0 = vec_mergeh(v0.simdInternal_, v2.simdInternal_);
__vector float t1 = vec_mergel(v0.simdInternal_, v2.simdInternal_);
- __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0f));
- __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0f));
+ __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0F));
+ __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0F));
v0.simdInternal_ = vec_mergeh(t0, t2);
v1.simdInternal_ = vec_mergel(t0, t2);
v2.simdInternal_ = vec_mergeh(t1, t3);
SimdFloat v3;
__vector float t0 = vec_mergeh(v0.simdInternal_, v2.simdInternal_);
__vector float t1 = vec_mergel(v0.simdInternal_, v2.simdInternal_);
- __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0f));
- __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0f));
+ __vector float t2 = vec_mergeh(v1.simdInternal_, vec_splats(0.0F));
+ __vector float t3 = vec_mergel(v1.simdInternal_, vec_splats(0.0F));
v0.simdInternal_ = vec_mergeh(t0, t2);
v1.simdInternal_ = vec_mergel(t0, t2);
v2.simdInternal_ = vec_mergeh(t1, t3);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019, 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.
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
// sic - we only use single precision for the lookup
- res.simdInternal_[i] = 1.0f / std::sqrt(static_cast<float>(x.simdInternal_[i]));
+ res.simdInternal_[i] = 1.0F / std::sqrt(static_cast<float>(x.simdInternal_[i]));
}
return res;
};
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2019, 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.
static inline Simd4Float gmx_simdcall
simd4SetZeroF()
{
- return Simd4Float(0.0f);
+ return Simd4Float(0.0F);
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = 1.0f / std::sqrt(x.simdInternal_[i]);
+ res.simdInternal_[i] = 1.0F / std::sqrt(x.simdInternal_[i]);
}
return res;
};
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0f;
+ res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0F;
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0f : a.simdInternal_[i];
+ res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0F : a.simdInternal_[i];
}
return res;
}
static inline float gmx_simdcall
reduce(Simd4Float a)
{
- float sum = 0.0f;
+ float sum = 0.0F;
for (std::size_t i = 0; i < a.simdInternal_.size(); i++)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2019, 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.
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
// sic - we only use single precision for the lookup
- res.simdInternal_[i] = 1.0f / std::sqrt(static_cast<float>(x.simdInternal_[i]));
+ res.simdInternal_[i] = 1.0F / std::sqrt(static_cast<float>(x.simdInternal_[i]));
}
return res;
};
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
// sic - we only use single precision for the lookup
- res.simdInternal_[i] = 1.0f / static_cast<float>(x.simdInternal_[i]);
+ res.simdInternal_[i] = 1.0F / static_cast<float>(x.simdInternal_[i]);
}
return res;
};
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
// sic - we only use single precision for the lookup
- res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / std::sqrt(static_cast<float>(x.simdInternal_[i])) : 0.0;
+ res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / std::sqrt(static_cast<float>(x.simdInternal_[i])) : 0.0;
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / static_cast<float>(x.simdInternal_[i]) : 0.0;
+ res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / static_cast<float>(x.simdInternal_[i]) : 0.0;
}
return res;
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2019, 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.
* You should typically just call \ref gmx::setZero(), which uses proxy objects
* internally to handle all types rather than adding the suffix used here.
*
- * \return SIMD 0.0f
+ * \return SIMD 0.0F
*/
static inline SimdFloat gmx_simdcall
setZeroF()
{
- return SimdFloat(0.0f);
+ return SimdFloat(0.0F);
}
/*! \} */
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = 1.0f / std::sqrt(x.simdInternal_[i]);
+ res.simdInternal_[i] = 1.0F / std::sqrt(x.simdInternal_[i]);
}
return res;
};
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = 1.0f / x.simdInternal_[i];
+ res.simdInternal_[i] = 1.0F / x.simdInternal_[i];
}
return res;
};
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = a.simdInternal_[i] + (m.simdInternal_[i] ? b.simdInternal_[i] : 0.0f);
+ res.simdInternal_[i] = a.simdInternal_[i] + (m.simdInternal_[i] ? b.simdInternal_[i] : 0.0F);
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i]) : 0.0f;
+ res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i]) : 0.0F;
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i] + c.simdInternal_[i]) : 0.0f;
+ res.simdInternal_[i] = m.simdInternal_[i] ? (a.simdInternal_[i] * b.simdInternal_[i] + c.simdInternal_[i]) : 0.0F;
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / std::sqrt(x.simdInternal_[i]) : 0.0f;
+ res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / std::sqrt(x.simdInternal_[i]) : 0.0F;
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0f / x.simdInternal_[i] : 0.0f;
+ res.simdInternal_[i] = (m.simdInternal_[i] != 0) ? 1.0F / x.simdInternal_[i] : 0.0F;
}
return res;
}
static inline float gmx_simdcall
reduce(SimdFloat a)
{
- float sum = 0.0f;
+ float sum = 0.0F;
for (std::size_t i = 0; i < a.simdInternal_.size(); i++)
{
/*! \brief Return true if any bits are set in the single precision SIMD.
*
* This function is used to handle bitmasks, mainly for exclusions in the
- * inner kernels. Note that it will return true even for -0.0f (sign bit set),
+ * inner kernels. Note that it will return true even for -0.0F (sign bit set),
* so it is not identical to not-equal.
*
* \param a value
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0f;
+ res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0F;
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0f : a.simdInternal_[i];
+ res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0F : a.simdInternal_[i];
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0f;
+ res.simdInternal_[i] = mask.simdInternal_[i] ? a.simdInternal_[i] : 0.0F;
}
return res;
}
for (std::size_t i = 0; i < res.simdInternal_.size(); i++)
{
- res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0f : a.simdInternal_[i];
+ res.simdInternal_[i] = mask.simdInternal_[i] ? 0.0F : a.simdInternal_[i];
}
return res;
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019, 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.
SimdFloat v1)
{
// The 4 here corresponds to the 4 elements in memory, not any SIMD width
- float sum[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
+ float sum[4] = { 0.0F, 0.0F, 0.0F, 0.0F };
for (std::size_t i = 0; i < v0.simdInternal_.size()/2; i++)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019, 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.
maskzRsqrt(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0f), x.simdInternal_, m.simdInternal_);
+ x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0F), x.simdInternal_, m.simdInternal_);
#endif
return {
_mm256_and_ps(_mm256_rsqrt_ps(x.simdInternal_), m.simdInternal_)
maskzRcp(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0f), x.simdInternal_, m.simdInternal_);
+ x.simdInternal_ = _mm256_blendv_ps(_mm256_set1_ps(1.0F), x.simdInternal_, m.simdInternal_);
#endif
return {
_mm256_and_ps(_mm256_rcp_ps(x.simdInternal_), m.simdInternal_)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2019, 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.
static inline SimdFloat gmx_simdcall
exp(SimdFloat x)
{
- const __m512 argscale = _mm512_set1_ps(1.44269504088896341f);
- const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623f);
+ const __m512 argscale = _mm512_set1_ps(1.44269504088896341F);
+ const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623F);
if (opt == MathOptimization::Safe)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2019, 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.
static inline SimdFloat gmx_simdcall
exp(SimdFloat x)
{
- const __m512 argscale = _mm512_set1_ps(1.44269504088896341f);
- const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623f);
+ const __m512 argscale = _mm512_set1_ps(1.44269504088896341F);
+ const __m512 invargscale = _mm512_set1_ps(-0.69314718055994528623F);
if (opt == MathOptimization::Safe)
{
log(SimdFloat x)
{
return {
- _mm512_mul_ps(_mm512_set1_ps(0.693147180559945286226764f), _mm512_log2ae23_ps(x.simdInternal_))
+ _mm512_mul_ps(_mm512_set1_ps(0.693147180559945286226764F), _mm512_log2ae23_ps(x.simdInternal_))
};
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2019, 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.
maskzRsqrt(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0f)), _mm_and_ps(m.simdInternal_, x.simdInternal_));
+ x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0F)), _mm_and_ps(m.simdInternal_, x.simdInternal_));
#endif
return {
_mm_and_ps(_mm_rsqrt_ps(x.simdInternal_), m.simdInternal_)
maskzRcp(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0f)), _mm_and_ps(m.simdInternal_, x.simdInternal_));
+ x.simdInternal_ = _mm_or_ps(_mm_andnot_ps(m.simdInternal_, _mm_set1_ps(1.0F)), _mm_and_ps(m.simdInternal_, x.simdInternal_));
#endif
return {
_mm_and_ps(_mm_rcp_ps(x.simdInternal_), m.simdInternal_)
const __m128 exponentMask = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000));
const __m128 mantissaMask = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF));
const __m128i exponentBias = _mm_set1_epi32(126); // add 1 to make our definition identical to frexp()
- const __m128 half = _mm_set1_ps(0.5f);
+ const __m128 half = _mm_set1_ps(0.5F);
__m128i iExponent;
iExponent = _mm_castps_si128(_mm_and_ps(value.simdInternal_, exponentMask));
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2019, 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.
maskzRsqrt(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0f), x.simdInternal_, m.simdInternal_);
+ x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0F), x.simdInternal_, m.simdInternal_);
#endif
return {
_mm_and_ps(_mm_rsqrt_ps(x.simdInternal_), m.simdInternal_)
maskzRcp(SimdFloat x, SimdFBool m)
{
#ifndef NDEBUG
- x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0f), x.simdInternal_, m.simdInternal_);
+ x.simdInternal_ = _mm_blendv_ps(_mm_set1_ps(1.0F), x.simdInternal_, m.simdInternal_);
#endif
return {
_mm_and_ps(_mm_rcp_ps(x.simdInternal_), m.simdInternal_)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018,2019, 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.
static inline float
maskAdd(float a, float b, float m)
{
- return a + (m != 0.0f ? b : 0.0f);
+ return a + (m != 0.0F ? b : 0.0F);
}
/*! \brief Multiply two float variables, masked version.
static inline float
maskzMul(float a, float b, float m)
{
- return m != 0.0f ? (a * b) : 0.0f;
+ return m != 0.0F ? (a * b) : 0.0F;
}
/*! \brief Float fused multiply-add, masked version.
static inline float
maskzFma(float a, float b, float c, float m)
{
- return m != 0.0f ? (a * b + c) : 0.0f;
+ return m != 0.0F ? (a * b + c) : 0.0F;
}
/*! \brief Float Floating-point abs().
static inline float
selectByMask(float a, bool mask)
{
- return mask ? a : 0.0f;
+ return mask ? a : 0.0F;
}
/*! \brief Select from single precision variable where boolean is false.
static inline float
selectByNotMask(float a, bool mask)
{
- return mask ? 0.0f : a;
+ return mask ? 0.0F : a;
}
/*! \brief Blend float selection.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2019, 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.
static inline float
inv(float x)
{
- return 1.0f/x;
+ return 1.0F/x;
}
/*! \brief Calculate 1/sqrt(x) for masked entry of float.
static inline float
maskzInvsqrt(float x, bool m)
{
- return m ? invsqrt(x) : 0.0f;
+ return m ? invsqrt(x) : 0.0F;
}
/*! \brief Calculate 1/x for masked entry of float.
static inline float
maskzInv(float x, bool m)
{
- return m ? inv(x) : 0.0f;
+ return m ? inv(x) : 0.0F;
}
/*! \brief Float sqrt(x). This is the square root.
static inline float
pmeForceCorrection(float z2)
{
- const float FN6(-1.7357322914161492954e-8f);
- const float FN5(1.4703624142580877519e-6f);
- const float FN4(-0.000053401640219807709149f);
- const float FN3(0.0010054721316683106153f);
- const float FN2(-0.019278317264888380590f);
- const float FN1(0.069670166153766424023f);
- const float FN0(-0.75225204789749321333f);
+ const float FN6(-1.7357322914161492954e-8F);
+ const float FN5(1.4703624142580877519e-6F);
+ const float FN4(-0.000053401640219807709149F);
+ const float FN3(0.0010054721316683106153F);
+ const float FN2(-0.019278317264888380590F);
+ const float FN1(0.069670166153766424023F);
+ const float FN0(-0.75225204789749321333F);
- const float FD4(0.0011193462567257629232f);
- const float FD3(0.014866955030185295499f);
- const float FD2(0.11583842382862377919f);
- const float FD1(0.50736591960530292870f);
- const float FD0(1.0f);
+ const float FD4(0.0011193462567257629232F);
+ const float FD3(0.014866955030185295499F);
+ const float FD2(0.11583842382862377919F);
+ const float FD1(0.50736591960530292870F);
+ const float FD0(1.0F);
float z4;
float polyFN0, polyFN1, polyFD0, polyFD1;
static inline float
pmePotentialCorrection(float z2)
{
- const float VN6(1.9296833005951166339e-8f);
- const float VN5(-1.4213390571557850962e-6f);
- const float VN4(0.000041603292906656984871f);
- const float VN3(-0.00013134036773265025626f);
- const float VN2(0.038657983986041781264f);
- const float VN1(0.11285044772717598220f);
- const float VN0(1.1283802385263030286f);
+ const float VN6(1.9296833005951166339e-8F);
+ const float VN5(-1.4213390571557850962e-6F);
+ const float VN4(0.000041603292906656984871F);
+ const float VN3(-0.00013134036773265025626F);
+ const float VN2(0.038657983986041781264F);
+ const float VN1(0.11285044772717598220F);
+ const float VN0(1.1283802385263030286F);
- const float VD3(0.0066752224023576045451f);
- const float VD2(0.078647795836373922256f);
- const float VD1(0.43336185284710920150f);
- const float VD0(1.0f);
+ const float VD3(0.0066752224023576045451F);
+ const float VD2(0.078647795836373922256F);
+ const float VD1(0.43336185284710920150F);
+ const float VD0(1.0F);
float z4;
float polyVN0, polyVN1, polyVD0, polyVD1;
static inline double
invSingleAccuracy(double x)
{
- return 1.0f/x;
+ return 1.0F/x;
}
/*! \brief Calculate 1/sqrt(x) for masked entry of double, but with single accuracy.
static inline double
pmeForceCorrectionSingleAccuracy(double z2)
{
- const float FN6(-1.7357322914161492954e-8f);
- const float FN5(1.4703624142580877519e-6f);
- const float FN4(-0.000053401640219807709149f);
- const float FN3(0.0010054721316683106153f);
- const float FN2(-0.019278317264888380590f);
- const float FN1(0.069670166153766424023f);
- const float FN0(-0.75225204789749321333f);
+ const float FN6(-1.7357322914161492954e-8F);
+ const float FN5(1.4703624142580877519e-6F);
+ const float FN4(-0.000053401640219807709149F);
+ const float FN3(0.0010054721316683106153F);
+ const float FN2(-0.019278317264888380590F);
+ const float FN1(0.069670166153766424023F);
+ const float FN0(-0.75225204789749321333F);
- const float FD4(0.0011193462567257629232f);
- const float FD3(0.014866955030185295499f);
- const float FD2(0.11583842382862377919f);
- const float FD1(0.50736591960530292870f);
- const float FD0(1.0f);
+ const float FD4(0.0011193462567257629232F);
+ const float FD3(0.014866955030185295499F);
+ const float FD2(0.11583842382862377919F);
+ const float FD1(0.50736591960530292870F);
+ const float FD0(1.0F);
float z4;
float polyFN0, polyFN1, polyFD0, polyFD1;
static inline double
pmePotentialCorrectionSingleAccuracy(double z2)
{
- const float VN6(1.9296833005951166339e-8f);
- const float VN5(-1.4213390571557850962e-6f);
- const float VN4(0.000041603292906656984871f);
- const float VN3(-0.00013134036773265025626f);
- const float VN2(0.038657983986041781264f);
- const float VN1(0.11285044772717598220f);
- const float VN0(1.1283802385263030286f);
-
- const float VD3(0.0066752224023576045451f);
- const float VD2(0.078647795836373922256f);
- const float VD1(0.43336185284710920150f);
- const float VD0(1.0f);
+ const float VN6(1.9296833005951166339e-8F);
+ const float VN5(-1.4213390571557850962e-6F);
+ const float VN4(0.000041603292906656984871F);
+ const float VN3(-0.00013134036773265025626F);
+ const float VN2(0.038657983986041781264F);
+ const float VN1(0.11285044772717598220F);
+ const float VN0(1.1283802385263030286F);
+
+ const float VD3(0.0066752224023576045451F);
+ const float VD2(0.078647795836373922256F);
+ const float VD1(0.43336185284710920150F);
+ const float VD0(1.0F);
float z4;
float polyVN0, polyVN1, polyVD0, polyVD1;
{
public:
//!\brief Conversion method that returns 0.0 as float
- operator float() const { return 0.0f; }
+ operator float() const { return 0.0F; }
//!\brief Conversion method that returns 0.0 as double
operator double() const { return 0.0; }
//!\brief Conversion method that returns 0.0 as int32
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018,2019, 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.
rsqrtIter(SimdFloat lu, SimdFloat x)
{
SimdFloat tmp1 = x*lu;
- SimdFloat tmp2 = SimdFloat(-0.5f)*lu;
- tmp1 = fma(tmp1, lu, SimdFloat(-3.0f));
+ SimdFloat tmp2 = SimdFloat(-0.5F)*lu;
+ tmp1 = fma(tmp1, lu, SimdFloat(-3.0F));
return tmp1*tmp2;
}
#endif
static inline SimdFloat gmx_simdcall
rcpIter(SimdFloat lu, SimdFloat x)
{
- return lu*fnma(lu, x, SimdFloat(2.0f));
+ return lu*fnma(lu, x, SimdFloat(2.0F));
}
#endif
static inline SimdFloat gmx_simdcall
log(SimdFloat x)
{
- const SimdFloat one(1.0f);
- const SimdFloat two(2.0f);
- const SimdFloat invsqrt2(1.0f/std::sqrt(2.0f));
- const SimdFloat corr(0.693147180559945286226764f);
- const SimdFloat CL9(0.2371599674224853515625f);
- const SimdFloat CL7(0.285279005765914916992188f);
- const SimdFloat CL5(0.400005519390106201171875f);
- const SimdFloat CL3(0.666666567325592041015625f);
- const SimdFloat CL1(2.0f);
+ const SimdFloat one(1.0F);
+ const SimdFloat two(2.0F);
+ const SimdFloat invsqrt2(1.0F/std::sqrt(2.0F));
+ const SimdFloat corr(0.693147180559945286226764F);
+ const SimdFloat CL9(0.2371599674224853515625F);
+ const SimdFloat CL7(0.285279005765914916992188F);
+ const SimdFloat CL5(0.400005519390106201171875F);
+ const SimdFloat CL3(0.666666567325592041015625F);
+ const SimdFloat CL1(2.0F);
SimdFloat fExp, x2, p;
SimdFBool m;
SimdFInt32 iExp;
static inline SimdFloat gmx_simdcall
exp2(SimdFloat x)
{
- const SimdFloat CC6(0.0001534581200287996416911311f);
- const SimdFloat CC5(0.001339993121934088894618990f);
- const SimdFloat CC4(0.009618488957115180159497841f);
- const SimdFloat CC3(0.05550328776964726865751735f);
- const SimdFloat CC2(0.2402264689063408646490722f);
- const SimdFloat CC1(0.6931472057372680777553816f);
- const SimdFloat one(1.0f);
+ const SimdFloat CC6(0.0001534581200287996416911311F);
+ const SimdFloat CC5(0.001339993121934088894618990F);
+ const SimdFloat CC4(0.009618488957115180159497841F);
+ const SimdFloat CC3(0.05550328776964726865751735F);
+ const SimdFloat CC2(0.2402264689063408646490722F);
+ const SimdFloat CC1(0.6931472057372680777553816F);
+ const SimdFloat one(1.0F);
SimdFloat intpart;
SimdFloat fexppart;
static inline SimdFloat gmx_simdcall
exp(SimdFloat x)
{
- const SimdFloat argscale(1.44269504088896341f);
- const SimdFloat invargscale0(-0.693145751953125f);
- const SimdFloat invargscale1(-1.428606765330187045e-06f);
- const SimdFloat CC4(0.00136324646882712841033936f);
- const SimdFloat CC3(0.00836596917361021041870117f);
- const SimdFloat CC2(0.0416710823774337768554688f);
- const SimdFloat CC1(0.166665524244308471679688f);
- const SimdFloat CC0(0.499999850988388061523438f);
- const SimdFloat one(1.0f);
+ const SimdFloat argscale(1.44269504088896341F);
+ const SimdFloat invargscale0(-0.693145751953125F);
+ const SimdFloat invargscale1(-1.428606765330187045e-06F);
+ const SimdFloat CC4(0.00136324646882712841033936F);
+ const SimdFloat CC3(0.00836596917361021041870117F);
+ const SimdFloat CC2(0.0416710823774337768554688F);
+ const SimdFloat CC1(0.166665524244308471679688F);
+ const SimdFloat CC0(0.499999850988388061523438F);
+ const SimdFloat one(1.0F);
SimdFloat fexppart;
SimdFloat intpart;
SimdFloat y, p;
erf(SimdFloat x)
{
// Coefficients for minimax approximation of erf(x)=x*P(x^2) in range [-1,1]
- const SimdFloat CA6(7.853861353153693e-5f);
- const SimdFloat CA5(-8.010193625184903e-4f);
- const SimdFloat CA4(5.188327685732524e-3f);
- const SimdFloat CA3(-2.685381193529856e-2f);
- const SimdFloat CA2(1.128358514861418e-1f);
- const SimdFloat CA1(-3.761262582423300e-1f);
- const SimdFloat CA0(1.128379165726710f);
+ const SimdFloat CA6(7.853861353153693e-5F);
+ const SimdFloat CA5(-8.010193625184903e-4F);
+ const SimdFloat CA4(5.188327685732524e-3F);
+ const SimdFloat CA3(-2.685381193529856e-2F);
+ const SimdFloat CA2(1.128358514861418e-1F);
+ const SimdFloat CA1(-3.761262582423300e-1F);
+ const SimdFloat CA0(1.128379165726710F);
// Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*P((1/(x-1))^2) in range [0.67,2]
- const SimdFloat CB9(-0.0018629930017603923f);
- const SimdFloat CB8(0.003909821287598495f);
- const SimdFloat CB7(-0.0052094582210355615f);
- const SimdFloat CB6(0.005685614362160572f);
- const SimdFloat CB5(-0.0025367682853477272f);
- const SimdFloat CB4(-0.010199799682318782f);
- const SimdFloat CB3(0.04369575504816542f);
- const SimdFloat CB2(-0.11884063474674492f);
- const SimdFloat CB1(0.2732120154030589f);
- const SimdFloat CB0(0.42758357702025784f);
+ const SimdFloat CB9(-0.0018629930017603923F);
+ const SimdFloat CB8(0.003909821287598495F);
+ const SimdFloat CB7(-0.0052094582210355615F);
+ const SimdFloat CB6(0.005685614362160572F);
+ const SimdFloat CB5(-0.0025367682853477272F);
+ const SimdFloat CB4(-0.010199799682318782F);
+ const SimdFloat CB3(0.04369575504816542F);
+ const SimdFloat CB2(-0.11884063474674492F);
+ const SimdFloat CB1(0.2732120154030589F);
+ const SimdFloat CB0(0.42758357702025784F);
// Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*(1/x)*P((1/x)^2) in range [2,9.19]
- const SimdFloat CC10(-0.0445555913112064f);
- const SimdFloat CC9(0.21376355144663348f);
- const SimdFloat CC8(-0.3473187200259257f);
- const SimdFloat CC7(0.016690861551248114f);
- const SimdFloat CC6(0.7560973182491192f);
- const SimdFloat CC5(-1.2137903600145787f);
- const SimdFloat CC4(0.8411872321232948f);
- const SimdFloat CC3(-0.08670413896296343f);
- const SimdFloat CC2(-0.27124782687240334f);
- const SimdFloat CC1(-0.0007502488047806069f);
- const SimdFloat CC0(0.5642114853803148f);
- const SimdFloat one(1.0f);
- const SimdFloat two(2.0f);
+ const SimdFloat CC10(-0.0445555913112064F);
+ const SimdFloat CC9(0.21376355144663348F);
+ const SimdFloat CC8(-0.3473187200259257F);
+ const SimdFloat CC7(0.016690861551248114F);
+ const SimdFloat CC6(0.7560973182491192F);
+ const SimdFloat CC5(-1.2137903600145787F);
+ const SimdFloat CC4(0.8411872321232948F);
+ const SimdFloat CC3(-0.08670413896296343F);
+ const SimdFloat CC2(-0.27124782687240334F);
+ const SimdFloat CC1(-0.0007502488047806069F);
+ const SimdFloat CC0(0.5642114853803148F);
+ const SimdFloat one(1.0F);
+ const SimdFloat two(2.0F);
SimdFloat x2, x4, y;
SimdFloat t, t2, w, w2;
// Calculate erfc
y = abs(x);
- maskErf = SimdFloat(0.75f) <= y;
+ maskErf = SimdFloat(0.75F) <= y;
t = maskzInv(y, maskErf);
w = t-one;
t2 = t*t;
erfc(SimdFloat x)
{
// Coefficients for minimax approximation of erf(x)=x*P(x^2) in range [-1,1]
- const SimdFloat CA6(7.853861353153693e-5f);
- const SimdFloat CA5(-8.010193625184903e-4f);
- const SimdFloat CA4(5.188327685732524e-3f);
- const SimdFloat CA3(-2.685381193529856e-2f);
- const SimdFloat CA2(1.128358514861418e-1f);
- const SimdFloat CA1(-3.761262582423300e-1f);
- const SimdFloat CA0(1.128379165726710f);
+ const SimdFloat CA6(7.853861353153693e-5F);
+ const SimdFloat CA5(-8.010193625184903e-4F);
+ const SimdFloat CA4(5.188327685732524e-3F);
+ const SimdFloat CA3(-2.685381193529856e-2F);
+ const SimdFloat CA2(1.128358514861418e-1F);
+ const SimdFloat CA1(-3.761262582423300e-1F);
+ const SimdFloat CA0(1.128379165726710F);
// Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*P((1/(x-1))^2) in range [0.67,2]
- const SimdFloat CB9(-0.0018629930017603923f);
- const SimdFloat CB8(0.003909821287598495f);
- const SimdFloat CB7(-0.0052094582210355615f);
- const SimdFloat CB6(0.005685614362160572f);
- const SimdFloat CB5(-0.0025367682853477272f);
- const SimdFloat CB4(-0.010199799682318782f);
- const SimdFloat CB3(0.04369575504816542f);
- const SimdFloat CB2(-0.11884063474674492f);
- const SimdFloat CB1(0.2732120154030589f);
- const SimdFloat CB0(0.42758357702025784f);
+ const SimdFloat CB9(-0.0018629930017603923F);
+ const SimdFloat CB8(0.003909821287598495F);
+ const SimdFloat CB7(-0.0052094582210355615F);
+ const SimdFloat CB6(0.005685614362160572F);
+ const SimdFloat CB5(-0.0025367682853477272F);
+ const SimdFloat CB4(-0.010199799682318782F);
+ const SimdFloat CB3(0.04369575504816542F);
+ const SimdFloat CB2(-0.11884063474674492F);
+ const SimdFloat CB1(0.2732120154030589F);
+ const SimdFloat CB0(0.42758357702025784F);
// Coefficients for minimax approximation of erfc(x)=Exp(-x^2)*(1/x)*P((1/x)^2) in range [2,9.19]
- const SimdFloat CC10(-0.0445555913112064f);
- const SimdFloat CC9(0.21376355144663348f);
- const SimdFloat CC8(-0.3473187200259257f);
- const SimdFloat CC7(0.016690861551248114f);
- const SimdFloat CC6(0.7560973182491192f);
- const SimdFloat CC5(-1.2137903600145787f);
- const SimdFloat CC4(0.8411872321232948f);
- const SimdFloat CC3(-0.08670413896296343f);
- const SimdFloat CC2(-0.27124782687240334f);
- const SimdFloat CC1(-0.0007502488047806069f);
- const SimdFloat CC0(0.5642114853803148f);
+ const SimdFloat CC10(-0.0445555913112064F);
+ const SimdFloat CC9(0.21376355144663348F);
+ const SimdFloat CC8(-0.3473187200259257F);
+ const SimdFloat CC7(0.016690861551248114F);
+ const SimdFloat CC6(0.7560973182491192F);
+ const SimdFloat CC5(-1.2137903600145787F);
+ const SimdFloat CC4(0.8411872321232948F);
+ const SimdFloat CC3(-0.08670413896296343F);
+ const SimdFloat CC2(-0.27124782687240334F);
+ const SimdFloat CC1(-0.0007502488047806069F);
+ const SimdFloat CC0(0.5642114853803148F);
// Coefficients for expansion of exp(x) in [0,0.1]
// CD0 and CD1 are both 1.0, so no need to declare them separately
- const SimdFloat CD2(0.5000066608081202f);
- const SimdFloat CD3(0.1664795422874624f);
- const SimdFloat CD4(0.04379839977652482f);
- const SimdFloat one(1.0f);
- const SimdFloat two(2.0f);
+ const SimdFloat CD2(0.5000066608081202F);
+ const SimdFloat CD3(0.1664795422874624F);
+ const SimdFloat CD4(0.04379839977652482F);
+ const SimdFloat one(1.0F);
+ const SimdFloat two(2.0F);
/* We need to use a small trick here, since we cannot assume all SIMD
* architectures support integers, and the flag we want (0xfffff000) would
* we can at least hope it is evaluated at compile-time.
*/
#if GMX_SIMD_HAVE_LOGICAL
- const SimdFloat sieve(SimdFloat(-5.965323564e+29f) | SimdFloat(7.05044434e-30f));
+ const SimdFloat sieve(SimdFloat(-5.965323564e+29F) | SimdFloat(7.05044434e-30F));
#else
const int isieve = 0xFFFFF000;
alignas(GMX_SIMD_ALIGNMENT) float mem[GMX_SIMD_FLOAT_WIDTH];
// Calculate erfc
y = abs(x);
- msk_erf = SimdFloat(0.75f) <= y;
+ msk_erf = SimdFloat(0.75F) <= y;
t = maskzInv(y, msk_erf);
w = t - one;
t2 = t * t;
{
// Constants to subtract Pi/4*x from y while minimizing precision loss
const SimdFloat argred0(-1.5703125);
- const SimdFloat argred1(-4.83751296997070312500e-04f);
- const SimdFloat argred2(-7.54953362047672271729e-08f);
- const SimdFloat argred3(-2.56334406825708960298e-12f);
- const SimdFloat two_over_pi(static_cast<float>(2.0f/M_PI));
- const SimdFloat const_sin2(-1.9515295891e-4f);
- const SimdFloat const_sin1( 8.3321608736e-3f);
- const SimdFloat const_sin0(-1.6666654611e-1f);
- const SimdFloat const_cos2( 2.443315711809948e-5f);
- const SimdFloat const_cos1(-1.388731625493765e-3f);
- const SimdFloat const_cos0( 4.166664568298827e-2f);
- const SimdFloat half(0.5f);
- const SimdFloat one(1.0f);
+ const SimdFloat argred1(-4.83751296997070312500e-04F);
+ const SimdFloat argred2(-7.54953362047672271729e-08F);
+ const SimdFloat argred3(-2.56334406825708960298e-12F);
+ const SimdFloat two_over_pi(static_cast<float>(2.0F/M_PI));
+ const SimdFloat const_sin2(-1.9515295891e-4F);
+ const SimdFloat const_sin1( 8.3321608736e-3F);
+ const SimdFloat const_sin0(-1.6666654611e-1F);
+ const SimdFloat const_cos2( 2.443315711809948e-5F);
+ const SimdFloat const_cos1(-1.388731625493765e-3F);
+ const SimdFloat const_cos0( 4.166664568298827e-2F);
+ const SimdFloat half(0.5F);
+ const SimdFloat one(1.0F);
SimdFloat ssign, csign;
SimdFloat x2, y, z, psin, pcos, sss, ccc;
SimdFBool m;
tan(SimdFloat x)
{
const SimdFloat argred0(-1.5703125);
- const SimdFloat argred1(-4.83751296997070312500e-04f);
- const SimdFloat argred2(-7.54953362047672271729e-08f);
- const SimdFloat argred3(-2.56334406825708960298e-12f);
- const SimdFloat two_over_pi(static_cast<float>(2.0f/M_PI));
+ const SimdFloat argred1(-4.83751296997070312500e-04F);
+ const SimdFloat argred2(-7.54953362047672271729e-08F);
+ const SimdFloat argred3(-2.56334406825708960298e-12F);
+ const SimdFloat two_over_pi(static_cast<float>(2.0F/M_PI));
const SimdFloat CT6(0.009498288995810566122993911);
const SimdFloat CT5(0.002895755790837379295226923);
const SimdFloat CT4(0.02460087336161924491836265);
static inline SimdFloat gmx_simdcall
asin(SimdFloat x)
{
- const SimdFloat limitlow(1e-4f);
- const SimdFloat half(0.5f);
- const SimdFloat one(1.0f);
- const SimdFloat halfpi(static_cast<float>(M_PI/2.0f));
- const SimdFloat CC5(4.2163199048E-2f);
- const SimdFloat CC4(2.4181311049E-2f);
- const SimdFloat CC3(4.5470025998E-2f);
- const SimdFloat CC2(7.4953002686E-2f);
- const SimdFloat CC1(1.6666752422E-1f);
+ const SimdFloat limitlow(1e-4F);
+ const SimdFloat half(0.5F);
+ const SimdFloat one(1.0F);
+ const SimdFloat halfpi(static_cast<float>(M_PI/2.0F));
+ const SimdFloat CC5(4.2163199048E-2F);
+ const SimdFloat CC4(2.4181311049E-2F);
+ const SimdFloat CC3(4.5470025998E-2F);
+ const SimdFloat CC2(7.4953002686E-2F);
+ const SimdFloat CC1(1.6666752422E-1F);
SimdFloat xabs;
SimdFloat z, z1, z2, q, q1, q2;
SimdFloat pA, pB;
static inline SimdFloat gmx_simdcall
acos(SimdFloat x)
{
- const SimdFloat one(1.0f);
- const SimdFloat half(0.5f);
+ const SimdFloat one(1.0F);
+ const SimdFloat half(0.5F);
const SimdFloat pi(static_cast<float>(M_PI));
- const SimdFloat halfpi(static_cast<float>(M_PI/2.0f));
+ const SimdFloat halfpi(static_cast<float>(M_PI/2.0F));
SimdFloat xabs;
SimdFloat z, z1, z2, z3;
SimdFBool m1, m2, m3;
static inline SimdFloat gmx_simdcall
atan(SimdFloat x)
{
- const SimdFloat halfpi(static_cast<float>(M_PI/2.0f));
- const SimdFloat CA17(0.002823638962581753730774f);
- const SimdFloat CA15(-0.01595690287649631500244f);
- const SimdFloat CA13(0.04250498861074447631836f);
- const SimdFloat CA11(-0.07489009201526641845703f);
- const SimdFloat CA9 (0.1063479334115982055664f);
- const SimdFloat CA7 (-0.1420273631811141967773f);
- const SimdFloat CA5 (0.1999269574880599975585f);
- const SimdFloat CA3 (-0.3333310186862945556640f);
- const SimdFloat one (1.0f);
+ const SimdFloat halfpi(static_cast<float>(M_PI/2.0F));
+ const SimdFloat CA17(0.002823638962581753730774F);
+ const SimdFloat CA15(-0.01595690287649631500244F);
+ const SimdFloat CA13(0.04250498861074447631836F);
+ const SimdFloat CA11(-0.07489009201526641845703F);
+ const SimdFloat CA9 (0.1063479334115982055664F);
+ const SimdFloat CA7 (-0.1420273631811141967773F);
+ const SimdFloat CA5 (0.1999269574880599975585F);
+ const SimdFloat CA3 (-0.3333310186862945556640F);
+ const SimdFloat one (1.0F);
SimdFloat x2, x3, x4, pA, pB;
SimdFBool m, m2;
static inline SimdFloat gmx_simdcall
pmeForceCorrection(SimdFloat z2)
{
- const SimdFloat FN6(-1.7357322914161492954e-8f);
- const SimdFloat FN5(1.4703624142580877519e-6f);
- const SimdFloat FN4(-0.000053401640219807709149f);
- const SimdFloat FN3(0.0010054721316683106153f);
- const SimdFloat FN2(-0.019278317264888380590f);
- const SimdFloat FN1(0.069670166153766424023f);
- const SimdFloat FN0(-0.75225204789749321333f);
-
- const SimdFloat FD4(0.0011193462567257629232f);
- const SimdFloat FD3(0.014866955030185295499f);
- const SimdFloat FD2(0.11583842382862377919f);
- const SimdFloat FD1(0.50736591960530292870f);
- const SimdFloat FD0(1.0f);
+ const SimdFloat FN6(-1.7357322914161492954e-8F);
+ const SimdFloat FN5(1.4703624142580877519e-6F);
+ const SimdFloat FN4(-0.000053401640219807709149F);
+ const SimdFloat FN3(0.0010054721316683106153F);
+ const SimdFloat FN2(-0.019278317264888380590F);
+ const SimdFloat FN1(0.069670166153766424023F);
+ const SimdFloat FN0(-0.75225204789749321333F);
+
+ const SimdFloat FD4(0.0011193462567257629232F);
+ const SimdFloat FD3(0.014866955030185295499F);
+ const SimdFloat FD2(0.11583842382862377919F);
+ const SimdFloat FD1(0.50736591960530292870F);
+ const SimdFloat FD0(1.0F);
SimdFloat z4;
SimdFloat polyFN0, polyFN1, polyFD0, polyFD1;
static inline SimdFloat gmx_simdcall
pmePotentialCorrection(SimdFloat z2)
{
- const SimdFloat VN6(1.9296833005951166339e-8f);
- const SimdFloat VN5(-1.4213390571557850962e-6f);
- const SimdFloat VN4(0.000041603292906656984871f);
- const SimdFloat VN3(-0.00013134036773265025626f);
- const SimdFloat VN2(0.038657983986041781264f);
- const SimdFloat VN1(0.11285044772717598220f);
- const SimdFloat VN0(1.1283802385263030286f);
-
- const SimdFloat VD3(0.0066752224023576045451f);
- const SimdFloat VD2(0.078647795836373922256f);
- const SimdFloat VD1(0.43336185284710920150f);
- const SimdFloat VD0(1.0f);
+ const SimdFloat VN6(1.9296833005951166339e-8F);
+ const SimdFloat VN5(-1.4213390571557850962e-6F);
+ const SimdFloat VN4(0.000041603292906656984871F);
+ const SimdFloat VN3(-0.00013134036773265025626F);
+ const SimdFloat VN2(0.038657983986041781264F);
+ const SimdFloat VN1(0.11285044772717598220F);
+ const SimdFloat VN0(1.1283802385263030286F);
+
+ const SimdFloat VD3(0.0066752224023576045451F);
+ const SimdFloat VD2(0.078647795836373922256F);
+ const SimdFloat VD1(0.43336185284710920150F);
+ const SimdFloat VD0(1.0F);
SimdFloat z4;
SimdFloat polyVN0, polyVN1, polyVD0, polyVD1;
rsqrtIter(Simd4Float lu, Simd4Float x)
{
Simd4Float tmp1 = x*lu;
- Simd4Float tmp2 = Simd4Float(-0.5f)*lu;
- tmp1 = fma(tmp1, lu, Simd4Float(-3.0f));
+ Simd4Float tmp2 = Simd4Float(-0.5F)*lu;
+ tmp1 = fma(tmp1, lu, Simd4Float(-3.0F));
return tmp1*tmp2;
}
rsqrtIter(Simd4Double lu, Simd4Double x)
{
Simd4Double tmp1 = x*lu;
- Simd4Double tmp2 = Simd4Double(-0.5f)*lu;
- tmp1 = fma(tmp1, lu, Simd4Double(-3.0f));
+ Simd4Double tmp2 = Simd4Double(-0.5F)*lu;
+ tmp1 = fma(tmp1, lu, Simd4Double(-3.0F));
return tmp1*tmp2;
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018,2019, 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.
{
double x0 = c1;
- EXPECT_EQ(1.0f/static_cast<float>(x0),
+ EXPECT_EQ(1.0F/static_cast<float>(x0),
static_cast<float>(invSingleAccuracy(x0)));
}
EXPECT_EQ(invsqrt(static_cast<float>(x0)),
static_cast<float>(maskzInvsqrtSingleAccuracy(x0, true)));
- EXPECT_EQ(0.0f,
+ EXPECT_EQ(0.0F,
static_cast<float>(maskzInvsqrtSingleAccuracy(x0, false)));
}
}
}
}
- if (hq != 0.0f)
+ if (hq != 0.0F)
{
for (j = 0; j < fac; j++)
{
{
/* Somehow the performance number was not aquired for this run,
* therefor set the average to some negative value: */
- pd->ns_per_day_Av = -1.0f*nrepeats;
+ pd->ns_per_day_Av = -1.0F*nrepeats;
break;
}
}
bool
TrajectoryAnalysisSettings::hasFlag(unsigned long flag) const
{
- return (impl_->flags & flag) != 0u;
+ return (impl_->flags & flag) != 0U;
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2018,2019, 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.
/*! \brief Test if both bitmasks have no common bits enabled */
inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
{
- return (a & b) == 0u;
+ return (a & b) == 0U;
}
/*! \brief Test if both bitmasks are equal */
/*! \brief Test if bitmask has no enabled bits */
inline static bool bitmask_is_zero(gmx_bitmask_t m)
{
- return m == 0u;
+ return m == 0U;
}
/*! \brief Set all bits enabled in either mask and write into a */
bool r = true;
for (i = 0; i < BITMASK_ALEN; i++)
{
- r = r && ((a[i] & b[i]) == 0u);
+ r = r && ((a[i] & b[i]) == 0U);
}
return r;
}
bool r = true;
for (i = 0; i < BITMASK_ALEN; i++)
{
- r = r && (m[i] == 0u);
+ r = r && (m[i] == 0U);
}
return r;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
# define GMX_DOUBLE_NEGZERO (-0.0)
/*! \brief Negative zero in float */
-# define GMX_FLOAT_NEGZERO (-0.0f)
+# define GMX_FLOAT_NEGZERO (-0.0F)
#endif
/*! \typedef real
TEST(ReferenceDataTest, HandlesFloatingPointData)
{
- const float floatValue = 4.0f/3.0f;
+ const float floatValue = 4.0F/3.0F;
const double doubleValue = 4.0/3.0;
{
TEST(ReferenceDataTest, HandlesVectorData)
{
int veci[3] = { -1, 3, 5 };
- float vecf[3] = { -2.3f, 1.43f, 2.5f };
+ float vecf[3] = { -2.3F, 1.43F, 2.5F };
double vecd[3] = { -2.3, 1.43, 2.5 };
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2014,2017,2018,2019, 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.
// TODO: Use typed tests to run all the tests for single and double.
TEST(FloatingPointDifferenceTest, HandlesFloatValues)
{
- FloatingPointDifference diff(1.2f, 1.2f);
+ FloatingPointDifference diff(1.2F, 1.2F);
EXPECT_FALSE(diff.isDouble());
EXPECT_FALSE(diff.isNaN());
EXPECT_EQ(0.0, diff.asAbsolute());
using gmx::test::ulpTolerance;
FloatingPointDifference fequal(1.0, 1.0);
- FloatingPointDifference fulp2(1.0f, addUlps(1.0f, 2));
+ FloatingPointDifference fulp2(1.0F, addUlps(1.0F, 2));
EXPECT_TRUE(ulpTolerance(0).isWithin(fequal));
EXPECT_FALSE(ulpTolerance(1).isWithin(fulp2));
EXPECT_TRUE(ulpTolerance(2).isWithin(fulp2));
FloatingPointDifference dequal(1.0, 1.0);
FloatingPointDifference dulp2(1.0, addUlps(1.0, 2));
- FloatingPointDifference dulp2f(1.0, static_cast<double>(addUlps(1.0f, 2)));
+ FloatingPointDifference dulp2f(1.0, static_cast<double>(addUlps(1.0F, 2)));
EXPECT_TRUE(ulpTolerance(0).isWithin(dequal));
EXPECT_TRUE(ulpTolerance(2).isWithin(dulp2));
EXPECT_FALSE(ulpTolerance(2).isWithin(dulp2f));
{
using gmx::test::relativeToleranceAsFloatingPoint;
- FloatingPointDifference fequal(1.0f, 1.0f);
- FloatingPointDifference fulp2(1.0f, addUlps(1.0f, 2));
- FloatingPointDifference fdiff(1.0f, 1.011f);
- FloatingPointDifference fsmall(0.1f, 0.111f);
- FloatingPointDifference fsmall2(0.1f, 0.121f);
+ FloatingPointDifference fequal(1.0F, 1.0F);
+ FloatingPointDifference fulp2(1.0F, addUlps(1.0F, 2));
+ FloatingPointDifference fdiff(1.0F, 1.011F);
+ FloatingPointDifference fsmall(0.1F, 0.111F);
+ FloatingPointDifference fsmall2(0.1F, 0.121F);
EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(fequal));
EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-9).isWithin(fequal));
EXPECT_TRUE(relativeToleranceAsFloatingPoint(1.0, 1e-2).isWithin(fulp2));
EXPECT_FALSE(relativeToleranceAsFloatingPoint(1.0, 2e-2).isWithin(fsmall2));
FloatingPointDifference dequal(1.0, 1.0);
- FloatingPointDifference dulp2f(1.0, static_cast<double>(addUlps(1.0f, 2)));
+ FloatingPointDifference dulp2f(1.0, static_cast<double>(addUlps(1.0F, 2)));
FloatingPointDifference ddiff(1.0, 1.011);
FloatingPointDifference dsmall(0.1, 0.111);
FloatingPointDifference dsmall2(0.1, 0.121);
{
using gmx::test::relativeToleranceAsUlp;
- FloatingPointDifference fequal(1.0f, 1.0f);
- FloatingPointDifference fulp4(1.0f, addUlps(1.0f, 4));
- FloatingPointDifference fsmall(0.1f, addUlps(1.0f, 2) - 0.9f);
- FloatingPointDifference fsmall2(0.1f, addUlps(1.0f, 6) - 0.9f);
+ FloatingPointDifference fequal(1.0F, 1.0F);
+ FloatingPointDifference fulp4(1.0F, addUlps(1.0F, 4));
+ FloatingPointDifference fsmall(0.1F, addUlps(1.0F, 2) - 0.9F);
+ FloatingPointDifference fsmall2(0.1F, addUlps(1.0F, 6) - 0.9F);
EXPECT_TRUE(relativeToleranceAsUlp(1.0, 2).isWithin(fequal));
EXPECT_FALSE(relativeToleranceAsUlp(1.0, 2).isWithin(fulp4));
EXPECT_TRUE(relativeToleranceAsUlp(1.0, 4).isWithin(fulp4));
FloatingPointDifference dequal(1.0, 1.0);
FloatingPointDifference dulp4(1.0, addUlps(1.0, 4));
- FloatingPointDifference dulp4f(1.0, static_cast<double>(addUlps(1.0f, 4)));
+ FloatingPointDifference dulp4f(1.0, static_cast<double>(addUlps(1.0F, 4)));
FloatingPointDifference dsmall(0.1, addUlps(1.0, 2) - 0.9);
FloatingPointDifference dsmall2(0.1, addUlps(1.0, 6) - 0.9);
EXPECT_TRUE(relativeToleranceAsUlp(1.0, 2).isWithin(dequal));
using gmx::test::defaultFloatTolerance;
// Differences within 4 single-precision ULPs are within the tolerance
- FloatingPointDifference fequal(1.0f, 1.0f);
- FloatingPointDifference fulp4(1.0f, addUlps(1.0f, 4));
- FloatingPointDifference fulp8(1.0f, addUlps(1.0f, 8));
- FloatingPointDifference fsmall(0.1f, addUlps(1.0f, 2) - 0.9f);
- FloatingPointDifference fsmall2(0.1f, addUlps(1.0f, 6) - 0.9f);
+ FloatingPointDifference fequal(1.0F, 1.0F);
+ FloatingPointDifference fulp4(1.0F, addUlps(1.0F, 4));
+ FloatingPointDifference fulp8(1.0F, addUlps(1.0F, 8));
+ FloatingPointDifference fsmall(0.1F, addUlps(1.0F, 2) - 0.9F);
+ FloatingPointDifference fsmall2(0.1F, addUlps(1.0F, 6) - 0.9F);
EXPECT_TRUE(defaultFloatTolerance().isWithin(fequal));
EXPECT_TRUE(defaultFloatTolerance().isWithin(fulp4));
EXPECT_FALSE(defaultFloatTolerance().isWithin(fulp8));
FloatingPointDifference dequal(1.0, 1.0);
FloatingPointDifference dulp4(1.0, addUlps(1.0, 4));
FloatingPointDifference dulp8(1.0, addUlps(1.0, 8));
- FloatingPointDifference dulp4f(1.0, static_cast<double>(addUlps(1.0f, 4)));
- FloatingPointDifference dulp8f(1.0, static_cast<double>(addUlps(1.0f, 8)));
- FloatingPointDifference dsmallf(0.1, static_cast<double>(addUlps(1.0f, 2) - 0.9f));
- FloatingPointDifference dsmall2f(0.1, static_cast<double>(addUlps(1.0f, 6) - 0.9f));
+ FloatingPointDifference dulp4f(1.0, static_cast<double>(addUlps(1.0F, 4)));
+ FloatingPointDifference dulp8f(1.0, static_cast<double>(addUlps(1.0F, 8)));
+ FloatingPointDifference dsmallf(0.1, static_cast<double>(addUlps(1.0F, 2) - 0.9F));
+ FloatingPointDifference dsmall2f(0.1, static_cast<double>(addUlps(1.0F, 6) - 0.9F));
EXPECT_TRUE(defaultFloatTolerance().isWithin(dequal));
EXPECT_TRUE(defaultFloatTolerance().isWithin(dulp4));
EXPECT_TRUE(defaultFloatTolerance().isWithin(dulp8));