Added extern-c declarations to gmxcpp.h for calling
from the new C++ source.
Change-Id: I7b21398808a1d58849bff44690ece4d1f4e9db04
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015, 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.
* 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.
#ifndef GMX_GMXPREPROCESS_GMXCPP_H
#define GMX_GMXPREPROCESS_GMXCPP_H
#ifndef GMX_GMXPREPROCESS_GMXCPP_H
#define GMX_GMXPREPROCESS_GMXCPP_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct gmx_cpp *gmx_cpp_t;
/* The possible return codes for these functions */
typedef struct gmx_cpp *gmx_cpp_t;
/* The possible return codes for these functions */
NOT THREAD SAFE
*/
char *cpp_error(gmx_cpp_t *handlep, int status);
NOT THREAD SAFE
*/
char *cpp_error(gmx_cpp_t *handlep, int status);
+
+#ifdef __cplusplus
+}
+#endif
+
#
# This file is part of the GROMACS molecular simulation package.
#
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014, by the GROMACS development team, led by
+# Copyright (c) 2014,2015, 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.
# 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.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-file(GLOB TOOLS_SOURCES *.cpp *.c)
+file(GLOB TOOLS_SOURCES *.cpp)
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOOLS_SOURCES} PARENT_SCOPE)
if (BUILD_TESTING)
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOOLS_SOURCES} PARENT_SCOPE)
if (BUILD_TESTING)
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
+#include <cmath>
+#include <cstdio>
+#include <cstring>
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
static void tpx2system(FILE *fp, gmx_mtop_t *mtop)
{
static void tpx2system(FILE *fp, gmx_mtop_t *mtop)
{
- int i, nmol, nvsite = 0;
gmx_mtop_atomloop_block_t aloop;
t_atom *atom;
gmx_mtop_atomloop_block_t aloop;
t_atom *atom;
static void tpx2methods(const char *tpx, const char *tex)
{
FILE *fp;
static void tpx2methods(const char *tpx, const char *tex)
{
FILE *fp;
t_inputrec ir;
t_state state;
gmx_mtop_t mtop;
t_inputrec ir;
t_state state;
gmx_mtop_t mtop;
static void chk_bonds(t_idef *idef, int ePBC, rvec *x, matrix box, real tol)
{
static void chk_bonds(t_idef *idef, int ePBC, rvec *x, matrix box, real tol)
{
- int ftype, i, k, ai, aj, type;
- real b0, blen, deviation, devtot;
+ int ftype, k, ai, aj, type;
+ real b0, blen, deviation;
set_pbc(&pbc, ePBC, box);
for (ftype = 0; (ftype < F_NRE); ftype++)
{
set_pbc(&pbc, ePBC, box);
for (ftype = 0; (ftype < F_NRE); ftype++)
{
b0 = idef->iparams[type].harmonic.rA;
break;
case F_G96BONDS:
b0 = idef->iparams[type].harmonic.rA;
break;
case F_G96BONDS:
- b0 = sqrt(idef->iparams[type].harmonic.rA);
+ b0 = std::sqrt(idef->iparams[type].harmonic.rA);
break;
case F_MORSE:
b0 = idef->iparams[type].morse.b0A;
break;
case F_MORSE:
b0 = idef->iparams[type].morse.b0A;
pbc_dx(&pbc, x[ai], x[aj], dx);
blen = norm(dx);
deviation = sqr(blen-b0);
pbc_dx(&pbc, x[ai], x[aj], dx);
blen = norm(dx);
deviation = sqr(blen-b0);
- if (sqrt(deviation/sqr(b0) > tol))
+ if (std::sqrt(deviation/sqr(b0)) > tol)
{
fprintf(stderr, "Distance between atoms %d and %d is %.3f, should be %.3f\n", ai+1, aj+1, blen, b0);
}
{
fprintf(stderr, "Distance between atoms %d and %d is %.3f, should be %.3f\n", ai+1, aj+1, blen, b0);
}
t_count count;
t_fr_time first, last;
int j = -1, new_natoms, natoms;
t_count count;
t_fr_time first, last;
int j = -1, new_natoms, natoms;
- real rdum, tt, old_t1, old_t2, prec;
- gmx_bool bShowTimestep = TRUE, bOK, newline = FALSE;
+ real old_t1, old_t2;
+ gmx_bool bShowTimestep = TRUE, newline = FALSE;
t_trxstatus *status;
gmx_mtop_t mtop;
gmx_localtop_t *top = NULL;
t_trxstatus *status;
gmx_mtop_t mtop;
gmx_localtop_t *top = NULL;
*(atoms->resinfo[atoms->atom[j].resind].name),
atoms->resinfo[atoms->atom[j].resind].nr,
atom_vdw[j],
*(atoms->resinfo[atoms->atom[j].resind].name),
atoms->resinfo[atoms->atom[j].resind].nr,
atom_vdw[j],
{
t_blocka *grps;
char **grpname;
{
t_blocka *grps;
char **grpname;
grps = init_index(fn, &grpname);
if (debug)
grps = init_index(fn, &grpname);
if (debug)
void chk_enx(const char *fn)
{
void chk_enx(const char *fn)
{
ener_file_t in;
gmx_enxnm_t *enm = NULL;
t_enxframe *fr;
ener_file_t in;
gmx_enxnm_t *enm = NULL;
t_enxframe *fr;
/*
* This file is part of the GROMACS molecular simulation package.
*
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015, 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.
* 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.
#ifndef GMX_TOOLS_CHECK_H
#define GMX_TOOLS_CHECK_H
#ifndef GMX_TOOLS_CHECK_H
#define GMX_TOOLS_CHECK_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
/*! \brief Implements gmx check
*
* \param[in] argc argc value passed to main().
/*! \brief Implements gmx check
*
* \param[in] argc argc value passed to main().
*/
int gmx_check(int argc, char *argv[]);
*/
int gmx_check(int argc, char *argv[]);
-#ifdef __cplusplus
-}
-#endif
-
* the research papers on the package. Check out http://www.gromacs.org.
*/
/* This file is completely threadsafe - keep it that way! */
* the research papers on the package. Check out http://www.gromacs.org.
*/
/* This file is completely threadsafe - keep it that way! */
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
+#include <cmath>
+#include <cstdio>
+#include <cstring>
+
+#include <algorithm>
#include "gromacs/fileio/enxio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/enxio.h"
#include "gromacs/fileio/tpxio.h"
if (i1 != i2)
{
fprintf(fp, "%s (", s);
if (i1 != i2)
{
fprintf(fp, "%s (", s);
- fprintf(fp, "%"GMX_PRId64, i1);
+ fprintf(fp, "%" GMX_PRId64, i1);
- fprintf(fp, "%"GMX_PRId64, i2);
+ fprintf(fp, "%" GMX_PRId64, i2);
static void cmp_str(FILE *fp, const char *s, int index,
const char *s1, const char *s2)
{
static void cmp_str(FILE *fp, const char *s, int index,
const char *s1, const char *s2)
{
- if (strcmp(s1, s2) != 0)
+ if (std::strcmp(s1, s2) != 0)
{
cmp_int(fp, "idef->ntypes", -1, id1->ntypes, id2->ntypes);
cmp_int(fp, "idef->atnr", -1, id1->atnr, id2->atnr);
{
cmp_int(fp, "idef->ntypes", -1, id1->ntypes, id2->ntypes);
cmp_int(fp, "idef->atnr", -1, id1->atnr, id2->atnr);
- for (i = 0; (i < min(id1->ntypes, id2->ntypes)); i++)
+ for (i = 0; (i < std::min(id1->ntypes, id2->ntypes)); i++)
{
sprintf(buf1, "idef->functype[%d]", i);
sprintf(buf2, "idef->iparam[%d]", i);
{
sprintf(buf1, "idef->functype[%d]", i);
sprintf(buf2, "idef->iparam[%d]", i);
static void cmp_block(FILE *fp, t_block *b1, t_block *b2, const char *s)
{
static void cmp_block(FILE *fp, t_block *b1, t_block *b2, const char *s)
{
char buf[32];
fprintf(fp, "comparing block %s\n", s);
char buf[32];
fprintf(fp, "comparing block %s\n", s);
static void cmp_blocka(FILE *fp, t_blocka *b1, t_blocka *b2, const char *s)
{
static void cmp_blocka(FILE *fp, t_blocka *b1, t_blocka *b2, const char *s)
{
char buf[32];
fprintf(fp, "comparing blocka %s\n", s);
char buf[32];
fprintf(fp, "comparing blocka %s\n", s);
static void cmp_atom(FILE *fp, int index, t_atom *a1, t_atom *a2, real ftol, real abstol)
{
static void cmp_atom(FILE *fp, int index, t_atom *a1, t_atom *a2, real ftol, real abstol)
{
- int i;
- char buf[256];
-
if (a2)
{
cmp_us(fp, "atom.type", index, a1->type, a2->type);
if (a2)
{
cmp_us(fp, "atom.type", index, a1->type, a2->type);
static void cmp_top(FILE *fp, t_topology *t1, t_topology *t2, real ftol, real abstol)
{
static void cmp_top(FILE *fp, t_topology *t1, t_topology *t2, real ftol, real abstol)
{
fprintf(fp, "comparing top\n");
if (t2)
{
fprintf(fp, "comparing top\n");
if (t2)
{
static void cmp_groups(FILE *fp, gmx_groups_t *g0, gmx_groups_t *g1,
int natoms0, int natoms1)
{
static void cmp_groups(FILE *fp, gmx_groups_t *g0, gmx_groups_t *g1,
int natoms0, int natoms1)
{
char buf[32];
fprintf(fp, "comparing groups\n");
char buf[32];
fprintf(fp, "comparing groups\n");
- fprintf(fp, "%s RMSD %g\n", title, sqrt(ssd/n));
+ fprintf(fp, "%s RMSD %g\n", title, std::sqrt(ssd/n));
- rms_x1 = sqrt(rms_x1/(DIM*n));
+ rms_x1 = std::sqrt(rms_x1/(DIM*n));
/* And now do the actual comparision with a hopefully realistic abstol. */
for (i = 0; (i < n); i++)
{
/* And now do the actual comparision with a hopefully realistic abstol. */
for (i = 0; (i < n); i++)
{
cmp_int(fp, "inputrec->grpopts.ngacc", -1, opt1->ngacc, opt2->ngacc);
cmp_int(fp, "inputrec->grpopts.ngfrz", -1, opt1->ngfrz, opt2->ngfrz);
cmp_int(fp, "inputrec->grpopts.ngener", -1, opt1->ngener, opt2->ngener);
cmp_int(fp, "inputrec->grpopts.ngacc", -1, opt1->ngacc, opt2->ngacc);
cmp_int(fp, "inputrec->grpopts.ngfrz", -1, opt1->ngfrz, opt2->ngfrz);
cmp_int(fp, "inputrec->grpopts.ngener", -1, opt1->ngener, opt2->ngener);
- for (i = 0; (i < min(opt1->ngtc, opt2->ngtc)); i++)
+ for (i = 0; (i < std::min(opt1->ngtc, opt2->ngtc)); i++)
{
cmp_real(fp, "inputrec->grpopts.nrdf", i, opt1->nrdf[i], opt2->nrdf[i], ftol, abstol);
cmp_real(fp, "inputrec->grpopts.ref_t", i, opt1->ref_t[i], opt2->ref_t[i], ftol, abstol);
{
cmp_real(fp, "inputrec->grpopts.nrdf", i, opt1->nrdf[i], opt2->nrdf[i], ftol, abstol);
cmp_real(fp, "inputrec->grpopts.ref_t", i, opt1->ref_t[i], opt2->ref_t[i], ftol, abstol);
- for (i = 0; (i < min(opt1->ngacc, opt2->ngacc)); i++)
+ for (i = 0; (i < std::min(opt1->ngacc, opt2->ngacc)); i++)
{
cmp_rvec(fp, "inputrec->grpopts.acc", i, opt1->acc[i], opt2->acc[i], ftol, abstol);
}
{
cmp_rvec(fp, "inputrec->grpopts.acc", i, opt1->acc[i], opt2->acc[i], ftol, abstol);
}
- for (i = 0; (i < min(opt1->ngfrz, opt2->ngfrz)); i++)
+ for (i = 0; (i < std::min(opt1->ngfrz, opt2->ngfrz)); i++)
{
cmp_ivec(fp, "inputrec->grpopts.nFreeze", i, opt1->nFreeze[i], opt2->nFreeze[i]);
}
{
cmp_ivec(fp, "inputrec->grpopts.nFreeze", i, opt1->nFreeze[i], opt2->nFreeze[i]);
}
{
sprintf(buf, "inputrec->%s[%d]", s, m);
cmp_int(fp, buf, 0, c1->n, c2->n);
{
sprintf(buf, "inputrec->%s[%d]", s, m);
cmp_int(fp, buf, 0, c1->n, c2->n);
- for (i = 0; (i < min(c1->n, c2->n)); i++)
+ for (i = 0; (i < std::min(c1->n, c2->n)); i++)
{
cmp_real(fp, buf, i, c1->a[i], c2->a[i], ftol, abstol);
cmp_real(fp, buf, i, c1->phi[i], c2->phi[i], ftol, abstol);
{
cmp_real(fp, buf, i, c1->a[i], c2->a[i], ftol, abstol);
cmp_real(fp, buf, i, c1->phi[i], c2->phi[i], ftol, abstol);
cmp_int(fp, "inputrec->fepvals->n_lambda", -1, fep1->n_lambda, fep2->n_lambda);
for (i = 0; i < efptNR; i++)
{
cmp_int(fp, "inputrec->fepvals->n_lambda", -1, fep1->n_lambda, fep2->n_lambda);
for (i = 0; i < efptNR; i++)
{
- for (j = 0; j < min(fep1->n_lambda, fep2->n_lambda); j++)
+ for (j = 0; j < std::min(fep1->n_lambda, fep2->n_lambda); j++)
{
cmp_double(fp, "inputrec->fepvals->all_lambda", -1, fep1->all_lambda[i][j], fep2->all_lambda[i][j], ftol, abstol);
}
{
cmp_double(fp, "inputrec->fepvals->all_lambda", -1, fep1->all_lambda[i][j], fep2->all_lambda[i][j], ftol, abstol);
}
cmp_int(fp, "inputrec->bSimTemp", -1, ir1->bSimTemp, ir2->bSimTemp);
if ((ir1->bSimTemp == ir2->bSimTemp) && (ir1->bSimTemp))
{
cmp_int(fp, "inputrec->bSimTemp", -1, ir1->bSimTemp, ir2->bSimTemp);
if ((ir1->bSimTemp == ir2->bSimTemp) && (ir1->bSimTemp))
{
- cmp_simtempvals(fp, ir1->simtempvals, ir2->simtempvals, min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
+ cmp_simtempvals(fp, ir1->simtempvals, ir2->simtempvals, std::min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
}
cmp_int(fp, "inputrec->bExpanded", -1, ir1->bExpanded, ir2->bExpanded);
if ((ir1->bExpanded == ir2->bExpanded) && (ir1->bExpanded))
{
}
cmp_int(fp, "inputrec->bExpanded", -1, ir1->bExpanded, ir2->bExpanded);
if ((ir1->bExpanded == ir2->bExpanded) && (ir1->bExpanded))
{
- cmp_expandedvals(fp, ir1->expandedvals, ir2->expandedvals, min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
+ cmp_expandedvals(fp, ir1->expandedvals, ir2->expandedvals, std::min(ir1->fepvals->n_lambda, ir2->fepvals->n_lambda), ftol, abstol);
}
cmp_int(fp, "inputrec->nwall", -1, ir1->nwall, ir2->nwall);
cmp_int(fp, "inputrec->wall_type", -1, ir1->wall_type, ir2->wall_type);
}
cmp_int(fp, "inputrec->nwall", -1, ir1->nwall, ir2->nwall);
cmp_int(fp, "inputrec->wall_type", -1, ir1->wall_type, ir2->wall_type);
gmx_bool bRMSD, real ftol, real abstol)
{
const char *ff[2];
gmx_bool bRMSD, real ftol, real abstol)
{
const char *ff[2];
t_inputrec ir[2];
t_state state[2];
gmx_mtop_t mtop[2];
t_inputrec ir[2];
t_state state[2];
gmx_mtop_t mtop[2];
}
if (cmp_bool(fp, "bX", -1, fr1->bX, fr2->bX))
{
}
if (cmp_bool(fp, "bX", -1, fr1->bX, fr2->bX))
{
- cmp_rvecs(fp, "x", min(fr1->natoms, fr2->natoms), fr1->x, fr2->x, bRMSD, ftol, abstol);
+ cmp_rvecs(fp, "x", std::min(fr1->natoms, fr2->natoms), fr1->x, fr2->x, bRMSD, ftol, abstol);
}
if (cmp_bool(fp, "bV", -1, fr1->bV, fr2->bV))
{
}
if (cmp_bool(fp, "bV", -1, fr1->bV, fr2->bV))
{
- cmp_rvecs(fp, "v", min(fr1->natoms, fr2->natoms), fr1->v, fr2->v, bRMSD, ftol, abstol);
+ cmp_rvecs(fp, "v", std::min(fr1->natoms, fr2->natoms), fr1->v, fr2->v, bRMSD, ftol, abstol);
}
if (cmp_bool(fp, "bF", -1, fr1->bF, fr2->bF))
{
if (bRMSD)
{
}
if (cmp_bool(fp, "bF", -1, fr1->bF, fr2->bF))
{
if (bRMSD)
{
- cmp_rvecs(fp, "f", min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, bRMSD, ftol, abstol);
+ cmp_rvecs(fp, "f", std::min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, bRMSD, ftol, abstol);
- cmp_rvecs_rmstol(fp, "f", min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, ftol, abstol);
+ cmp_rvecs_rmstol(fp, "f", std::min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, ftol, abstol);
}
}
if (cmp_bool(fp, "bBox", -1, fr1->bBox, fr2->bBox))
}
}
if (cmp_bool(fp, "bBox", -1, fr1->bBox, fr2->bBox))
int *tensi, int i,
t_energy e1[], t_energy e2[])
{
int *tensi, int i,
t_energy e1[], t_energy e2[])
{
- int d1, d2;
- int len;
- int j;
- real prod1, prod2;
- int nfound;
+ int d1, d2;
+ int j;
+ real prod1, prod2;
+ int nfound;
+ size_t len;
d1 = tensi[i]/DIM;
d2 = tensi[i] - d1*DIM;
/* Find the diagonal elements d1 and d2 */
d1 = tensi[i]/DIM;
d2 = tensi[i] - d1*DIM;
/* Find the diagonal elements d1 and d2 */
- len = strlen(enm1[ind1[i]].name);
+ len = std::strlen(enm1[ind1[i]].name);
prod1 = 1;
prod2 = 1;
nfound = 0;
for (j = 0; j < n; j++)
{
if (tensi[j] >= 0 &&
prod1 = 1;
prod2 = 1;
nfound = 0;
for (j = 0; j < n; j++)
{
if (tensi[j] >= 0 &&
- strlen(enm1[ind1[j]].name) == len &&
- strncmp(enm1[ind1[i]].name, enm1[ind1[j]].name, len-2) == 0 &&
+ std::strlen(enm1[ind1[j]].name) == len &&
+ std::strncmp(enm1[ind1[i]].name, enm1[ind1[j]].name, len-2) == 0 &&
(tensi[j] == d1*DIM+d1 || tensi[j] == d2*DIM+d2))
{
prod1 *= fabs(e1[ind1[j]].e);
(tensi[j] == d1*DIM+d1 || tensi[j] == d2*DIM+d2))
{
prod1 *= fabs(e1[ind1[j]].e);
- return 0.5*(sqrt(prod1) + sqrt(prod2));
+ return 0.5*(std::sqrt(prod1) + std::sqrt(prod2));
- len1 = strlen(nm1);
- len2 = strlen(nm2);
+ len1 = std::strlen(nm1);
+ len2 = std::strlen(nm2);
/* Remove " (bar)" at the end of a name */
/* Remove " (bar)" at the end of a name */
- if (len1 > 6 && strcmp(nm1+len1-6, " (bar)") == 0)
+ if (len1 > 6 && std::strcmp(nm1+len1-6, " (bar)") == 0)
- if (len2 > 6 && strcmp(nm2+len2-6, " (bar)") == 0)
+ if (len2 > 6 && std::strcmp(nm2+len2-6, " (bar)") == 0)
{
ii = ind1[i];
tensi[i] = -1;
{
ii = ind1[i];
tensi[i] = -1;
- len = strlen(enm1[ii].name);
+ len = std::strlen(enm1[ii].name);
if (len > 3 && enm1[ii].name[len-3] == '-')
{
d1 = enm1[ii].name[len-2] - 'X';
if (len > 3 && enm1[ii].name[len-3] == '-')
{
d1 = enm1[ii].name[len-2] - 'X';
if (abstol_i > 0)
{
/* We found a diagonal, we need to check with the minimum tolerance */
if (abstol_i > 0)
{
/* We found a diagonal, we need to check with the minimum tolerance */
- abstol_i = min(abstol_i, abstol);
+ abstol_i = std::min(abstol_i, abstol);
void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol, const char *lastener)
{
void comp_enx(const char *fn1, const char *fn2, real ftol, real abstol, const char *lastener)
{
- int nre, nre1, nre2, block;
ener_file_t in1, in2;
int i, j, maxener, *ind1, *ind2, *have;
ener_file_t in1, in2;
int i, j, maxener, *ind1, *ind2, *have;
gmx_enxnm_t *enm1 = NULL, *enm2 = NULL;
t_enxframe *fr1, *fr2;
gmx_bool b1, b2;
gmx_enxnm_t *enm1 = NULL, *enm2 = NULL;
t_enxframe *fr1, *fr2;
gmx_bool b1, b2;
maxener = nre;
for (i = 0; i < nre; i++)
{
maxener = nre;
for (i = 0; i < nre; i++)
{
- if ((lastener != NULL) && (strstr(enm1[i].name, lastener) != NULL))
+ if ((lastener != NULL) && (std::strstr(enm1[i].name, lastener) != NULL))
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/enxio.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/enxio.h"
gmx_bool bFrame, bUse, bSel, bNeedEner, bReadEner, bScanEner, bFepState;
gmx_mtop_t mtop;
t_atoms atoms;
gmx_bool bFrame, bUse, bSel, bNeedEner, bReadEner, bScanEner, bFepState;
gmx_mtop_t mtop;
t_atoms atoms;
- t_inputrec *ir, *irnew = NULL;
- t_gromppopts *gopts;
t_state state;
rvec *newx = NULL, *newv = NULL, *tmpx, *tmpv;
matrix newbox;
t_state state;
rvec *newx = NULL, *newv = NULL, *tmpx, *tmpv;
matrix newbox;
{ "-init_fep_state", FALSE, etINT, {&init_fep_state},
"fep state to initialize from" },
};
{ "-init_fep_state", FALSE, etINT, {&init_fep_state},
"fep state to initialize from" },
};
/* Parse the command line */
if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
/* Parse the command line */
if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
if (EI_SD(ir->eI) || ir->eI == eiBD)
{
if (EI_SD(ir->eI) || ir->eI == eiBD)
{
- fprintf(stderr, "\nChanging ld-seed from %"GMX_PRId64 " ", ir->ld_seed);
+ fprintf(stderr, "\nChanging ld-seed from %" GMX_PRId64 " ", ir->ld_seed);
ir->ld_seed = (gmx_int64_t)gmx_rng_make_seed();
ir->ld_seed = (gmx_int64_t)gmx_rng_make_seed();
- fprintf(stderr, "to %"GMX_PRId64 "\n\n", ir->ld_seed);
+ fprintf(stderr, "to %" GMX_PRId64 "\n\n", ir->ld_seed);
}
frame_fn = ftp2fn(efTRN, NFILE, fnm);
}
frame_fn = ftp2fn(efTRN, NFILE, fnm);
/*
* This file is part of the GROMACS molecular simulation package.
*
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015, 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.
* 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.
#ifndef GMX_TOOLS_CONVERT_TPR_H
#define GMX_TOOLS_CONVERT_TPR_H
#ifndef GMX_TOOLS_CONVERT_TPR_H
#define GMX_TOOLS_CONVERT_TPR_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
/*! \brief Implements gmx convert-tpr
*
* \param[in] argc argc value passed to main().
/*! \brief Implements gmx convert-tpr
*
* \param[in] argc argc value passed to main().
*/
int gmx_convert_tpr(int argc, char *argv[]);
*/
int gmx_convert_tpr(int argc, char *argv[]);
-#ifdef __cplusplus
-}
-#endif
-
-#include <assert.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
+#include <cassert>
+#include <cmath>
+#include <cstdio>
+#include <cstring>
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/enxio.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/enxio.h"
gmx_bool bSysTop)
{
FILE *gp;
gmx_bool bSysTop)
{
FILE *gp;
- int fp, indent, i, j, **gcount, atot;
+ int indent, i, j, **gcount, atot;
t_state state;
rvec *f = NULL;
t_inputrec ir;
t_state state;
rvec *f = NULL;
t_inputrec ir;
if (available(stdout, &tpx, 0, fn))
{
indent = 0;
if (available(stdout, &tpx, 0, fn))
{
indent = 0;
- indent = pr_title(stdout, indent, fn);
+ pr_title(stdout, indent, fn);
pr_inputrec(stdout, 0, "inputrec", tpx.bIr ? &(ir) : NULL, FALSE);
pr_inputrec(stdout, 0, "inputrec", tpx.bIr ? &(ir) : NULL, FALSE);
pr_header(stdout, indent, "header", &(tpx));
if (!bSysTop)
pr_header(stdout, indent, "header", &(tpx));
if (!bSysTop)
void list_ene(const char *fn)
{
void list_ene(const char *fn)
{
ener_file_t in;
gmx_bool bCont;
gmx_enxnm_t *enm = NULL;
t_enxframe *fr;
int i, j, nre, b;
ener_file_t in;
gmx_bool bCont;
gmx_enxnm_t *enm = NULL;
t_enxframe *fr;
int i, j, nre, b;
char buf[22];
printf("gmx dump: %s\n", fn);
char buf[22];
printf("gmx dump: %s\n", fn);
printf("%5d %-24s (%s)\n", i, enm[i].name, enm[i].unit);
}
printf("%5d %-24s (%s)\n", i, enm[i].name, enm[i].unit);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015, 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.
* 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.
#ifndef GMX_TOOLS_DUMP_H
#define GMX_TOOLS_DUMP_H
#ifndef GMX_TOOLS_DUMP_H
#define GMX_TOOLS_DUMP_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
/*! \brief Implements gmx dump
*
* \param[in] argc argc value passed to main().
/*! \brief Implements gmx dump
*
* \param[in] argc argc value passed to main().
*/
int gmx_dump(int argc, char *argv[]);
*/
int gmx_dump(int argc, char *argv[]);
-#ifdef __cplusplus
-}
-#endif
-