*/
#include "gmxpre.h"
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
+#include <cmath>
+#include <cstdio>
+#include <cstring>
#include "gromacs/commandline/pargs.h"
#include "gromacs/correlationfunctions/autocorr.h"
#include "gromacs/topology/index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#define NK 24
}
ncorr = (nframes+1)/2;
- if (ncorr > (int)(5*wt/dt+0.5))
+ if (ncorr > static_cast<int>(5*wt/dt+0.5))
{
- ncorr = (int)(5*wt/dt+0.5)+1;
+ ncorr = static_cast<int>(5*wt/dt+0.5)+1;
}
snew(tcaf, nk);
for (k = 0; k < nk; k++)
snew(sig, ncorr);
for (i = 0; i < ncorr; i++)
{
- sig[i] = exp(0.5*i*dt/wt);
+ sig[i] = std::exp(0.5*i*dt/wt);
}
low_do_autocorr(fn_tca, oenv, "Transverse Current Autocorrelation Functions",
int ePBC;
t_trxframe fr;
matrix box;
- gmx_bool bTPS, bTop; /* ,bCubic; */
+ gmx_bool bTop;
int gnx;
atom_id *index, *atndx = NULL, at;
char *grpname;
int nframes, n_alloc, i, j, k, d;
rvec mv_mol, cm_mol, kfac[NK];
int nkc, nk, ntc;
- real **c1, **tc;
+ real **tc;
output_env_t oenv;
#define NHISTO 360
n_alloc = 0;
nframes = 0;
rho = 0;
- /* bCubic = TRUE; */
+
do
{
- /*
- bCubic = bCubic && !TRICLINIC(fr.box) &&
- fabs(fr.box[XX][XX]-fr.box[YY][YY]) < 0.001*fr.box[XX][XX] &&
- fabs(fr.box[XX][XX]-fr.box[ZZ][ZZ]) < 0.001*fr.box[XX][XX];
- */
if (nframes >= n_alloc)
{
j = 0;
for (k = 0; k < nk; k++)
{
- sx = sin(iprod(kfac[k], cm_mol));
- cx = cos(iprod(kfac[k], cm_mol));
+ sx = std::sin(iprod(kfac[k], cm_mol));
+ cx = std::cos(iprod(kfac[k], cm_mol));
tc[j][nframes] += sx*iprod(v1[k], mv_mol);
j++;
tc[j][nframes] += cx*iprod(v1[k], mv_mol);