-readability-misleading-indentation,-readability-container-size-empty,-misc-suspicious-string-compare,\
-readability-redundant-control-flow,-performance-unnecessary-value-param,\
-readability-static-definition-in-anonymous-namespace,-misc-suspicious-missing-comma,\
- -readability-redundant-member-init,-misc-misplaced-const,-performance-type-promotion-in-math-fn,\
+ -readability-redundant-member-init,-misc-misplaced-const,\
-misc-incorrect-roundings,-misc-macro-parentheses,-readability-function-size,-readability-else-after-return,\
-readability-inconsistent-declaration-parameter-name,-misc-throw-by-value-catch-by-reference,\
- -readability-non-const-parameter,-readability-implicit-bool-conversion;-warnings-as-errors=*")
+ -readability-non-const-parameter,-readability-implicit-bool-conversion;-warnings-as-errors=*;-fix")
endif()
gmx_write_installed_header_list()
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
GMX_RELEASE_ASSERT(isDefined(settings.binWidth_),
"Rounding only makes sense with defined binwidth");
binWidth_ = settings.binWidth_;
- firstEdge_ = binWidth_ * floor(settings.min_ / binWidth_);
- lastEdge_ = binWidth_ * ceil(settings.max_ / binWidth_);
+ firstEdge_ = binWidth_ * std::floor(settings.min_ / binWidth_);
+ lastEdge_ = binWidth_ * std::ceil(settings.max_ / binWidth_);
binCount_ = static_cast<int>((lastEdge_ - firstEdge_) / binWidth_ + 0.5);
}
else
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
else if (MODE(eacCos))
{
/* Compute the cos (phi(t)-phi(t+dt)) */
- corr[k] += cos(c1[j]-c1[j+k]);
+ corr[k] += std::cos(c1[j]-c1[j+k]);
}
else if (MODE(eacIden))
{
sprintf(buf, " Average PME mesh/force load: %5.3f\n", pmeForceRatio);
fprintf(fplog, "%s", buf);
fprintf(stderr, "%s", buf);
- sprintf(buf, " Part of the total run time spent waiting due to PP/PME imbalance: %.1f %%\n", fabs(lossFractionPme)*100);
+ sprintf(buf, " Part of the total run time spent waiting due to PP/PME imbalance: %.1f %%\n", std::fabs(lossFractionPme)*100);
fprintf(fplog, "%s", buf);
fprintf(stderr, "%s", buf);
}
fprintf(fplog, "%s\n", buf);
fprintf(stderr, "%s\n", buf);
}
- if (numPmeRanks > 0 && fabs(lossFractionPme) >= DD_PERF_LOSS_WARN)
+ if (numPmeRanks > 0 && std::fabs(lossFractionPme) >= DD_PERF_LOSS_WARN)
{
sprintf(buf,
"NOTE: %.1f %% performance was lost because the PME ranks\n"
" had %s work to do than the PP ranks.\n"
" You might want to %s the number of PME ranks\n"
" or %s the cut-off and the grid spacing.\n",
- fabs(lossFractionPme*100),
+ std::fabs(lossFractionPme*100),
(lossFractionPme < 0) ? "less" : "more",
(lossFractionPme < 0) ? "decrease" : "increase",
(lossFractionPme < 0) ? "decrease" : "increase");
/* Check if the box size is nearly identical,
* in that case we prefer nx > ny and ny > nz.
*/
- if (fabs(bt[j] - bt[i]) < 0.01*bt[i] && nc[j] > nc[i])
+ if (std::fabs(bt[j] - bt[i]) < 0.01*bt[i] && nc[j] > nc[i])
{
/* The XX/YY check is a bit compact. If nc[YY]==npme[YY]
* this means the swapped nc has nc[XX]==npme[XX],
#include <string.h>
#include <time.h>
+#include <cmath>
+
#include "gromacs/commandline/filenm.h"
#include "gromacs/domdec/domdec_struct.h"
#include "gromacs/fileio/gmxfio.h"
}
else
{
- Vfl = edi->flood.Efl != 0 ? edi->flood.Efl*exp(-edi->flood.kT/2/edi->flood.Efl/edi->flood.alpha2*sum) : 0;
+ Vfl = edi->flood.Efl != 0 ? edi->flood.Efl*std::exp(-edi->flood.kT/2/edi->flood.Efl/edi->flood.alpha2*sum) : 0;
}
return Vfl;
for (m = 0; (m < 3); m++)
{
- eir[1][i][m].re = cos(x[i][m]*lll[m]);
- eir[1][i][m].im = sin(x[i][m]*lll[m]);
+ eir[1][i][m].re = std::cos(x[i][m]*lll[m]);
+ eir[1][i][m].im = std::sin(x[i][m]*lll[m]);
}
for (j = 2; (j < kmax); j++)
{
{
mz = iz*lll[ZZ];
m2 = mx*mx+my*my+mz*mz;
- ak = exp(m2*factor)/m2;
+ ak = std::exp(m2*factor)/m2;
akv = 2.0*ak*(1.0/m2-factor);
if (iz >= 0)
{
* to normalise the relative position vector dx */
if (ewcdr > R_ERF_R_INACC)
{
- fscal = rinv2*(vc - qqA*ewc_q*M_2_SQRTPI*exp(-ewcdr*ewcdr));
+ fscal = rinv2*(vc - qqA*ewc_q*M_2_SQRTPI*std::exp(-ewcdr*ewcdr));
}
else
{
Vexcl_q += vc;
/* fscal is the scalar force pre-multiplied by rinv,
* to normalise the relative position vector dx */
- fscal = rinv2*(vc-qqL*ewc_q*M_2_SQRTPI*exp(-ewc_q*ewc_q*dr2));
+ fscal = rinv2*(vc-qqL*ewc_q*M_2_SQRTPI*std::exp(-ewc_q*ewc_q*dr2));
dvdl_excl_q += (qqB - qqA)*v;
/* The force vector is obtained by multiplication with
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
else
{
- if (fabs(a-b) > 2*NG[0]*NG[1]*NG[2]*GMX_REAL_EPS)
+ if (std::fabs(a-b) > 2*NG[0]*NG[1]*NG[2]*GMX_REAL_EPS)
{
printf("result incorrect on %d,%d at %d,%d,%d: FFT5D:%f reference:%f\n", coor[0], coor[1], x, y, z, a, b);
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
lf = *lfp * *precision - 0.5;
}
- if (fabs(lf) > MAXABS)
+ if (std::fabs(lf) > MAXABS)
{
/* scaling would cause overflow */
errval = 0;
{
lf = *lfp * *precision - 0.5;
}
- if (fabs(lf) > MAXABS)
+ if (std::fabs(lf) > MAXABS)
{
/* scaling would cause overflow */
errval = 0;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
fprintf(out, "\"%c%c c #%02X%02X%02X \" /* \"%.3g\" */,\n",
mapper[(i+i0) % NMAP],
(nlevel <= NMAP) ? ' ' : mapper[(i+i0)/NMAP],
- static_cast<unsigned int>(round(255*r)),
- static_cast<unsigned int>(round(255*g)),
- static_cast<unsigned int>(round(255*b)),
+ static_cast<unsigned int>(std::round(255*r)),
+ static_cast<unsigned int>(std::round(255*g)),
+ static_cast<unsigned int>(std::round(255*b)),
lo+fac*(hi-lo));
}
}
b = (nlo*rlo.b+i*rhi.b)*invlevel;
fprintf(out, "\"%c%c c #%02X%02X%02X \" /* \"%.3g\" */,\n",
mapper[i % NMAP], (*nlevels <= NMAP) ? ' ' : mapper[i/NMAP],
- static_cast<unsigned int>(round(255*r)),
- static_cast<unsigned int>(round(255*g)),
- static_cast<unsigned int>(round(255*b)),
+ static_cast<unsigned int>(std::round(255*r)),
+ static_cast<unsigned int>(std::round(255*g)),
+ static_cast<unsigned int>(std::round(255*b)),
(nlo*lo+i*hi)*invlevel);
}
}
{
if (i < j)
{
- c = nlevel_bot+round((mat[i][j]-lo_top)*invlev_top);
+ c = nlevel_bot+std::round((mat[i][j]-lo_top)*invlev_top);
if ((c < nlevel_bot) || (c >= nlevel_bot+nlevel_top))
{
gmx_fatal(FARGS, "Range checking i = %d, j = %d, c = %d, bot = %d, top = %d matrix[i,j] = %f", i, j, c, nlevel_bot, nlevel_top, mat[i][j]);
}
else if (i > j)
{
- c = round((mat[i][j]-lo_bot)*invlev_bot);
+ c = std::round((mat[i][j]-lo_bot)*invlev_bot);
if ((c < 0) || (c >= nlevel_bot+nlevel_bot))
{
gmx_fatal(FARGS, "Range checking i = %d, j = %d, c = %d, bot = %d, top = %d matrix[i,j] = %f", i, j, c, nlevel_bot, nlevel_top, mat[i][j]);
r_coulomb = info->rcoulomb[0];
e_dir = 2.0 * info->q2all * gmx::invsqrt( info->q2allnr * r_coulomb * info->volume );
- e_dir *= exp (-beta*beta*r_coulomb*r_coulomb);
+ e_dir *= std::exp (-beta*beta*r_coulomb*r_coulomb);
return ONE_4PI_EPS0*e_dir;
}
else
{
fprintf(stderr, "%9.1f %5.1f\n", ir->opts.anneal_time[i][j], ir->opts.anneal_temp[i][j]);
- if (fabs(ir->opts.anneal_temp[i][j]-ir->opts.anneal_temp[i][0]) > GMX_REAL_EPS)
+ if (std::fabs(ir->opts.anneal_temp[i][j]-ir->opts.anneal_temp[i][0]) > GMX_REAL_EPS)
{
warning_note(wi, "There is a temperature jump when your annealing loops back.\n");
}
cj0 = get_atomtype_nbparam(j, 0, atype);
ci1 = get_atomtype_nbparam(i, 1, atype);
cj1 = get_atomtype_nbparam(j, 1, atype);
- plist->param[k].c[0] = std::sqrt(fabs(ci0*cj0));
+ plist->param[k].c[0] = std::sqrt(std::fabs(ci0*cj0));
/* Negative sigma signals that c6 should be set to zero later,
* so we need to propagate that through the combination rules.
*/
#include <assert.h>
+#include <cmath>
+
#include <algorithm>
#include "gromacs/domdec/domdec_struct.h"
to its current size.
*/
- change = fabs(dt*boxv[d][n]/box[d][d]);
+ change = std::fabs(dt*boxv[d][n]/box[d][d]);
if (change > maxchange)
{
n = static_cast<int>(t / pert);
thist = t - n*pert; /* modulo time */
/* Make sure rounding didn't get us outside the interval */
- if (fabs(thist-pert) < GMX_REAL_EPS*100)
+ if (std::fabs(thist-pert) < GMX_REAL_EPS*100)
{
thist = 0;
}
}
else
{
- dwm_array[nval] = fabs( cnval - lam_dg[fep_state-1] );
+ dwm_array[nval] = std::fabs( cnval - lam_dg[fep_state-1] );
}
if (n0 > 0)
}
else
{
- dwp_array[nval] = fabs( cnval - lam_dg[fep_state] );
+ dwp_array[nval] = std::fabs( cnval - lam_dg[fep_state] );
}
}
#include "md_support.h"
#include <climits>
+#include <cmath>
#include <algorithm>
{
/* find out between which two value of lambda we should be */
real frac = step*fepvals->delta_lambda;
- int fep_state = static_cast<int>(floor(frac*fepvals->n_lambda));
+ int fep_state = static_cast<int>(std::floor(frac*fepvals->n_lambda));
/* interpolate between this state and the next */
/* this assumes that the initial lambda corresponds to lambda==0, which is verified in grompp */
frac = frac*fepvals->n_lambda - fep_state;
real frac = step*fepvals->delta_lambda;
if (fepvals->n_lambda > 0)
{
- int fep_state = static_cast<int>(floor(frac*fepvals->n_lambda));
+ int fep_state = static_cast<int>(std::floor(frac*fepvals->n_lambda));
/* interpolate between this state and the next */
/* this assumes that the initial lambda corresponds to lambda==0, which is verified in grompp */
frac = frac*fepvals->n_lambda - fep_state;
* the velocities. */
if (re->type == ereTEMP || re->type == ereTL)
{
- scale_velocities(state, sqrt(re->q[ereTEMP][replica_id]/re->q[ereTEMP][re->destinations[replica_id]]));
+ scale_velocities(state, std::sqrt(re->q[ereTEMP][replica_id]/re->q[ereTEMP][re->destinations[replica_id]]));
}
}
#include <stdlib.h>
#include <string.h>
+#include <cmath>
#include <cstdint>
#include <algorithm>
now = shell-4;
for (m = 0; (m < DIM); m++)
{
- if (fabs(x[shell][m]-x[now][m]) > 0.3)
+ if (std::fabs(x[shell][m]-x[now][m]) > 0.3)
{
pr_rvecs(fp, 0, "SHELL-X", as_rvec_array(x.data())+now, 5);
break;
vdwtab = fr->dispersionCorrectionTable->data;
/* Round the cut-offs to exact table values for precision */
- ri0 = static_cast<int>(floor(ic->rvdw_switch*scale));
- ri1 = static_cast<int>(ceil(ic->rvdw*scale));
+ ri0 = static_cast<int>(std::floor(ic->rvdw_switch*scale));
+ ri1 = static_cast<int>(std::ceil(ic->rvdw*scale));
/* The code below has some support for handling force-switching, i.e.
* when the force (instead of potential) is switched over a limited
}
/* This is the max amount of increase in energy we tolerate */
- tmp = sqrt(GMX_REAL_EPS)*fabs(s_a->epot);
+ tmp = std::sqrt(GMX_REAL_EPS)*fabs(s_a->epot);
/* Accept the step if the energy is lower, or if it is not significantly higher
* and the line derivative is still negative.
while ((epot_repl > s_a->epot || epot_repl > s_c->epot) &&
(nminstep < 20));
- if (fabs(epot_repl - s_min->epot) < fabs(s_min->epot)*GMX_REAL_EPS ||
+ if (std::fabs(epot_repl - s_min->epot) < fabs(s_min->epot)*GMX_REAL_EPS ||
nminstep >= 20)
{
/* OK. We couldn't find a significantly lower energy.
// This is the max amount of increase in energy we tolerate.
// By allowing VERY small changes (close to numerical precision) we
// frequently find even better (lower) final energies.
- tmp = sqrt(GMX_REAL_EPS)*fabs(sa->epot);
+ tmp = std::sqrt(GMX_REAL_EPS)*fabs(sa->epot);
// Accept the step if the energy is lower in the new position C (compared to A),
// or if it is not significantly higher and the line derivative is still negative.
}
while ((sb->epot > sa->epot || sb->epot > sc->epot) && (nminstep < 20));
- if (fabs(sb->epot - Epot0) < GMX_REAL_EPS || nminstep >= 20)
+ if (std::fabs(sb->epot - Epot0) < GMX_REAL_EPS || nminstep >= 20)
{
/* OK. We couldn't find a significantly lower energy.
* If ncorr==0 this was steepest descent, and then we give up.
/* added with respect to mdrun */
int row, col;
- real der_range = 10.0*sqrt(GMX_REAL_EPS);
+ real der_range = 10.0*std::sqrt(GMX_REAL_EPS);
real x_min;
bool bIsMaster = MASTER(cr);
auto mdatoms = mdAtoms->mdatoms();
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
box[ZZ][XX] = vec[ZZ]*cos(angle[YY]);
box[ZZ][YY] = vec[ZZ]
*(cos(angle[XX])-cos(angle[YY])*cos(angle[ZZ]))/sin(angle[ZZ]);
- box[ZZ][ZZ] = sqrt(gmx::square(vec[ZZ])
- -box[ZZ][XX]*box[ZZ][XX]-box[ZZ][YY]*box[ZZ][YY]);
+ box[ZZ][ZZ] = std::sqrt(gmx::square(vec[ZZ])
+ -box[ZZ][XX]*box[ZZ][XX]-box[ZZ][YY]*box[ZZ][YY]);
}
real max_cutoff2(int ePBC, const matrix box)
#include <assert.h>
#include <stdlib.h>
+#include <cmath>
+
#include "gromacs/domdec/domdec_struct.h"
#include "gromacs/domdec/ga2la.h"
#include "gromacs/fileio/confio.h"
for (i = 0; i < pgrp->nat_loc; i++)
{
ii = pgrp->ind_loc[i];
- pgrp->weight_loc[i] = csw*cos(twopi_box*x[ii][pull->cosdim]) +
- snw*sin(twopi_box*x[ii][pull->cosdim]);
+ pgrp->weight_loc[i] = csw*std::cos(twopi_box*x[ii][pull->cosdim]) +
+ snw*std::sin(twopi_box*x[ii][pull->cosdim]);
}
if (xp)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "centerofmass.h"
+#include <cmath>
+
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/block.h"
rvec_add(xout, dx, xtest);
for (j = 0; j < DIM; ++j)
{
- if (fabs(xtest[j] - x[ai][j]) > tol)
+ if (std::fabs(xtest[j] - x[ai][j]) > tol)
{
/* Here we have used the wrong image for contributing to the COM */
xout[j] += (xtest[j] - x[ai][j]) / nrefat;
rvec_add(xout, dx, xtest);
for (int j = 0; j < DIM; ++j)
{
- if (fabs(xtest[j] - x[ai][j]) > tol)
+ if (std::fabs(xtest[j] - x[ai][j]) > tol)
{
/* Here we have used the wrong image for contributing to the COM */
xout[j] += mass * (xtest[j] - x[ai][j]);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
theta = acos(x[ZZ]);
phi = atan2(x[YY], x[XX]);
- tbin = static_cast<int>(floor(theta / surf->tbinsize));
+ tbin = static_cast<int>(std::floor(theta / surf->tbinsize));
if (tbin >= surf->ntbins)
{
tbin = surf->ntbins - 1;
tmax = std::acos(cos(theta) / cos(surf->angcut));
}
/* Find the first affected bin */
- tbin = max(static_cast<int>(floor((theta - surf->angcut) / surf->tbinsize)), 0);
+ tbin = max(static_cast<int>(std::floor((theta - surf->angcut) / surf->tbinsize)), 0);
theta1 = tbin * surf->tbinsize;
if (theta1 < theta - surf->angcut)
{
pdelta1 = M_PI;
}
/* Loop through all affected bins */
- while (tbin < ceil((theta + surf->angcut) / surf->tbinsize)
+ while (tbin < std::ceil((theta + surf->angcut) / surf->tbinsize)
&& tbin < surf->ntbins)
{
/* Calculate the next boundaries */
* such that the case above catches this instead of falling through
* here. */
pdelta2 = 2*asin(std::sqrt(
- (gmx::square(sin(surf->angcut/2)) - gmx::square(sin((theta2-theta)/2))) /
+ (gmx::square(std::sin(surf->angcut/2)) - gmx::square(std::sin((theta2-theta)/2))) /
(sin(theta) * sin(theta2))));
}
/* Update the bin */
cfrac = 0.0;
for (t = 0; t < surf->ntbins; ++t)
{
- tfrac = cos(t * surf->tbinsize) - cos((t+1) * surf->tbinsize);
+ tfrac = std::cos(t * surf->tbinsize) - std::cos((t+1) * surf->tbinsize);
for (p = 0; p < surf->tbin[t].n; ++p)
{
pfrac = surf->tbin[t].p[p+1].left - surf->tbin[t].p[p].left;
}
if (j >= 2)
{
- if (fabs((fr.time-old_t1)-(old_t1-old_t2)) >
- 0.1*(fabs(fr.time-old_t1)+fabs(old_t1-old_t2)) )
+ if (std::fabs((fr.time-old_t1)-(old_t1-old_t2)) >
+ 0.1*(std::fabs(fr.time-old_t1)+std::fabs(old_t1-old_t2)) )
{
bShowTimestep = FALSE;
fprintf(stderr, "%sTimesteps at t=%g don't match (%g, %g)\n",
if (fnr >= 2)
{
if (fabs((fr->t-old_t1)-(old_t1-old_t2)) >
- 0.1*(fabs(fr->t-old_t1)+fabs(old_t1-old_t2)) )
+ 0.1*(fabs(fr->t-old_t1)+std::fabs(old_t1-old_t2)) )
{
bShowTStep = FALSE;
fprintf(stderr, "\nTimesteps at t=%g don't match (%g, %g)\n",
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2007, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*i]-xus[3*k];
y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*j]-xus[3*k];
y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*i]-xus[3*k];
y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*j]-xus[3*k];
y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
- if (fabs(a-d) > DP_TOL)
+ if (std::fabs(a-d) > DP_TOL)
{
continue;
}
x = xus[3*i]-xus[3*j];
y = xus[1+3*i]-xus[1+3*j]; z = xus[2+3*i]-xus[2+3*j];
d = x*x+y*y+z*z;
- if (fabs(ai_d-d) > DP_TOL)
+ if (std::fabs(ai_d-d) > DP_TOL)
{
continue;
}
x = xus[3*i]-xus[3*k];
y = xus[1+3*i]-xus[1+3*k]; z = xus[2+3*i]-xus[2+3*k];
d = x*x+y*y+z*z;
- if (fabs(ai_d-d) > DP_TOL)
+ if (std::fabs(ai_d-d) > DP_TOL)
{
continue;
}
x = xus[3*j]-xus[3*k];
y = xus[1+3*j]-xus[1+3*k]; z = xus[2+3*j]-xus[2+3*k];
d = x*x+y*y+z*z;
- if (fabs(adod-d) > DP_TOL)
+ if (std::fabs(adod-d) > DP_TOL)
{
continue;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
gmx_bool equal_real(real i1, real i2, real ftol, real abstol)
{
- return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
+ return ( ( 2*std::fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || std::fabs(i1-i2) <= abstol );
}
gmx_bool equal_float(float i1, float i2, float ftol, float abstol)
{
- return ( ( 2*fabs(i1 - i2) <= (fabs(i1) + fabs(i2))*ftol ) || fabs(i1-i2) <= abstol );
+ return ( ( 2*std::fabs(i1 - i2) <= (std::fabs(i1) + std::fabs(i2))*ftol ) || std::fabs(i1-i2) <= abstol );
}
gmx_bool equal_double(double i1, double i2, real ftol, real abstol)