*
* 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,2017, 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.
int seed, real kT,
const char *conv, gmx_output_env_t *oenv)
{
- FILE *fp = NULL;
+ FILE *fp = nullptr;
real ecur, enext, emin, prob, enorm;
int i, j, iswap, jswap, nn, nuphill = 0;
t_mat *minimum;
minimum->nn = nn;
copy_t_mat(minimum, m);
- if (NULL != conv)
+ if (nullptr != conv)
{
fp = xvgropen(conv, "Convergence of the MC optimization",
"Energy", "Step", oenv);
fprintf(log, "Iter: %d Swapped %4d and %4d (energy: %g prob: %g)\n",
i, iswap, jswap, enext, prob);
- if (NULL != fp)
+ if (nullptr != fp)
{
fprintf(fp, "%6d %10g\n", i, enext);
}
(i < m->nn-1) ? m->mat[m->m_ind[i]][m->m_ind[i+1]] : 0);
}
- if (NULL != fp)
+ if (nullptr != fp)
{
xvgrclose(fp);
}
int **nnb;
int i, j, k, cid, diff, maxval;
gmx_bool bChange;
- real **mcpy = NULL;
+ real **mcpy = nullptr;
if (rmsdcut < 0)
{
max_nf = 0;
- xx = NULL;
- *time = NULL;
+ xx = nullptr;
+ *time = nullptr;
natom = read_first_x(oenv, &status, fn, &t, &x, box);
i = 0;
i0 = 0;
gmx_bool bFit, FILE *log, t_rgb rlo, t_rgb rhi,
const gmx_output_env_t *oenv)
{
- FILE *size_fp = NULL;
+ FILE *size_fp = nullptr;
char buf[STRLEN], buf1[40], buf2[40], buf3[40], *trxsfn;
- t_trxstatus *trxout = NULL;
- t_trxstatus *trxsout = NULL;
+ t_trxstatus *trxout = nullptr;
+ t_trxstatus *trxsout = nullptr;
int i, i1, cl, nstr, *structure, first = 0, midstr;
- gmx_bool *bWrite = NULL;
+ gmx_bool *bWrite = nullptr;
real r, clrmsd, midrmsd;
- rvec *xav = NULL;
+ rvec *xav = nullptr;
matrix zerobox;
clear_mat(zerobox);
ffprintf_d(stderr, log, buf, "\nFound %d clusters\n\n", clust->ncl);
- trxsfn = NULL;
+ trxsfn = nullptr;
if (trxfn)
{
/* do we write all structures? */
/* Prepare a reference structure for the orientation of the clusters */
if (bFit)
{
- reset_x(ifsize, fitidx, natom, NULL, xtps, mass);
+ reset_x(ifsize, fitidx, natom, nullptr, xtps, mass);
}
trxout = open_trx(trxfn, "w");
/* Calculate the average structure in each cluster, *
{
if (bFit)
{
- reset_x(ifsize, fitidx, natom, NULL, xx[i1], mass);
+ reset_x(ifsize, fitidx, natom, nullptr, xx[i1], mass);
}
if (nstr == 1)
{
if (bWrite[i])
{
write_trx(trxsout, iosize, outidx, atoms, i, time[structure[i]], zerobox,
- xx[structure[i]], NULL, NULL);
+ xx[structure[i]], nullptr, nullptr);
}
}
close_trx(trxsout);
}
if (bFit)
{
- reset_x(ifsize, fitidx, natom, NULL, xav, mass);
+ reset_x(ifsize, fitidx, natom, nullptr, xav, mass);
}
}
if (bFit)
{
do_fit(natom, mass, xtps, xav);
}
- write_trx(trxout, iosize, outidx, atoms, cl, time[midstr], zerobox, xav, NULL, NULL);
+ write_trx(trxout, iosize, outidx, atoms, cl, time[midstr], zerobox, xav, nullptr, nullptr);
}
}
/* clean up */
gmx_int64_t nrms = 0;
matrix box;
- rvec *xtps, *usextps, *x1, **xx = NULL;
+ rvec *xtps, *usextps, *x1, **xx = nullptr;
const char *fn, *trx_out_fn;
t_clusters clust;
- t_mat *rms, *orig = NULL;
+ t_mat *rms, *orig = nullptr;
real *eigenvalues;
t_topology top;
int ePBC;
t_atoms useatoms;
- t_matrix *readmat = NULL;
+ t_matrix *readmat = nullptr;
real *eigenvectors;
int isize = 0, ifsize = 0, iosize = 0;
- int *index = NULL, *fitidx = NULL, *outidx = NULL;
+ int *index = nullptr, *fitidx = nullptr, *outidx = nullptr;
char *grpname;
- real rmsd, **d1, **d2, *time = NULL, time_invfac, *mass = NULL;
+ real rmsd, **d1, **d2, *time = nullptr, time_invfac, *mass = nullptr;
char buf[STRLEN], buf1[80], title[STRLEN];
gmx_bool bAnalyze, bUseRmsdCut, bJP_RMSD = FALSE, bReadMat, bReadTraj, bPBC = TRUE;
int method, ncluster = 0;
static const char *methodname[] = {
- NULL, "linkage", "jarvis-patrick", "monte-carlo",
- "diagonalization", "gromos", NULL
+ nullptr, "linkage", "jarvis-patrick", "monte-carlo",
+ "diagonalization", "gromos", nullptr
};
enum {
m_null, m_linkage, m_jarvis_patrick,
static real kT = 1e-3;
static int M = 10, P = 3;
gmx_output_env_t *oenv;
- gmx_rmpbc_t gpbc = NULL;
+ gmx_rmpbc_t gpbc = nullptr;
t_pargs pa[] = {
{ "-dista", FALSE, etBOOL, {&bRMSdist},
{ &bPBC }, "PBC check" }
};
t_filenm fnm[] = {
- { efTRX, "-f", NULL, ffOPTRD },
- { efTPS, "-s", NULL, ffOPTRD },
- { efNDX, NULL, NULL, ffOPTRD },
+ { efTRX, "-f", nullptr, ffOPTRD },
+ { efTPS, "-s", nullptr, ffOPTRD },
+ { efNDX, nullptr, nullptr, ffOPTRD },
{ efXPM, "-dm", "rmsd", ffOPTRD },
{ efXPM, "-om", "rmsd-raw", ffWRITE },
{ efXPM, "-o", "rmsd-clust", ffWRITE },
if (!parse_common_args(&argc, argv,
PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
- NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL,
+ NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr,
&oenv))
{
return 0;
}
else
{
- trx_out_fn = NULL;
+ trx_out_fn = nullptr;
}
if (bReadMat && output_env_get_time_factor(oenv) != 1)
{
if (bReadTraj)
{
/* don't read mass-database as masses (and top) are not used */
- read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtps, NULL, box,
+ read_tps_conf(ftp2fn(efTPS, NFILE, fnm), &top, &ePBC, &xtps, nullptr, box,
TRUE);
if (bPBC)
{
{
for (i = 0; i < nf; i++)
{
- reset_x(ifsize, fitidx, isize, NULL, xx[i], mass);
+ reset_x(ifsize, fitidx, isize, nullptr, xx[i], mass);
}
}
}
useatoms.nr = isize;
analyze_clusters(nf, &clust, rms->mat, isize, &useatoms, usextps, mass, xx, time,
ifsize, fitidx, iosize, outidx,
- bReadTraj ? trx_out_fn : NULL,
+ bReadTraj ? trx_out_fn : nullptr,
opt2fn_null("-sz", NFILE, fnm),
opt2fn_null("-tr", NFILE, fnm),
opt2fn_null("-ntr", NFILE, fnm),
}
fprintf(stderr, "\n");
gmx_ffclose(fp);
- if (NULL != orig)
+ if (nullptr != orig)
{
fp = opt2FILE("-om", NFILE, fnm, "w");
sprintf(buf, "Time (%s)", output_env_get_time_unit(oenv));
do_view(oenv, opt2fn_null("-ntr", NFILE, fnm), "-nxy");
do_view(oenv, opt2fn_null("-clid", NFILE, fnm), "-nxy");
}
- do_view(oenv, opt2fn_null("-conv", NFILE, fnm), NULL);
+ do_view(oenv, opt2fn_null("-conv", NFILE, fnm), nullptr);
return 0;
}