*/
#include "gmxpre.h"
-#include <math.h>
-#include <string.h>
+#include <cmath>
+#include <cstring>
#include "gromacs/commandline/pargs.h"
#include "gromacs/correlationfunctions/autocorr.h"
}
for (m = 0; (m < DIM); m++)
{
- d[m] = sqrt(d[m]/tm);
+ d[m] = std::sqrt(d[m]/tm);
}
#ifdef DEBUG
pr_rvecs(stderr, 0, "trans", trans, DIM);
ii = index[i];
if (bQ)
{
- m0 = fabs(atom[ii].q);
+ m0 = std::abs(atom[ii].q);
}
else
{
for (m = 0; (m < DIM); m++)
{
- gvec[m] = sqrt((gyro-comp[m])/tm);
+ gvec[m] = std::sqrt((gyro-comp[m])/tm);
}
- return sqrt(gyro/tm);
+ return std::sqrt(gyro/tm);
}
void calc_gyro_z(rvec x[], matrix box,
}
for (j = 0; j < 2; j++)
{
- zi = zf + j;
+ zi = static_cast<int>(zf + j);
if (zi == nz)
{
zi = 0;
}
- w = atom[ii].m*(1 + cos(M_PI*(zf - zi)));
+ w = atom[ii].m*(1 + std::cos(M_PI*(zf - zi)));
inertia[zi][0] += w*sqr(x[ii][YY]);
inertia[zi][1] += w*sqr(x[ii][XX]);
inertia[zi][2] -= w*x[ii][XX]*x[ii][YY];
{
inertia[j][i] /= tm[j];
}
- sdet = sqrt(sqr(inertia[j][0] - inertia[j][1]) + 4*sqr(inertia[j][2]));
- e1 = sqrt(0.5*(inertia[j][0] + inertia[j][1] + sdet));
- e2 = sqrt(0.5*(inertia[j][0] + inertia[j][1] - sdet));
+ sdet = std::sqrt(sqr(inertia[j][0] - inertia[j][1]) + 4*sqr(inertia[j][2]));
+ e1 = std::sqrt(0.5*(inertia[j][0] + inertia[j][1] + sdet));
+ e2 = std::sqrt(0.5*(inertia[j][0] + inertia[j][1] - sdet));
fprintf(out, " %5.3f %5.3f", e1, e2);
}
fprintf(out, "\n");
real t, t0, tm, gyro;
int natoms;
char *grpname, title[256];
- int i, j, m, gnx, nam, mol;
+ int j, m, gnx, nam, mol;
atom_id *index;
output_env_t oenv;
gmx_rmpbc_t gpbc = NULL;
}
gyro = 0;
clear_rvec(gvec);
+ clear_rvec(gvec1);
clear_rvec(d);
+ clear_rvec(d1);
for (mol = 0; mol < nmol; mol++)
{
tm = sub_xcm(nz == 0 ? x_s : x, nam, index+mol*nam, top.atoms.atom, xcm, bQ);