Add more const correctness
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Mar 2016 17:06:15 +0000 (18:06 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Sat, 19 Mar 2016 13:49:16 +0000 (14:49 +0100)
This helps reduce the size of a future change to how we handle reading
and writing conformation files.

In particular, the way we write symmetric low-level I/O routines that
do both reading or writing according to the value of a parameter
requires that parameters for values to be written are passed as
non-const at some level of the call stack. In several cases, this
change moves that point lower down, so that routines whose job is
writing complex data to files take const parameters. Improving this
helps understand what is going on when e.g. an analysis tool reads in
coordinates, perhaps modifies them, and then writes them. The down
side is that we need to use some const_cast as we get close to the
low-level routines.

Change-Id: I5c22d8681fa5f247f302409bf67b062ebc9fe766

90 files changed:
src/gromacs/fft/calcgrid.cpp
src/gromacs/fft/calcgrid.h
src/gromacs/fileio/confio.cpp
src/gromacs/fileio/confio.h
src/gromacs/fileio/enxio.cpp
src/gromacs/fileio/enxio.h
src/gromacs/fileio/espio.cpp
src/gromacs/fileio/espio.h
src/gromacs/fileio/g96io.cpp
src/gromacs/fileio/g96io.h
src/gromacs/fileio/groio.cpp
src/gromacs/fileio/groio.h
src/gromacs/fileio/pdbio.cpp
src/gromacs/fileio/pdbio.h
src/gromacs/fileio/tngio_for_tools.cpp
src/gromacs/fileio/tngio_for_tools.h
src/gromacs/fileio/tpxio.cpp
src/gromacs/fileio/tpxio.h
src/gromacs/fileio/trrio.cpp
src/gromacs/fileio/trrio.h
src/gromacs/fileio/trxio.cpp
src/gromacs/fileio/trxio.h
src/gromacs/fileio/xtcio.cpp
src/gromacs/fileio/xtcio.h
src/gromacs/gmxana/dlist.cpp
src/gromacs/gmxana/eigio.cpp
src/gromacs/gmxana/eigio.h
src/gromacs/gmxana/gmx_anaeig.cpp
src/gromacs/gmxana/gmx_chi.cpp
src/gromacs/gmxana/gmx_confrms.cpp
src/gromacs/gmxana/gmx_densorder.cpp
src/gromacs/gmxana/gmx_dipoles.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxana/gmx_dos.cpp
src/gromacs/gmxana/gmx_dyndom.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_h2order.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_make_edi.cpp
src/gromacs/gmxana/gmx_make_ndx.cpp
src/gromacs/gmxana/gmx_mindist.cpp
src/gromacs/gmxana/gmx_mk_angndx.cpp
src/gromacs/gmxana/gmx_msd.cpp
src/gromacs/gmxana/gmx_nmeig.cpp
src/gromacs/gmxana/gmx_order.cpp
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxana/gmx_potential.cpp
src/gromacs/gmxana/gmx_principal.cpp
src/gromacs/gmxana/gmx_rms.cpp
src/gromacs/gmxana/gmx_rmsdist.cpp
src/gromacs/gmxana/gmx_rmsf.cpp
src/gromacs/gmxana/gmx_rotmat.cpp
src/gromacs/gmxana/gmx_saltbr.cpp
src/gromacs/gmxana/gmx_spol.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxana/gmx_velacc.cpp
src/gromacs/gmxana/gstat.h
src/gromacs/gmxana/hxprops.cpp
src/gromacs/gmxana/hxprops.h
src/gromacs/gmxana/nrama.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/gmxana/nsfactor.h
src/gromacs/gmxana/princ.cpp
src/gromacs/gmxana/princ.h
src/gromacs/gmxana/sfactor.cpp
src/gromacs/gmxana/sfactor.h
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/solvate.cpp
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/topio.h
src/gromacs/gmxpreprocess/x2top.cpp
src/gromacs/math/3dtransforms.cpp
src/gromacs/math/3dtransforms.h
src/gromacs/math/do_fit.cpp
src/gromacs/math/do_fit.h
src/gromacs/mdlib/perf_est.cpp
src/gromacs/mdlib/perf_est.h
src/gromacs/pbcutil/mshift.cpp
src/gromacs/pbcutil/mshift.h
src/gromacs/pbcutil/rmpbc.cpp
src/gromacs/pbcutil/rmpbc.h
src/gromacs/tools/check.cpp
src/gromacs/tools/compare.cpp
src/gromacs/tools/compare.h
src/gromacs/topology/atoms.cpp
src/gromacs/topology/atoms.h
src/gromacs/topology/index.cpp
src/gromacs/topology/index.h
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/mtop_util.h

index 6de4a09b4ca36d5017104db09b45291c37c12462..8a32f6ef52c625f1fa2da96222fadbdd6ecfd9d2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016, 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.
@@ -59,7 +59,7 @@ const int grid_init[g_initNR] = { 6, 8, 10, 12, 14, 16, 20, 24, 25, 28, 32, 36,
 #define g_baseNR 14
 const int grid_base[g_baseNR] = { 45, 48, 50, 52, 54, 56, 60, 64, 70, 72, 75, 80, 81, 84 };
 
-real calc_grid(FILE *fp, matrix box, real gr_sp,
+real calc_grid(FILE *fp, const matrix box, real gr_sp,
                int *nx, int *ny, int *nz)
 {
     int  d, n[DIM];
index b42993cffb9f3d7d1bc529b163620827c10fce22..86eb76987240a3bdcd21edbe6f69e0fb780e9450 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016, 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.
@@ -43,7 +43,7 @@
 #include "gromacs/utility/real.h"
 
 real calc_grid(FILE *fp,
-               matrix box, real gr_sp,
+               const matrix box, real gr_sp,
                int *nx, int *ny, int *nz);
 /* Sets the number of grid points for each zero n* to the first reasonable
  * number which gives a spacing equal to or smaller than gr_sp.
index db6224bc8ad2fa510063a9e3dfbebede37a32183..3203b1c720f90125c3fff12272d27e1c7fda78d8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -62,8 +62,8 @@
 #include "gromacs/utility/smalloc.h"
 
 void write_sto_conf_indexed(const char *outfile, const char *title,
-                            t_atoms *atoms,
-                            rvec x[], rvec *v, int ePBC, matrix box,
+                            const t_atoms *atoms,
+                            const rvec x[], const rvec *v, int ePBC, const matrix box,
                             int nindex, int index[])
 {
     FILE       *out;
@@ -84,13 +84,13 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
             fr.title  = title;
             fr.natoms = atoms->nr;
             fr.bAtoms = TRUE;
-            fr.atoms  = atoms;
+            fr.atoms  = const_cast<t_atoms *>(atoms);
             fr.bX     = TRUE;
-            fr.x      = x;
+            fr.x      = const_cast<rvec *>(x);
             if (v)
             {
                 fr.bV = TRUE;
-                fr.v  = v;
+                fr.v  = const_cast<rvec *>(v);
             }
             fr.bBox = TRUE;
             copy_mat(box, fr.box);
@@ -119,8 +119,8 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
     }
 }
 
-void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms,
-                    rvec x[], rvec *v, int ePBC, matrix box)
+void write_sto_conf(const char *outfile, const char *title, const t_atoms *atoms,
+                    const rvec x[], const rvec *v, int ePBC, const matrix box)
 {
     FILE       *out;
     int         ftp;
@@ -138,13 +138,13 @@ void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms,
             fr.title  = title;
             fr.natoms = atoms->nr;
             fr.bAtoms = TRUE;
-            fr.atoms  = atoms;
+            fr.atoms  = const_cast<t_atoms *>(atoms); // TODO check
             fr.bX     = TRUE;
-            fr.x      = x;
+            fr.x      = const_cast<rvec *>(x);
             if (v)
             {
                 fr.bV = TRUE;
-                fr.v  = v;
+                fr.v  = const_cast<rvec *>(v);
             }
             fr.bBox = TRUE;
             copy_mat(box, fr.box);
@@ -174,7 +174,7 @@ void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms,
 
 void write_sto_conf_mtop(const char *outfile, const char *title,
                          gmx_mtop_t *mtop,
-                         rvec x[], rvec *v, int ePBC, matrix box)
+                         const rvec x[], const rvec *v, int ePBC, const matrix box)
 {
     int     ftp;
     FILE   *out;
index 6251da49973be78b31a11307222205df0e34bfe2..459c7167cea0952a77218907606b96e589ca7261 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -52,20 +52,20 @@ struct t_atoms;
 struct t_topology;
 
 void write_sto_conf_indexed(const char *outfile, const char *title,
-                            struct t_atoms *atoms,
-                            rvec x[], rvec *v, int ePBC, matrix box,
+                            const t_atoms *atoms,
+                            const rvec x[], const rvec *v, int ePBC, const matrix box,
                             int nindex, int index[]);
 /* like write_sto_conf, but indexed */
 
 void write_sto_conf(const char *outfile, const char *title,
-                    struct t_atoms *atoms,
-                    rvec x[], rvec *v, int ePBC, matrix box);
+                    const t_atoms *atoms,
+                    const rvec x[], const rvec *v, int ePBC, const matrix box);
 /* write atoms, x, v (if .gro and not NULL) and box (if not NULL)
  * to an STO (.gro or .pdb) file */
 
 void write_sto_conf_mtop(const char *outfile, const char *title,
                          struct gmx_mtop_t *mtop,
-                         rvec x[], rvec *v, int ePBC, matrix box);
+                         const rvec x[], const rvec *v, int ePBC, const matrix box);
 /* As write_sto_conf, but uses a gmx_mtop_t struct */
 
 gmx_bool read_tps_conf(const char *infile, struct t_topology *top,
index 2a276a26f935488b7be7d99b5f861f0bb44b59b9..b518868aabe209a74662111b0f8ab4c7f7b2916a 100644 (file)
@@ -1148,7 +1148,7 @@ static real find_energy(const char *name, int nre, gmx_enxnm_t *enm,
 }
 
 
-void get_enx_state(const char *fn, real t, gmx_groups_t *groups, t_inputrec *ir,
+void get_enx_state(const char *fn, real t, const gmx_groups_t *groups, t_inputrec *ir,
                    t_state *state)
 {
     /* Should match the names in mdebin.c */
index 9a71b475ba5a8d43c5d9a554ccbebca1f15a4068..c9c9807885635aca5d040014a502d9f69f4f68d6 100644 (file)
@@ -192,7 +192,7 @@ gmx_bool do_enx(ener_file_t ef, t_enxframe *fr);
 /* Reads enx_frames, memory in fr is (re)allocated if necessary */
 
 void get_enx_state(const char *fn, real t,
-                   gmx_groups_t *groups, t_inputrec *ir,
+                   const gmx_groups_t *groups, t_inputrec *ir,
                    t_state *state);
 /*
  * Reads state variables from enx file fn at time t.
index d17962beeda2ec19172d691f8e9792819dc58025..f101cda68c645d2ad61c99f4f2c0641fe01cbec4 100644 (file)
@@ -426,8 +426,8 @@ int get_espresso_coordnum(const char *infile)
 }
 
 void write_espresso_conf_indexed(FILE *out, const char *title,
-                                 t_atoms *atoms, int nx, int *index,
-                                 rvec *x, rvec *v, matrix box)
+                                 const t_atoms *atoms, int nx, int *index,
+                                 const rvec *x, const rvec *v, const matrix box)
 {
     int i, j;
 
index 49a3528987455443cf2ffe7810ebcb0008e8f7d5..b0d1fcba37c8d5dcb7f81a3ece7f11ea1302feb7 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2005, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -49,7 +49,7 @@ void gmx_espresso_read_conf(const char *infile,
 int get_espresso_coordnum(const char *infile);
 
 void write_espresso_conf_indexed(FILE *out, const char *title,
-                                 t_atoms *atoms, int nx, int *index,
-                                 rvec *x, rvec *v, matrix box);
+                                 const t_atoms *atoms, int nx, int *index,
+                                 const rvec *x, const rvec *v, const matrix box);
 
 #endif
index a5eb809dee9219ec549a6d3ca0b6ce31cc719c28..921479a08c2dc707f6379015850d74130f99b918 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -336,7 +336,7 @@ int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr,
     return natoms;
 }
 
-void write_g96_conf(FILE *out, t_trxframe *fr,
+void write_g96_conf(FILE *out, const t_trxframe *fr,
                     int nindex, const int *index)
 {
     t_atoms *atoms;
index 2dbccacc6a60a1a99d997c35ea89938fdde08fcd..1f4a8f6572410b62cbcb11ed853884bc9a9ce9c0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -58,7 +58,7 @@ int read_g96_conf(FILE *fp, const char *infile, struct t_trxframe *fr,
  * title, atoms, x, v can all be NULL, in which case they won't be read *
  * line holds the previous line for trajectory reading                  */
 
-void write_g96_conf(FILE *out, struct t_trxframe *fr, int nindex, const int *index);
+void write_g96_conf(FILE *out, const t_trxframe *fr, int nindex, const int *index);
 /* write a Gromos96 coordinate file or trajectory frame *
  * index can be NULL                                    */
 
index 4fa425fad26f754539d7001f139014cde08f9326..d627a203381d47329234e0618555d470dc5304bf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -431,7 +431,7 @@ static void make_hconf_format(int pr, gmx_bool bVel, char format[])
 
 }
 
-static void write_hconf_box(FILE *out, int pr, matrix box)
+static void write_hconf_box(FILE *out, int pr, const matrix box)
 {
     char format[100];
     int  l;
@@ -461,9 +461,9 @@ static void write_hconf_box(FILE *out, int pr, matrix box)
     }
 }
 
-void write_hconf_indexed_p(FILE *out, const char *title, t_atoms *atoms,
+void write_hconf_indexed_p(FILE *out, const char *title, const t_atoms *atoms,
                            int nx, const int index[], int pr,
-                           rvec *x, rvec *v, matrix box)
+                           const rvec *x, const rvec *v, const matrix box)
 {
     char resnm[6], nm[6], format[100];
     int  ai, i, resind, resnr;
@@ -519,7 +519,7 @@ void write_hconf_indexed_p(FILE *out, const char *title, t_atoms *atoms,
 }
 
 void write_hconf_mtop(FILE *out, const char *title, gmx_mtop_t *mtop, int pr,
-                      rvec *x, rvec *v, matrix box)
+                      const rvec *x, const rvec *v, const matrix box)
 {
     char                    format[100];
     int                     i, resnr;
@@ -557,8 +557,8 @@ void write_hconf_mtop(FILE *out, const char *title, gmx_mtop_t *mtop, int pr,
     fflush(out);
 }
 
-void write_hconf_p(FILE *out, const char *title, t_atoms *atoms, int pr,
-                   rvec *x, rvec *v, matrix box)
+void write_hconf_p(FILE *out, const char *title, const t_atoms *atoms, int pr,
+                   const rvec *x, const rvec *v, const matrix box)
 {
     int     *aa;
     int      i;
@@ -573,8 +573,8 @@ void write_hconf_p(FILE *out, const char *title, t_atoms *atoms, int pr,
 }
 
 void write_conf_p(const char *outfile, const char *title,
-                  t_atoms *atoms, int pr,
-                  rvec *x, rvec *v, matrix box)
+                  const t_atoms *atoms, int pr,
+                  const rvec *x, const rvec *v, const matrix box)
 {
     FILE *out;
 
index e64f37991ca8b8469a484a10365164185180d778..9ca94f1aadc2b74da9188121bedddc3b43f06d0a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -59,21 +59,21 @@ gmx_bool gro_next_x_or_v(FILE *status, struct t_trxframe *fr);
 int gro_first_x_or_v(FILE *status, struct t_trxframe *fr);
 /* read first/next x and/or v frame from gro file */
 
-void write_hconf_indexed_p(FILE *out, const char *title, struct t_atoms *atoms,
+void write_hconf_indexed_p(FILE *out, const char *title, const t_atoms *atoms,
                            int nx, const int index[], int ndec,
-                           rvec *x, rvec *v, matrix box);
+                           const rvec *x, const rvec *v, const matrix box);
 
 void write_hconf_mtop(FILE *out, const char *title, struct gmx_mtop_t *mtop, int pr,
-                      rvec *x, rvec *v, matrix box);
+                      const rvec *x, const rvec *v, const matrix box);
 
-void write_hconf_p(FILE *out, const char *title, struct t_atoms *atoms, int ndec,
-                   rvec *x, rvec *v, matrix box);
+void write_hconf_p(FILE *out, const char *title, const t_atoms *atoms, int ndec,
+                   const rvec *x, const rvec *v, const matrix box);
 /* Write a Gromos file with precision ndec: number of decimal places in x,
  * v has one place more. */
 
 void write_conf_p(const char *outfile, const char *title,
-                  struct t_atoms *atoms, int pr,
-                  rvec *x, rvec *v, matrix box);
+                  const t_atoms *atoms, int pr,
+                  const rvec *x, const rvec *v, const matrix box);
 
 #ifdef __cplusplus
 }
index e13ad287dc54a3de49d1b2e2c8db93f2739167f1..ddedd79e71c36e4097c92ab74d3c6e7095f1eba9 100644 (file)
@@ -115,7 +115,7 @@ static void xlate_atomname_gmx2pdb(char *name)
 }
 
 
-void gmx_write_pdb_box(FILE *out, int ePBC, matrix box)
+void gmx_write_pdb_box(FILE *out, int ePBC, const matrix box)
 {
     real alpha, beta, gamma;
 
@@ -260,8 +260,8 @@ static void read_cryst1(char *line, int *ePBC, matrix box)
 }
 
 void write_pdbfile_indexed(FILE *out, const char *title,
-                           t_atoms *atoms, rvec x[],
-                           int ePBC, matrix box, char chainid,
+                           const t_atoms *atoms, const rvec x[],
+                           int ePBC, const matrix box, char chainid,
                            int model_nr, int nindex, const int index[],
                            gmx_conect conect, gmx_bool bTerSepChains)
 {
@@ -411,8 +411,8 @@ void write_pdbfile_indexed(FILE *out, const char *title,
     gmx_residuetype_destroy(rt);
 }
 
-void write_pdbfile(FILE *out, const char *title, t_atoms *atoms, rvec x[],
-                   int ePBC, matrix box, char chainid, int model_nr, gmx_conect conect, gmx_bool bTerSepChains)
+void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms, const rvec x[],
+                   int ePBC, const matrix box, char chainid, int model_nr, gmx_conect conect, gmx_bool bTerSepChains)
 {
     int i, *index;
 
@@ -505,7 +505,7 @@ static void read_anisou(char line[], int natom, t_atoms *atoms)
     }
 }
 
-void get_pdb_atomnumber(t_atoms *atoms, gmx_atomprop_t aps)
+void get_pdb_atomnumber(const t_atoms *atoms, gmx_atomprop_t aps)
 {
     int    i, atomnumber, len;
     size_t k;
@@ -1027,7 +1027,7 @@ void gmx_pdb_read_conf(const char *infile,
     gmx_fio_fclose(in);
 }
 
-gmx_conect gmx_conect_generate(t_topology *top)
+gmx_conect gmx_conect_generate(const t_topology *top)
 {
     int        f, i;
     gmx_conect gc;
index 0f26330e42d5f6c228102cb52c60c60b97801a7f..3c268708882f2c3311357c36f6a5356ab32ba3be 100644 (file)
@@ -86,20 +86,20 @@ void pdb_use_ter(gmx_bool bSet);
 /* set read_pdbatoms to read upto 'TER' or 'ENDMDL' (default, bSet=FALSE).
    This function is fundamentally broken as far as thread-safety is concerned.*/
 
-void gmx_write_pdb_box(FILE *out, int ePBC, matrix box);
+void gmx_write_pdb_box(FILE *out, int ePBC, const matrix box);
 /* write the box in the CRYST1 record,
  * with ePBC=-1 the pbc is guessed from the box
  * This function is fundamentally broken as far as thread-safety is concerned.
  */
 
-void write_pdbfile_indexed(FILE *out, const char *title, struct t_atoms *atoms,
-                           rvec x[], int ePBC, matrix box, char chain,
+void write_pdbfile_indexed(FILE *out, const char *title, const t_atoms *atoms,
+                           const rvec x[], int ePBC, const matrix box, char chain,
                            int model_nr, int nindex, const int index[],
                            gmx_conect conect, gmx_bool bTerSepChains);
 /* REALLY low level */
 
-void write_pdbfile(FILE *out, const char *title, struct t_atoms *atoms,
-                   rvec x[], int ePBC, matrix box, char chain,
+void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms,
+                   const rvec x[], int ePBC, const matrix box, char chain,
                    int model_nr, gmx_conect conect, gmx_bool bTerSepChains);
 /* Low level pdb file writing routine.
  *
@@ -114,7 +114,7 @@ void write_pdbfile(FILE *out, const char *title, struct t_atoms *atoms,
  * which may be useful for visualization purposes.
  */
 
-void get_pdb_atomnumber(struct t_atoms *atoms, struct gmx_atomprop *aps);
+void get_pdb_atomnumber(const t_atoms *atoms, struct gmx_atomprop *aps);
 /* Routine to extract atomic numbers from the atom names */
 
 int read_pdbfile(FILE *in, char *title, int *model_nr,
@@ -150,7 +150,7 @@ gmx_bool gmx_conect_exist(gmx_conect conect, int ai, int aj);
 void gmx_conect_add(gmx_conect conect, int ai, int aj);
 /* Add a connection between ai and aj (numbered from 0 to natom-1) */
 
-gmx_conect gmx_conect_generate(struct t_topology *top);
+gmx_conect gmx_conect_generate(const t_topology *top);
 /* Generate a conect structure from a topology */
 
 gmx_conect gmx_conect_init(void);
index 5ef57a9e9581cb43a7c6e547e4dde78e61a9ce3f..e351aed6131a9523b5291726645dfd4701fae79e 100644 (file)
@@ -187,7 +187,7 @@ void gmx_prepare_tng_writing(const char              *filename,
 }
 
 void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
-                                 t_trxframe             *frame,
+                                 const t_trxframe       *frame,
                                  int                     natoms)
 {
 #if GMX_USE_TNG
index fc79008f5e3462dbcfb13aa7d5ebe0da6b811ee0..da0d7a7b331d6181ec9f515c7a7a9bcd80126fc8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -73,7 +73,7 @@ void gmx_prepare_tng_writing(const char              *filename,
  * atoms.
  */
 void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
-                                 struct t_trxframe      *frame,
+                                 const t_trxframe       *frame,
                                  int                     natoms);
 
 /*! \brief Creates a molecule containing only the indexed atoms and sets
index dc8ab90159a05ac344a3a120e0bc74b3445665e6..bc397ab5b6307a50dbb6640b78171c96fb94278d 100644 (file)
@@ -3635,12 +3635,15 @@ void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK)
 }
 
 void write_tpx_state(const char *fn,
-                     t_inputrec *ir, t_state *state, gmx_mtop_t *mtop)
+                     const t_inputrec *ir, const t_state *state, const gmx_mtop_t *mtop)
 {
     t_fileio *fio;
 
     fio = open_tpx(fn, "w");
-    do_tpx(fio, FALSE, ir, state, mtop, FALSE);
+    do_tpx(fio, FALSE,
+           const_cast<t_inputrec *>(ir),
+           const_cast<t_state *>(state),
+           const_cast<gmx_mtop_t *>(mtop), FALSE);
     close_tpx(fio);
 }
 
index 94cc055f549c3f468048fbed51719cf8b8f78f42..7201e38633fa828defe819fc61c3770a203633d1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -87,7 +87,7 @@ void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK);
  */
 
 void write_tpx_state(const char *fn,
-                     t_inputrec *ir, t_state *state, gmx_mtop_t *mtop);
+                     const t_inputrec *ir, const t_state *state, const gmx_mtop_t *mtop);
 /* Write a file, and close it again.
  */
 
index 6b4c392216fd83eb89acc11264d0b48f938db503..d812fc93cea03a61f1975f4f1db888b3706ca529 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -256,10 +256,10 @@ gmx_bool gmx_trr_read_frame_header(t_fileio *fio, gmx_trr_header_t *header, gmx_
 }
 
 void gmx_trr_write_single_frame(const char *fn, int step, real t, real lambda,
-                                rvec *box, int natoms, rvec *x, rvec *v, rvec *f)
+                                const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f)
 {
     t_fileio *fio = gmx_trr_open(fn, "w");
-    do_trr_frame(fio, false, &step, &t, &lambda, box, &natoms, x, v, f);
+    do_trr_frame(fio, false, &step, &t, &lambda, const_cast<rvec *>(box), &natoms, const_cast<rvec *>(x), const_cast<rvec *>(v), const_cast<rvec *>(f));
     gmx_trr_close(fio);
 }
 
@@ -272,9 +272,9 @@ void gmx_trr_read_single_frame(const char *fn, int *step, real *t, real *lambda,
 }
 
 void gmx_trr_write_frame(t_fileio *fio, int step, real t, real lambda,
-                         rvec *box, int natoms, rvec *x, rvec *v, rvec *f)
+                         const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f)
 {
-    if (!do_trr_frame(fio, false, &step, &t, &lambda, box, &natoms, x, v, f))
+    if (!do_trr_frame(fio, false, &step, &t, &lambda, const_cast<rvec *>(box), &natoms, const_cast<rvec *>(x), const_cast<rvec *>(v), const_cast<rvec *>(f)))
     {
         gmx_file("Cannot write trajectory frame; maybe you are out of disk space?");
     }
index 3f280576c029ba331c63a6642a5d93b1c5e575b0..489f25cb9c67f271697ef84b7321debe91c993c0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -112,7 +112,7 @@ gmx_bool gmx_trr_read_frame(struct t_fileio *fio, int *step, real *t, real *lamb
  */
 
 void gmx_trr_write_frame(struct t_fileio *fio, int step, real t, real lambda,
-                         rvec *box, int natoms, rvec *x, rvec *v, rvec *f);
+                         const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f);
 /* Write a trr frame to file fp, box, x, v, f may be NULL */
 
 void gmx_trr_read_single_header(const char *fn, gmx_trr_header_t *header);
@@ -125,7 +125,7 @@ void gmx_trr_read_single_frame(const char *fn, int *step, real *t, real *lambda,
  */
 
 void gmx_trr_write_single_frame(const char *fn, int step, real t, real lambda,
-                                rvec *box, int natoms, rvec *x, rvec *v, rvec *f);
+                                const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f);
 /* Write a single trr frame to file fn, which is closed afterwards */
 
 #ifdef __cplusplus
index f1db1680aa93e0afa8c2dd0f6b1d4083ee7d6096..3f0bf822e51d66905ccaa12780dca05d150f580d 100644 (file)
@@ -319,7 +319,7 @@ void set_trxframe_ePBC(t_trxframe *fr, int ePBC)
     fr->ePBC = ePBC;
 }
 
-int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
+int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
                            const int *ind, gmx_conect gc)
 {
     char  title[STRLEN];
@@ -596,7 +596,7 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
     return 0;
 }
 
-int write_trx(t_trxstatus *status, int nind, const int *ind, t_atoms *atoms,
+int write_trx(t_trxstatus *status, int nind, const int *ind, const t_atoms *atoms,
               int step, real time, matrix box, rvec x[], rvec *v,
               gmx_conect gc)
 {
@@ -608,7 +608,7 @@ int write_trx(t_trxstatus *status, int nind, const int *ind, t_atoms *atoms,
     fr.bTime  = TRUE;
     fr.time   = time;
     fr.bAtoms = atoms != NULL;
-    fr.atoms  = atoms;
+    fr.atoms  = const_cast<t_atoms *>(atoms);
     fr.bX     = TRUE;
     fr.x      = x;
     fr.bV     = v != NULL;
index 280ab82cd35d1ca9e58498417edff66fb98a13a7..3f9042ff0f626d63ce5e4cf6b17be6b379256fd6 100644 (file)
@@ -79,7 +79,7 @@ void set_trxframe_ePBC(struct t_trxframe *fr, int ePBC);
 int nframes_read(t_trxstatus *status);
 /* Returns the number of frames read from the trajectory */
 
-int write_trxframe_indexed(t_trxstatus *status, struct t_trxframe *fr, int nind,
+int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
                            const int *ind, gmx_conect gc);
 /* Write an indexed frame to a TRX file, see write_trxframe. gc may be NULL */
 
@@ -93,7 +93,7 @@ int write_trxframe(t_trxstatus *status, struct t_trxframe *fr, gmx_conect gc);
  * gc is important for pdb file writing only and may be NULL.
  */
 
-int write_trx(t_trxstatus *status, int nind, const int *ind, struct t_atoms *atoms,
+int write_trx(t_trxstatus *status, int nind, const int *ind, const t_atoms *atoms,
               int step, real time, matrix box, rvec x[], rvec *v,
               gmx_conect gc);
 /* Write an indexed frame to a TRX file.
index 4c11bb6ed6148fbdff956b48a5f3562ca9e6263e..89893e157a7d2ff9f55eef1e37d76f61c0b34f6e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -132,7 +132,7 @@ static int xtc_header(XDR *xd, int *magic, int *natoms, int *step, real *time,
     return result;
 }
 
-static int xtc_coord(XDR *xd, int *natoms, matrix box, rvec *x, real *prec, gmx_bool bRead)
+static int xtc_coord(XDR *xd, int *natoms, rvec *box, rvec *x, real *prec, gmx_bool bRead)
 {
     int    i, j, result;
 #if GMX_DOUBLE
@@ -195,7 +195,7 @@ static int xtc_coord(XDR *xd, int *natoms, matrix box, rvec *x, real *prec, gmx_
 
 int write_xtc(t_fileio *fio,
               int natoms, int step, real time,
-              matrix box, rvec *x, real prec)
+              const rvec *box, const rvec *x, real prec)
 {
     int      magic_number = XTC_MAGIC;
     XDR     *xd;
@@ -218,7 +218,7 @@ int write_xtc(t_fileio *fio,
     }
 
     /* write data */
-    bOK = xtc_coord(xd, &natoms, box, x, &prec, FALSE); /* bOK will be 1 if writing went well */
+    bOK = xtc_coord(xd, &natoms, const_cast<rvec *>(box), const_cast<rvec *>(x), &prec, FALSE); /* bOK will be 1 if writing went well */
 
     if (bOK)
     {
index 1d173f8ea5708d1f1afbebb2c908b526012c2eab..9a3ba015d146285a9a0d43b473fcf1c981295e04 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -70,7 +70,7 @@ int read_next_xtc(struct t_fileio *fio,
 
 int write_xtc(struct t_fileio *fio,
               int natoms, int step, real time,
-              matrix box, rvec *x, real prec);
+              const rvec *box, const rvec *x, real prec);
 /* Write a frame to xtc file */
 
 #ifdef __cplusplus
index d065c4ce2d5aee27a465cd4bcabdd13291a770cc..0b09a2842bf43bbcf82266fdf6004aab70c85ede 100644 (file)
@@ -46,7 +46,7 @@
 #include "gromacs/utility/smalloc.h"
 
 t_dlist *mk_dlist(FILE *log,
-                  t_atoms *atoms, int *nlist,
+                  const t_atoms *atoms, int *nlist,
                   gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
                   int maxchi, int r0, gmx_residuetype_t *rt)
 {
index 97daf30f4b90b70743e2d7d94ba6cf727e88368a..8b34c82ba529b6ea83a0cd2436e85c7aed937b8b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -141,10 +141,10 @@ void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
 }
 
 
-void write_eigenvectors(const char *trrname, int natoms, real mat[],
+void write_eigenvectors(const char *trrname, int natoms, const real mat[],
                         gmx_bool bReverse, int begin, int end,
-                        int WriteXref, rvec *xref, gmx_bool bDMR,
-                        rvec xav[], gmx_bool bDMA, real eigval[])
+                        int WriteXref, const rvec *xref, gmx_bool bDMR,
+                        const rvec xav[], gmx_bool bDMA, const real eigval[])
 {
     struct t_fileio *trrout;
     int              ndim, i, j, d, vec;
index 2b9a085511042a8ca4020be00d8d58e9b999ef94..f23a0d381ed46f1b52d219f78cb90493d717ca6e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -63,10 +63,10 @@ extern void read_eigenvectors(const char *file, int *natoms, gmx_bool *bFit,
 /* xav is the average/minimum structure is written (t=0).             */
 /* bDMA indicates mass weighted analysis/eigenvectors.                */
 
-extern void write_eigenvectors(const char *trrname, int natoms, real mat[],
+extern void write_eigenvectors(const char *trrname, int natoms, const real mat[],
                                gmx_bool bReverse, int begin, int end,
-                               int WriteXref, rvec *xref, gmx_bool bDMR,
-                               rvec xav[], gmx_bool bDMA, real *eigval);
+                               int WriteXref, const rvec *xref, gmx_bool bDMR,
+                               const rvec xav[], gmx_bool bDMA, const real *eigval);
 /* Write eigenvectors in mat to a TRR file.                           */
 /* The reference structure is written (t=-1) when WriteXref=eWXR_YES. */
 /* When WriteXref==eWXR_NOFIT a zero frame is written (t=-1),         */
index cdfb8474c07e2f210ddbac991036e73a06a91fd1..15fbfb13f403129bd9c1959b6a8406e4009f6c8f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -498,11 +498,11 @@ static void overlap(const char *outfile, int natoms,
     xvgrclose(out);
 }
 
-static void project(const char *trajfile, t_topology *top, int ePBC, matrix topbox,
+static void project(const char *trajfile, const t_topology *top, int ePBC, matrix topbox,
                     const char *projfile, const char *twodplotfile,
                     const char *threedplotfile, const char *filterfile, int skip,
                     const char *extremefile, gmx_bool bExtrAll, real extreme,
-                    int nextr, t_atoms *atoms, int natoms, int *index,
+                    int nextr, const t_atoms *atoms, int natoms, int *index,
                     gmx_bool bFit, rvec *xref, int nfit, int *ifit, real *w_rls,
                     real *sqrtm, rvec *xav,
                     int *eignr, rvec **eigvec,
@@ -1069,7 +1069,7 @@ int gmx_anaeig(int argc, char *argv[])
 
     t_topology        top;
     int               ePBC  = -1;
-    t_atoms          *atoms = NULL;
+    const t_atoms    *atoms = NULL;
     rvec             *xtop, *xref1, *xref2, *xrefp = NULL;
     gmx_bool          bDMR1, bDMA1, bDMR2, bDMA2;
     int               nvec1, nvec2, *eignr1 = NULL, *eignr2 = NULL;
index 9beba9718e91cdaf8e08d51bb1b7377c2077f618..131e4142891eccd0d22c924e3306ea0a799cc698 100644 (file)
@@ -448,7 +448,7 @@ static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
                           int index[],
                           gmx_bool bPhi, gmx_bool bPsi, gmx_bool bOmega, gmx_bool bChi,
                           gmx_bool bNormalize, gmx_bool bSSHisto, const char *ssdump,
-                          real bfac_max, t_atoms *atoms,
+                          real bfac_max, const t_atoms *atoms,
                           gmx_bool bDo_jc, const char *fn,
                           const gmx_output_env_t *oenv)
 {
@@ -1066,7 +1066,7 @@ static void print_transitions(const char *fn, int maxchi, int nlist,
 static void order_params(FILE *log,
                          const char *fn, int maxchi, int nlist, t_dlist dlist[],
                          const char *pdbfn, real bfac_init,
-                         t_atoms *atoms, rvec x[], int ePBC, matrix box,
+                         t_atoms *atoms, const rvec x[], int ePBC, matrix box,
                          gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, const gmx_output_env_t *oenv)
 {
     FILE *fp;
index c1cd543517f35d901ba2983414cc277b56360097..03e0422fc2e47d7cddb3ca15816e447a4eb7dbde 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -63,7 +63,7 @@
 
 static const int NOTSET = -9368163;
 
-void calc_rm_cm(int isize, int index[], t_atoms *atoms, rvec x[], rvec xcm)
+void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm)
 {
     int  i, d;
     real tm, m;
@@ -106,7 +106,7 @@ int build_res_index(int isize, int index[], t_atom atom[], int rindex[])
     return r;
 }
 
-int find_res_end(int i, int isize, int index[], t_atoms *atoms)
+int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
 {
     int rnr;
 
@@ -329,8 +329,8 @@ int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
     }
 }
 
-void find_matching_names(int *isize1, int index1[], t_atoms *atoms1,
-                         int *isize2, int index2[], t_atoms *atoms2)
+void find_matching_names(int *isize1, int index1[], const t_atoms *atoms1,
+                         int *isize2, int index2[], const t_atoms *atoms2)
 {
     int        i1, i2, ii1, ii2, m1, m2;
     int        atcmp, rescmp;
index 669437060edf81a4f9a6a91a44ed68e9c97d8f37..57bc3e95274e956ce79047b3172712db36d7dd9f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * 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,2016, 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.
@@ -69,7 +69,7 @@ enum {
     methSEL, methBISECT, methFUNCFIT, methNR
 };
 
-static void center_coords(t_atoms *atoms, matrix box, rvec x0[], int axis)
+static void center_coords(const t_atoms *atoms, matrix box, rvec x0[], int axis)
 {
     int  i, m;
     real tmass, mm;
@@ -101,7 +101,7 @@ static void center_coords(t_atoms *atoms, matrix box, rvec x0[], int axis)
 }
 
 
-static void density_in_time (const char *fn, int **index, int gnx[], real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const gmx_output_env_t *oenv)
+static void density_in_time (const char *fn, int **index, int gnx[], real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, const t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const gmx_output_env_t *oenv)
 
 {
 /*
index 087b2a529ea9e61066eba08398d7b37cdd2b12cd..effc594b43a24d650009aedac79382d4e675b47f 100644 (file)
@@ -174,9 +174,9 @@ static void rvec2sprvec(rvec dipcart, rvec dipsp)
 
 
 
-void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[],
-            int mindex[], rvec x[], rvec mu[],
-            int ePBC, matrix box, t_atom *atom, int *nAtom)
+static void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[],
+                   int mindex[], rvec x[], rvec mu[],
+                   int ePBC, const matrix box, const t_atom *atom, const int *nAtom)
 {
     static rvec *xcm[2] = { NULL, NULL};
     int          gi, gj, j0, j1, i, j, k, n, grp0, grp1;
@@ -440,7 +440,7 @@ gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol
     return bCont;
 }
 
-static void neutralize_mols(int n, int *index, t_block *mols, t_atom *atom)
+static void neutralize_mols(int n, int *index, const t_block *mols, t_atom *atom)
 {
     double mtot, qtot;
     int    ncharged, m, a0, a1, a;
@@ -479,7 +479,7 @@ static void neutralize_mols(int n, int *index, t_block *mols, t_atom *atom)
     }
 }
 
-static void mol_dip(int k0, int k1, rvec x[], t_atom atom[], rvec mu)
+static void mol_dip(int k0, int k1, rvec x[], const t_atom atom[], rvec mu)
 {
     int  k, m;
     real q;
@@ -495,7 +495,7 @@ static void mol_dip(int k0, int k1, rvec x[], t_atom atom[], rvec mu)
     }
 }
 
-static void mol_quad(int k0, int k1, rvec x[], t_atom atom[], rvec quad)
+static void mol_quad(int k0, int k1, rvec x[], const t_atom atom[], rvec quad)
 {
     int      i, k, m, n, niter;
     real     q, r2, mass, masstot;
@@ -723,7 +723,7 @@ static void compute_avercos(int n, rvec dip[], real *dd, rvec axis, gmx_bool bPa
     axis[ZZ] = ddc3/n;
 }
 
-static void do_dip(t_topology *top, int ePBC, real volume,
+static void do_dip(const t_topology *top, int ePBC, real volume,
                    const char *fn,
                    const char *out_mtot, const char *out_eps,
                    const char *out_aver, const char *dipdist,
@@ -779,32 +779,32 @@ static void do_dip(t_topology *top, int ePBC, real volume,
     };
 #define NLEGADIP asize(leg_adip)
 
-    FILE         *outdd, *outmtot, *outaver, *outeps, *caver = NULL;
-    FILE         *dip3d = NULL, *adip = NULL;
-    rvec         *x, *dipole = NULL, mu_t, quad, *dipsp = NULL;
-    t_gkrbin     *gkrbin = NULL;
-    gmx_enxnm_t  *enm    = NULL;
-    t_enxframe   *fr;
-    int           nframes = 1000, nre, timecheck = 0, ncolour = 0;
-    ener_file_t   fmu     = NULL;
-    int           i, n, m, natom = 0, gnx_tot, teller, tel3;
-    t_trxstatus  *status;
-    int          *dipole_bin, ndipbin, ibin, iVol, idim = -1;
-    unsigned long mode;
-    real          rcut = 0, t, t0, t1, dt, dd, rms_cos;
-    rvec          dipaxis;
-    matrix        box;
-    gmx_bool      bCorr, bTotal, bCont;
-    double        M_diff = 0, epsilon, invtel, vol_aver;
-    double        mu_ave, mu_mol, M2_ave = 0, M_ave2 = 0, M_av[DIM], M_av2[DIM];
-    double        M[3], M2[3], M4[3], Gk = 0, g_k = 0;
-    gmx_stats_t  *Qlsq, mulsq, muframelsq = NULL;
-    ivec          iMu;
-    real        **muall        = NULL;
-    rvec         *slab_dipoles = NULL;
-    t_atom       *atom         = NULL;
-    t_block      *mols         = NULL;
-    gmx_rmpbc_t   gpbc         = NULL;
+    FILE          *outdd, *outmtot, *outaver, *outeps, *caver = NULL;
+    FILE          *dip3d = NULL, *adip = NULL;
+    rvec          *x, *dipole = NULL, mu_t, quad, *dipsp = NULL;
+    t_gkrbin      *gkrbin = NULL;
+    gmx_enxnm_t   *enm    = NULL;
+    t_enxframe    *fr;
+    int            nframes = 1000, nre, timecheck = 0, ncolour = 0;
+    ener_file_t    fmu     = NULL;
+    int            i, n, m, natom = 0, gnx_tot, teller, tel3;
+    t_trxstatus   *status;
+    int           *dipole_bin, ndipbin, ibin, iVol, idim = -1;
+    unsigned long  mode;
+    real           rcut = 0, t, t0, t1, dt, dd, rms_cos;
+    rvec           dipaxis;
+    matrix         box;
+    gmx_bool       bCorr, bTotal, bCont;
+    double         M_diff = 0, epsilon, invtel, vol_aver;
+    double         mu_ave, mu_mol, M2_ave = 0, M_ave2 = 0, M_av[DIM], M_av2[DIM];
+    double         M[3], M2[3], M4[3], Gk = 0, g_k = 0;
+    gmx_stats_t   *Qlsq, mulsq, muframelsq = NULL;
+    ivec           iMu;
+    real         **muall        = NULL;
+    rvec          *slab_dipoles = NULL;
+    const t_atom  *atom         = NULL;
+    const t_block *mols         = NULL;
+    gmx_rmpbc_t    gpbc         = NULL;
 
     gnx_tot = gnx[0];
     if (ncos > 1)
@@ -1468,7 +1468,7 @@ static void do_dip(t_topology *top, int ePBC, real volume,
     }
 }
 
-void dipole_atom2molindex(int *n, int *index, t_block *mols)
+void dipole_atom2molindex(int *n, int *index, const t_block *mols)
 {
     int nmol, i, j, m;
 
index e35bf8b1d5a67f999c08ba4e1a5db485b883d9f4..7ab49c13837ea4b74613b9a2bcfff45c5a7bb61d 100644 (file)
@@ -527,7 +527,7 @@ static void init_dr_res(t_dr_result *dr, int ndr)
 }
 
 static void dump_disre_matrix(const char *fn, t_dr_result *dr, int ndr,
-                              int nsteps, t_idef *idef, gmx_mtop_t *mtop,
+                              int nsteps, t_idef *idef, const gmx_mtop_t *mtop,
                               real max_dr, int nlevels, gmx_bool bThird)
 {
     FILE      *fp;
index 8a34c379ce638e9a900f1fe02bfd03d0451f357b..658be502f821a861329ae5c1e9313962a99953cb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016, 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.
@@ -66,7 +66,7 @@ enum {
     VACF, MVACF, DOS, DOS_SOLID, DOS_DIFF, DOS_CP, DOS_S, DOS_A, DOS_E, DOS_NR
 };
 
-static int calcMoleculesInIndexGroup(t_block *mols, int natoms, int *index, int nindex)
+static int calcMoleculesInIndexGroup(const t_block *mols, int natoms, const int *index, int nindex)
 {
     int   i    = 0;
     int   mol  = 0;
index d8d8b3a5d6b1c3a11caa7412ac940e0a6c7c0584..0ac5265afd8089503101562b3b710b97bcbdfe96 100644 (file)
@@ -52,7 +52,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-static void rot_conf(t_atoms *atoms, rvec x[], rvec v[], real trans, real angle,
+static void rot_conf(t_atoms *atoms, const rvec x[], const rvec v[], real trans, real angle,
                      rvec head, rvec tail, int isize, int index[],
                      rvec xout[], rvec vout[])
 {
index 9d63edb8551e11fd932c0f735b2befac9caa881a..f1644f13b0bdd0542aebc9bb2dac9eca55a3230b 100644 (file)
@@ -1594,7 +1594,7 @@ static void fec(const char *ene2fn, const char *runavgfn,
 }
 
 
-static void do_dhdl(t_enxframe *fr, t_inputrec *ir, FILE **fp_dhdl,
+static void do_dhdl(t_enxframe *fr, const t_inputrec *ir, FILE **fp_dhdl,
                     const char *filename, gmx_bool bDp,
                     int *blocks, int *hists, int *samples, int *nlambdas,
                     const gmx_output_env_t *oenv)
index 37c36848ad5ad34535af4c8faf126d39a6f1c570..615245e667d1defb68071d6ebcf1ab1b8fd8ec3a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -65,7 +65,7 @@
 
 void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
                   real **slOrder, real *slWidth, int *nslices,
-                  t_topology *top, int ePBC,
+                  const t_topology *top, int ePBC,
                   int axis, gmx_bool bMicel, int micel[], int nmic,
                   const gmx_output_env_t *oenv)
 {
index 4c283352ea4b1a1ff6c45722cc8af86959ad471d..2f4496880626d4b6494ef94f16cdc466e72668e8 100644 (file)
@@ -571,7 +571,7 @@ static void add_hbond(t_hbdata *hb, int d, int a, int h, int grpd, int grpa,
     }
 }
 
-static char *mkatomname(t_atoms *atoms, int i)
+static char *mkatomname(const t_atoms *atoms, int i)
 {
     static char buf[32];
     int         rnr;
@@ -624,8 +624,8 @@ static void add_acc(t_acceptors *a, int ia, int grp)
     a->acc[a->nra++] = ia;
 }
 
-static void search_acceptors(t_topology *top, int isize,
-                             int *index, t_acceptors *a, int grp,
+static void search_acceptors(const t_topology *top, int isize,
+                             const int *index, t_acceptors *a, int grp,
                              gmx_bool bNitAcc,
                              gmx_bool bContact, gmx_bool bDoIt, unsigned char *datable)
 {
@@ -727,13 +727,12 @@ static void add_dh(t_donors *ddd, int id, int ih, int grp, unsigned char *databl
     }
 }
 
-static void search_donors(t_topology *top, int isize, int *index,
+static void search_donors(const t_topology *top, int isize, const int *index,
                           t_donors *ddd, int grp, gmx_bool bContact, gmx_bool bDoIt,
                           unsigned char *datable)
 {
     int            i, j;
     t_functype     func_type;
-    t_ilist       *interaction;
     int            nr1, nr2, nr3;
 
     if (!ddd->dptr)
@@ -760,7 +759,7 @@ static void search_donors(t_topology *top, int isize, int *index,
     {
         for (func_type = 0; (func_type < F_NRE); func_type++)
         {
-            interaction = &(top->idef.il[func_type]);
+            const t_ilist *interaction = &(top->idef.il[func_type]);
             if (func_type == F_POSRES || func_type == F_FBPOSRES)
             {
                 /* The ilist looks strange for posre. Bug in grompp?
@@ -2226,7 +2225,7 @@ static void analyse_donor_properties(FILE *fp, t_hbdata *hb, int nframes, real t
 static void dump_hbmap(t_hbdata *hb,
                        int nfile, t_filenm fnm[], gmx_bool bTwo,
                        gmx_bool bContact, int isize[], int *index[], char *grpnames[],
-                       t_atoms *atoms)
+                       const t_atoms *atoms)
 {
     FILE    *fp, *fplog;
     int      ddd, hhh, aaa, i, j, k, m, grp;
index 631d8a0cbaad8bb73424ad09bac3a6ac72342af9..17e09ff3b632f6afa4e1367cf99fd73ffe27278e 100644 (file)
@@ -493,7 +493,7 @@ void init_edx(struct edix *edx)
 }
 
 void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
-                int igro[], rvec *x, const char* structure)
+                int igro[], const rvec *x, const char* structure)
 {
 /* filter2edx copies coordinates from x to edx which are given in index
  */
@@ -518,7 +518,7 @@ void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
     }
 }
 
-void get_structure(t_atoms *atoms, const char *IndexFile,
+void get_structure(const t_atoms *atoms, const char *IndexFile,
                    const char *StructureFile, struct edix *edx, int nfit,
                    int ifit[], int nav, int index[])
 {
index 7a3a62c8f45996cd6cb29405278adaa539d519ea..24cf37701e237a22b44e13536b9d186e853914e0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016, 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.
@@ -294,7 +294,7 @@ static gmx_bool parse_string(char **string, int *nr, int ngrps, char **grpname)
     return (*nr) != NOTSET;
 }
 
-static int select_atomnumbers(char **string, t_atoms *atoms, int n1,
+static int select_atomnumbers(char **string, const t_atoms *atoms, int n1,
                               int *nr, int *index, char *gname)
 {
     char    buf[STRLEN];
@@ -357,7 +357,7 @@ static int select_atomnumbers(char **string, t_atoms *atoms, int n1,
     return *nr;
 }
 
-static int select_residuenumbers(char **string, t_atoms *atoms,
+static int select_residuenumbers(char **string, const t_atoms *atoms,
                                  int n1, char c,
                                  int *nr, int *index, char *gname)
 {
@@ -430,7 +430,7 @@ static int select_residuenumbers(char **string, t_atoms *atoms,
     return *nr;
 }
 
-static int select_residueindices(char **string, t_atoms *atoms,
+static int select_residueindices(char **string, const t_atoms *atoms,
                                  int n1, char c,
                                  int *nr, int *index, char *gname)
 {
@@ -506,7 +506,7 @@ static int select_residueindices(char **string, t_atoms *atoms,
 }
 
 
-static gmx_bool atoms_from_residuenumbers(t_atoms *atoms, int group, t_blocka *block,
+static gmx_bool atoms_from_residuenumbers(const t_atoms *atoms, int group, t_blocka *block,
                                           int *nr, int *index, char *gname)
 {
     int i, j, j0, j1, resnr, nres;
@@ -580,7 +580,7 @@ static gmx_bool comp_name(const char *name, const char *search)
     return matches;
 }
 
-static int select_chainnames(t_atoms *atoms, int n_names, char **names,
+static int select_chainnames(const t_atoms *atoms, int n_names, char **names,
                              int *nr, int *index)
 {
     char    name[2];
@@ -614,7 +614,7 @@ static int select_chainnames(t_atoms *atoms, int n_names, char **names,
     return *nr;
 }
 
-static int select_atomnames(t_atoms *atoms, int n_names, char **names,
+static int select_atomnames(const t_atoms *atoms, int n_names, char **names,
                             int *nr, int *index, gmx_bool bType)
 {
     char   *name;
@@ -654,7 +654,7 @@ static int select_atomnames(t_atoms *atoms, int n_names, char **names,
     return *nr;
 }
 
-static int select_residuenames(t_atoms *atoms, int n_names, char **names,
+static int select_residuenames(const t_atoms *atoms, int n_names, char **names,
                                int *nr, int *index)
 {
     char   *name;
@@ -768,7 +768,7 @@ static void remove_group(int nr, int nr2, t_blocka *block, char ***gn)
     }
 }
 
-static void split_group(t_atoms *atoms, int sel_nr, t_blocka *block, char ***gn,
+static void split_group(const t_atoms *atoms, int sel_nr, t_blocka *block, char ***gn,
                         gmx_bool bAtom)
 {
     char    buf[STRLEN], *name;
@@ -811,7 +811,7 @@ static void split_group(t_atoms *atoms, int sel_nr, t_blocka *block, char ***gn,
     block->index[block->nr] = block->nra;
 }
 
-static int split_chain(t_atoms *atoms, rvec *x,
+static int split_chain(const t_atoms *atoms, const rvec *x,
                        int sel_nr, t_blocka *block, char ***gn)
 {
     char    buf[STRLEN];
@@ -917,7 +917,7 @@ static int split_chain(t_atoms *atoms, rvec *x,
     return nchain;
 }
 
-static gmx_bool check_have_atoms(t_atoms *atoms, char *string)
+static gmx_bool check_have_atoms(const t_atoms *atoms, char *string)
 {
     if (atoms == NULL)
     {
@@ -930,7 +930,7 @@ static gmx_bool check_have_atoms(t_atoms *atoms, char *string)
     }
 }
 
-static gmx_bool parse_entry(char **string, int natoms, t_atoms *atoms,
+static gmx_bool parse_entry(char **string, int natoms, const t_atoms *atoms,
                             t_blocka *block, char ***gn,
                             int *nr, int *index, char *gname)
 {
@@ -1114,7 +1114,7 @@ static gmx_bool parse_entry(char **string, int natoms, t_atoms *atoms,
     return bRet;
 }
 
-static void list_residues(t_atoms *atoms)
+static void list_residues(const t_atoms *atoms)
 {
     int      i, j, start, end, prev_resind, resind;
     gmx_bool bDiff;
@@ -1160,7 +1160,7 @@ static void list_residues(t_atoms *atoms)
     printf("\n");
 }
 
-static void edit_index(int natoms, t_atoms *atoms, rvec *x, t_blocka *block, char ***gn, gmx_bool bVerbose)
+static void edit_index(int natoms, const t_atoms *atoms, const rvec *x, t_blocka *block, char ***gn, gmx_bool bVerbose)
 {
     static char   **atnames, *ostring;
     static gmx_bool bFirst = TRUE;
index 11a42067657cd3e93d4cb6dbeec25adbee0382ae..8947baed5013bd514e59d84bf3c578bb359a730f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -141,7 +141,7 @@ static void periodic_dist(int ePBC,
 }
 
 static void periodic_mindist_plot(const char *trxfn, const char *outfn,
-                                  t_topology *top, int ePBC,
+                                  const t_topology *top, int ePBC,
                                   int n, int index[], gmx_bool bSplit,
                                   const gmx_output_env_t *oenv)
 {
@@ -327,7 +327,7 @@ static void calc_dist(real rcut, gmx_bool bPBC, int ePBC, matrix box, rvec x[],
 
 void dist_plot(const char *fn, const char *afile, const char *dfile,
                const char *nfile, const char *rfile, const char *xfile,
-               real rcut, gmx_bool bMat, t_atoms *atoms,
+               real rcut, gmx_bool bMat, const t_atoms *atoms,
                int ng, int *index[], int gnx[], char *grpn[], gmx_bool bSplit,
                gmx_bool bMin, int nres, int *residue, gmx_bool bPBC, int ePBC,
                gmx_bool bGroup, gmx_bool bEachResEachTime, gmx_bool bPrintResName,
@@ -596,7 +596,7 @@ void dist_plot(const char *fn, const char *afile, const char *dfile,
     sfree(x0);
 }
 
-int find_residues(t_atoms *atoms, int n, int index[], int **resindex)
+int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
 {
     int  i;
     int  nres      = 0, resnr, presnr = 0;
index 1125d15c53d20084f3155f5f9c23df664ea131f8..133c39d11c1a91324fbb9d81dc5a6e860a09db52 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016, 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.
@@ -50,7 +50,7 @@
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
-static int calc_ntype(int nft, int *ft, t_idef *idef)
+static int calc_ntype(int nft, int *ft, const t_idef *idef)
 {
     int  i, f, nf = 0;
 
@@ -68,7 +68,7 @@ static int calc_ntype(int nft, int *ft, t_idef *idef)
     return nf;
 }
 
-static void fill_ft_ind(int nft, int *ft, t_idef *idef,
+static void fill_ft_ind(int nft, int *ft, const t_idef *idef,
                         int ft_ind[], char *grpnames[])
 {
     char buf[125];
@@ -142,14 +142,14 @@ static void fill_ft_ind(int nft, int *ft, t_idef *idef,
 }
 
 static void fill_ang(int nft, int *ft, int fac,
-                     int nr[], int *index[], int ft_ind[], t_topology *top,
+                     int nr[], int *index[], int ft_ind[], const t_topology *top,
                      gmx_bool bNoH, real hq)
 {
-    int         f, ftype, i, j, indg, nr_fac;
-    gmx_bool    bUse;
-    t_idef     *idef;
-    t_atom     *atom;
-    t_iatom    *ia;
+    int           f, ftype, i, j, indg, nr_fac;
+    gmx_bool      bUse;
+    const t_idef *idef;
+    t_atom       *atom;
+    t_iatom      *ia;
 
 
     idef = &top->idef;
index 7f4eac4286d9b25d3cfc922aa8481b4a1b561ba9..baba4a16cde6b681740a47ad07b7fc63190ff73d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -110,11 +110,10 @@ static gmx_bool in_data(t_corr *curr, int nx00)
 }
 
 t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
-                  int nmol, gmx_bool bTen, gmx_bool bMass, real dt, t_topology *top,
+                  int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
                   real beginfit, real endfit)
 {
     t_corr  *curr;
-    t_atoms *atoms;
     int      i;
 
     snew(curr, 1);
@@ -161,7 +160,7 @@ t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
     {
         if (bMass)
         {
-            atoms = &top->atoms;
+            const t_atoms *atoms = &top->atoms;
             snew(curr->mass, atoms->nr);
             for (i = 0; (i < atoms->nr); i++)
             {
@@ -325,7 +324,7 @@ static real calc1_norm(t_corr *curr, int nx, int index[], int nx0, rvec xc[],
 }
 
 /* calculate the com of molecules in x and put it into xa */
-static void calc_mol_com(int nmol, int *molindex, t_block *mols, t_atoms *atoms,
+static void calc_mol_com(int nmol, int *molindex, const t_block *mols, const t_atoms *atoms,
                          rvec *x, rvec *xa)
 {
     int  m, mol, i, d;
@@ -482,7 +481,7 @@ static void prep_data(gmx_bool bMol, int gnx, int index[],
    atoms = atom data (for mass)
    com(output) = center of mass  */
 static void calc_com(gmx_bool bMol, int gnx, int index[],
-                     rvec xcur[], rvec xprev[], matrix box, t_atoms *atoms,
+                     rvec xcur[], rvec xprev[], matrix box, const t_atoms *atoms,
                      rvec com)
 {
     int    i, m, ind;
@@ -545,9 +544,9 @@ static real calc1_mol(t_corr *curr, int nx, int gmx_unused index[], int nx0, rve
     return gtot/nx;
 }
 
-void printmol(t_corr *curr, const char *fn,
-              const char *fn_pdb, int *molindex, t_topology *top,
-              rvec *x, int ePBC, matrix box, const gmx_output_env_t *oenv)
+static void printmol(t_corr *curr, const char *fn,
+                     const char *fn_pdb, int *molindex, const t_topology *top,
+                     rvec *x, int ePBC, matrix box, const gmx_output_env_t *oenv)
 {
 #define NDIST 100
     FILE       *out;
@@ -555,16 +554,12 @@ void printmol(t_corr *curr, const char *fn,
     int         i, j;
     real        a, b, D, Dav, D2av, VarD, sqrtD, sqrtD_max, scale;
     t_pdbinfo  *pdbinfo = NULL;
-    int        *mol2a   = NULL;
+    const int  *mol2a   = NULL;
 
     out = xvgropen(fn, "Diffusion Coefficients / Molecule", "Molecule", "D", oenv);
 
     if (fn_pdb)
     {
-        if (top->atoms.pdbinfo == NULL)
-        {
-            snew(top->atoms.pdbinfo, top->atoms.nr);
-        }
         pdbinfo = top->atoms.pdbinfo;
         mol2a   = top->mols.index;
     }
@@ -640,7 +635,7 @@ void printmol(t_corr *curr, const char *fn,
  * fx and nx are file pointers to things like read_first_x and
  * read_next_x
  */
-int corr_loop(t_corr *curr, const char *fn, t_topology *top, int ePBC,
+int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
               gmx_bool bMol, int gnx[], int *index[],
               t_calc_func *calc1, gmx_bool bTen, int *gnx_com, int *index_com[],
               real dt, real t_pdb, rvec **x_pdb, matrix box_pdb,
@@ -838,7 +833,7 @@ int corr_loop(t_corr *curr, const char *fn, t_topology *top, int ePBC,
     return natoms;
 }
 
-static void index_atom2mol(int *n, int *index, t_block *mols)
+static void index_atom2mol(int *n, int *index, const t_block *mols)
 {
     int nat, i, nmol, mol, j;
 
@@ -945,6 +940,10 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
         }
         i             = top->atoms.nr;
         top->atoms.nr = nat_trx;
+        if (pdb_file && top->atoms.pdbinfo == NULL)
+        {
+            snew(top->atoms.pdbinfo, top->atoms.nr);
+        }
         printmol(msd, mol_file, pdb_file, index[0], top, x, ePBC, box, oenv);
         top->atoms.nr = i;
     }
index 6483f13a78c42b46d1e4b7a338ed2fd21e0b7ce0..eb982825f4e4e393c59306a9ac342831c01efb87 100644 (file)
@@ -93,7 +93,7 @@ static double u_corr(double nu, double T)
     }
 }
 
-static size_t get_nharm_mt(gmx_moltype_t *mt)
+static size_t get_nharm_mt(const gmx_moltype_t *mt)
 {
     static int   harm_func[] = { F_BONDS };
     int          i, ft;
@@ -123,7 +123,7 @@ static size_t get_nvsite_mt(gmx_moltype_t *mt)
     return nh;
 }
 
-static int get_nharm(gmx_mtop_t *mtop)
+static int get_nharm(const gmx_mtop_t *mtop)
 {
     int nh = 0;
 
@@ -139,7 +139,7 @@ static void
 nma_full_hessian(real                      *hess,
                  int                        ndim,
                  gmx_bool                   bM,
-                 t_topology                *top,
+                 const t_topology          *top,
                  const std::vector<size_t> &atom_index,
                  int                        begin,
                  int                        end,
@@ -200,7 +200,7 @@ nma_full_hessian(real                      *hess,
 static void
 nma_sparse_hessian(gmx_sparsematrix_t        *sparse_hessian,
                    gmx_bool                   bM,
-                   t_topology                *top,
+                   const t_topology          *top,
                    const std::vector<size_t> &atom_index,
                    int                        neig,
                    real                      *eigenvalues,
index c3c08ffbf2dd552b06c0453bc77cdd36c806bb8f..71c2e66a036e03a565cd39d5b5bf36817ffd726e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -349,7 +349,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS,
 
 /* Print name of first atom in all groups in index file */
 static void print_types(int index[], int a[], int ngrps,
-                        char *groups[], t_topology *top)
+                        char *groups[], const t_topology *top)
 {
     int i;
 
@@ -374,7 +374,7 @@ static void check_length(real length, int a, int b)
 
 void calc_order(const char *fn, int *index, int *a, rvec **order,
                 real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced,
-                gmx_bool bUnsat, t_topology *top, int ePBC, int ngrps, int axis,
+                gmx_bool bUnsat, const t_topology *top, int ePBC, int ngrps, int axis,
                 gmx_bool permolecule, gmx_bool radial, gmx_bool distcalc, const char *radfn,
                 real ***distvals,
                 const gmx_output_env_t *oenv)
@@ -835,7 +835,7 @@ void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bf
     xvgrclose(slOrd);
 }
 
-void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, t_topology *top, real **distvals, gmx_output_env_t *oenv)
+void write_bfactors(t_filenm  *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv)
 {
     /*function to write order parameters as B factors in PDB file using
           first frame of trajectory*/
index 19d3359dab6cd8404d71764524da28718157dff3..a0619cd12117d16cd715d6df081f88ca9d2adc4c 100644 (file)
@@ -122,9 +122,8 @@ static gmx_bool is_charge(real charge)
 
 
 /* calculate charge density */
-static void calc_q2all(
-        gmx_mtop_t *mtop,   /* molecular topology */
-        real *q2all, real *q2allnr)
+static void calc_q2all(const gmx_mtop_t *mtop,   /* molecular topology */
+                       real *q2all, real *q2allnr)
 {
     int             imol, iatom; /* indices for loops */
     real            q2_all = 0;  /* Sum of squared charges */
@@ -812,7 +811,7 @@ static void create_info(t_inputinfo *info)
 /* Allocate and fill an array with coordinates and charges,
  * returns the number of charges found
  */
-static int prepare_x_q(real *q[], rvec *x[], gmx_mtop_t *mtop, rvec x_orig[], t_commrec *cr)
+static int prepare_x_q(real *q[], rvec *x[], const gmx_mtop_t *mtop, const rvec x_orig[], t_commrec *cr)
 {
     int                     i;
     int                     nq; /* number of charged particles */
@@ -922,8 +921,8 @@ static void bcast_info(t_inputinfo *info, t_commrec *cr)
  * a) a homogeneous distribution of the charges
  * b) a total charge of zero.
  */
-static void estimate_PME_error(t_inputinfo *info, t_state *state,
-                               gmx_mtop_t *mtop, FILE *fp_out, gmx_bool bVerbose, int seed,
+static void estimate_PME_error(t_inputinfo *info, const t_state *state,
+                               const gmx_mtop_t *mtop, FILE *fp_out, gmx_bool bVerbose, unsigned int seed,
                                t_commrec *cr)
 {
     rvec *x     = NULL; /* The coordinates */
index e8d61e5db56bf1d895ddf3ed4e009496eea03e21..a8258f03608bc924d0cc86599afab1fc7a7a91f4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -103,7 +103,7 @@ void p_integrate(double *result, double data[], int ndata, double slWidth)
 void calc_potential(const char *fn, int **index, int gnx[],
                     double ***slPotential, double ***slCharge,
                     double ***slField, int *nslices,
-                    t_topology *top, int ePBC,
+                    const t_topology *top, int ePBC,
                     int axis, int nr_grps, double *slWidth,
                     double fudge_z, gmx_bool bSpherical, gmx_bool bCorrect,
                     const gmx_output_env_t *oenv)
index 4ee39c9836e43879c3030e214e5c3e42404ba8ed..a6a8a8fb7125c60093fa16a7a6e0d8c7e1bce2b6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
 
 
 void
-calc_principal_axes(t_topology *   top,
-                    rvec *         x,
-                    int     *      index,
-                    int            n,
-                    matrix         axes,
-                    rvec           inertia)
+calc_principal_axes(const t_topology *top,
+                    rvec             *x,
+                    int              *index,
+                    int               n,
+                    matrix            axes,
+                    rvec              inertia)
 {
     rvec   xcm;
 
index f51f3ccca450a022be6e4b5dc8f35e56f6e466a3..a3cf5447a3f4bcddeab45f16ea5657051fbf3388 100644 (file)
@@ -64,7 +64,7 @@
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
 
-static void norm_princ(t_atoms *atoms, int isize, int *index, int natoms,
+static void norm_princ(const t_atoms *atoms, int isize, int *index, int natoms,
                        rvec *x)
 {
     int  i, m;
index 3028725811279003343a6b17df904513b46f8026..ddf5a24f449c681a155cb3716f0f9eb9bd1197bb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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 "gromacs/utility/strdb.h"
 
 
-static void calc_dist(int nind, int index[], rvec x[], int ePBC, matrix box,
+static void calc_dist(int nind, int index[], const rvec x[], int ePBC, matrix box,
                       real **d)
 {
     int      i, j;
-    real    *xi;
     rvec     dx;
     real     temp2;
     t_pbc    pbc;
@@ -74,7 +73,7 @@ static void calc_dist(int nind, int index[], rvec x[], int ePBC, matrix box,
     set_pbc(&pbc, ePBC, box);
     for (i = 0; (i < nind-1); i++)
     {
-        xi = x[index[i]];
+        const real *xi = x[index[i]];
         for (j = i+1; (j < nind); j++)
         {
             pbc_dx(&pbc, xi, x[index[j]], dx);
@@ -282,7 +281,7 @@ static gmx_bool is_equiv(int neq, t_equiv **equiv, char **nname,
 }
 
 static int analyze_noe_equivalent(const char *eq_fn,
-                                  t_atoms *atoms, int isize, int *index,
+                                  const t_atoms *atoms, int isize, int *index,
                                   gmx_bool bSumH,
                                   int *noe_index, t_noe_gr *noe_gr)
 {
index a7b9eb188f9ddaa38af44cfde1dc0daf609d1c4a..607cd71f0b2ec4c7b7c5d76f8a71075da4d8d399 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -60,7 +60,7 @@
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
-static real find_pdb_bfac(t_atoms *atoms, t_resinfo *ri, char *atomnm)
+static real find_pdb_bfac(const t_atoms *atoms, t_resinfo *ri, char *atomnm)
 {
     char rresnm[8];
     int  i;
@@ -110,7 +110,7 @@ void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc,
 
 static void average_residues(double f[], double **U, int uind,
                              int isize, int index[], real w_rls[],
-                             t_atoms *atoms)
+                             const t_atoms *atoms)
 {
     int    i, j, start;
     double av, m;
index 3b0a3705166236bf99197ceed03829f77857fd43..523dca404171844466a94b016ccbbab2359ff250 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016, 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.
@@ -57,7 +57,7 @@
 
 static void get_refx(gmx_output_env_t *oenv, const char *trxfn, int nfitdim, int skip,
                      int gnx, int *index,
-                     gmx_bool bMW, t_topology *top, int ePBC, rvec *x_ref)
+                     gmx_bool bMW, const t_topology *top, int ePBC, rvec *x_ref)
 {
     int          natoms, nfr_all, nfr, i, j, a, r, c, min_fr;
     t_trxstatus *status;
index d4752e7c73a6ab03d211c2deb12414d7c0dd7978..d3099a577c15ce2eab0811a4029ed857e9aa6a79 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -59,7 +59,7 @@ typedef struct {
     real  q;
 } t_charge;
 
-static t_charge *mk_charge(t_atoms *atoms, t_block *cgs, int *nncg)
+static t_charge *mk_charge(const t_atoms *atoms, const t_block *cgs, int *nncg)
 {
     t_charge *cg = NULL;
     char      buf[32];
@@ -106,7 +106,7 @@ static t_charge *mk_charge(t_atoms *atoms, t_block *cgs, int *nncg)
     return cg;
 }
 
-static real calc_dist(t_pbc *pbc, rvec x[], t_block *cgs, int icg, int jcg)
+static real calc_dist(t_pbc *pbc, rvec x[], const t_block *cgs, int icg, int jcg)
 {
     int  i, j;
     rvec dx;
index 571284b1ee5314b6a4ddbf76cc8f32cecd34550d..a1d73058512e55c3c056ce2d97eb8903284c935b 100644 (file)
@@ -58,7 +58,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
+static void calc_com_pbc(int nrefat, const t_topology *top, rvec x[], t_pbc *pbc,
                          int index[], rvec xref, int ePBC)
 {
     const real tol = 1e-4;
@@ -115,7 +115,7 @@ static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
     }
 }
 
-void spol_atom2molindex(int *n, int *index, t_block *mols)
+void spol_atom2molindex(int *n, int *index, const t_block *mols)
 {
     int nmol, i, j, m;
 
index 80b01df06828c347e6beb1e7ce631eb9ddede002..28dbbd9e7981024ec12b1dd5dcad3b56a0b8651c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -168,7 +168,7 @@ static void print_data(FILE *fp, real time, rvec x[], real *mass, gmx_bool bCom,
     }
 }
 
-static void write_trx_x(t_trxstatus *status, t_trxframe *fr, real *mass, gmx_bool bCom,
+static void write_trx_x(t_trxstatus *status, const t_trxframe *fr, real *mass, gmx_bool bCom,
                         int ngrps, int isize[], int **index)
 {
     static rvec    *xav   = NULL;
@@ -176,8 +176,6 @@ static void write_trx_x(t_trxstatus *status, t_trxframe *fr, real *mass, gmx_boo
     t_trxframe      fr_av;
     int             i;
 
-    fr->bV = FALSE;
-    fr->bF = FALSE;
     if (bCom)
     {
         if (xav == NULL)
@@ -663,7 +661,7 @@ int gmx_traj(int argc, char *argv[])
     int               ePBC;
     real             *mass, time;
     const char       *indexfn;
-    t_trxframe        fr, frout;
+    t_trxframe        fr;
     int               flags, nvhisto = 0, *vhisto = NULL;
     rvec             *xtop, *xp = NULL;
     rvec             *sumx = NULL, *sumv = NULL, *sumf = NULL;
@@ -968,12 +966,14 @@ int gmx_traj(int argc, char *argv[])
         }
         if (bOXT && fr.bX)
         {
-            frout = fr;
+            t_trxframe frout = fr;
             if (!frout.bAtoms)
             {
                 frout.atoms  = &top.atoms;
                 frout.bAtoms = TRUE;
             }
+            frout.bV = FALSE;
+            frout.bF = FALSE;
             write_trx_x(status_out, &frout, mass, bCom, ngroups, isize, index);
         }
         if (bOV && fr.bV)
index 9f605303816fd485c799ddbed5d8ea74837d39fa..27e9aa18400153596ec63491037885394e079636 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -61,7 +61,7 @@
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
 
-static void index_atom2mol(int *n, int *index, t_block *mols)
+static void index_atom2mol(int *n, int *index, const t_block *mols)
 {
     int nat, i, nmol, mol, j;
 
@@ -95,7 +95,7 @@ static void index_atom2mol(int *n, int *index, t_block *mols)
     *n = nmol;
 }
 
-static void precalc(t_topology top, real normm[])
+static void precalc(const t_topology &top, real normm[])
 {
 
     real mtot;
index 8ae96075f9a033ff00cc6b4157755a8f299ef373..f9c8e8e7d10f7f37ff867399f53cd3c295074d2e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -222,7 +222,7 @@ void do_pp2shifts(FILE *fp, int nframes,
 gmx_bool has_dihedral(int Dih, t_dlist *dl);
 
 t_dlist *mk_dlist(FILE *log,
-                  t_atoms *atoms, int *nlist,
+                  const t_atoms *atoms, int *nlist,
                   gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
                   int maxchi, int r0, struct gmx_residuetype_t *rt);
 
index e5ee9493d2633d2da91c60078d313ac4f0930067..2d09699aee67f60879ef9617ac4d4c7b6b86bcf6 100644 (file)
@@ -209,7 +209,7 @@ real ca_phi(int gnx, int index[], rvec x[])
     return (phitot/(gnx-4.0));
 }
 
-real dip(int nbb, int bbind[], rvec x[], t_atom atom[])
+real dip(int nbb, int const bbind[], const rvec x[], const t_atom atom[])
 {
     int  i, m, ai;
     rvec dipje;
@@ -483,7 +483,7 @@ real pprms(FILE *fp, int nbb, t_bb bb[])
     return rms;
 }
 
-void calc_hxprops(int nres, t_bb bb[], rvec x[])
+void calc_hxprops(int nres, t_bb bb[], const rvec x[])
 {
     int  i, ao, an, t1, t2, t3;
     rvec dx, r_ij, r_kj, r_kl, m, n;
index dc757ea98fcb20e4c0a5ffc7af2d4f472380aa05..88de40811cbb4af95529ecf9f30fffc15212e7aa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -96,7 +96,7 @@ extern real pprms(FILE *fp, int nbb, t_bb bb[]);
 extern real ca_phi(int gnx, int index[], rvec x[]);
 /* Assume we have a list of Calpha atoms only! */
 
-extern real dip(int nbb, int bbind[], rvec x[], t_atom atom[]);
+extern real dip(int nbb, const int bbind[], const rvec x[], const t_atom atom[]);
 
 extern real rise(int gnx, int index[], rvec x[]);
 /* Assume we have a list of Calpha atoms only! */
@@ -118,7 +118,7 @@ extern void do_start_end(int nres, t_bb bb[], int *nbb,
                          int bbindex[], int *nca, int caindex[],
                          gmx_bool bRange, int rStart, int rEnd);
 
-extern void calc_hxprops(int nres, t_bb bb[], rvec x[]);
+extern void calc_hxprops(int nres, t_bb bb[], const rvec x[]);
 
 extern void pr_bb(FILE *fp, int nres, t_bb bb[]);
 
index 126f534267c36c82f56e159f5f43876d58f055dc..5b58fdd8d9aed72a82d84c2a798b04b19ba2a743 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -121,7 +121,7 @@ static int find_atom(const char *find, char ***names, int start, int nr)
     return -1;
 }
 
-static void add_xr(t_xrama *xr, int ff[5], t_atoms *atoms)
+static void add_xr(t_xrama *xr, int ff[5], const t_atoms *atoms)
 {
     char buf[12];
     int  i;
@@ -147,7 +147,7 @@ static void add_xr(t_xrama *xr, int ff[5], t_atoms *atoms)
     xr->npp++;
 }
 
-static void get_dih(t_xrama *xr, t_atoms *atoms)
+static void get_dih(t_xrama *xr, const t_atoms *atoms)
 {
     int    found, ff[NPP];
     int    i;
@@ -197,7 +197,7 @@ static void min_max(t_xrama *xr)
     }
 }
 
-static void get_dih_props(t_xrama *xr, t_idef *idef, int mult)
+static void get_dih_props(t_xrama *xr, const t_idef *idef, int mult)
 {
     int      i, ft, ftype, nra;
     t_iatom *ia;
index 48551926f7c4f86f6e9c84bb84e38619ed5031de..dd9a9ab8f380153c9892d2e8af0bfb4034e4f121 100644 (file)
@@ -151,7 +151,7 @@ gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const ch
     return (gmx_neutron_atomic_structurefactors_t *) gnsf;
 }
 
-gmx_sans_t *gmx_sans_init (t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf)
+gmx_sans_t *gmx_sans_init (const t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf)
 {
     gmx_sans_t    *gsans = NULL;
     int            i, j;
index 258d9c1e5779392a70bf81058d51cf93eaf64575..949d42922b3238d9a82a60cc95f6b8b5433c234d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016, 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.
@@ -50,8 +50,8 @@ typedef struct gmx_neutron_atomic_structurefactors_t {
 } gmx_neutron_atomic_structurefactors_t;
 
 typedef struct gmx_sans_t {
-    struct t_topology *top;     /* topology */
-    double            *slength; /* scattering length for this topology */
+    const t_topology *top;     /* topology */
+    double           *slength; /* scattering length for this topology */
 } gmx_sans_t;
 
 typedef struct gmx_radial_distribution_histogram_t {
@@ -76,7 +76,7 @@ void normalize_probability(int n, double *a);
 
 gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const char *datfn);
 
-gmx_sans_t *gmx_sans_init(struct t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
+gmx_sans_t *gmx_sans_init(const t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
 
 gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram  (gmx_sans_t  *gsans,
                                                                           rvec        *x,
index 6c9854b665d474eab1cdb4d54e42260a2a9409b6..7972fe364b297f749f150ada1f1283b2e89c2f08 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016, 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.
@@ -96,7 +96,7 @@ void t_trans(matrix trans, real d[], real **ev)
 }
 #endif
 
-void principal_comp(int n, int index[], t_atom atom[], rvec x[],
+void principal_comp(int n, const int index[], t_atom atom[], rvec x[],
                     matrix trans, rvec d)
 {
     int      i, j, ai, m, nrot;
@@ -214,7 +214,7 @@ void rotate_atoms(int gnx, int *index, rvec x[], matrix trans)
     }
 }
 
-real calc_xcm(rvec x[], int gnx, int *index, t_atom *atom, rvec xcm,
+real calc_xcm(const rvec x[], int gnx, const int *index, const t_atom *atom, rvec xcm,
               gmx_bool bQ)
 {
     int  i, ii, m;
@@ -254,7 +254,7 @@ real calc_xcm(rvec x[], int gnx, int *index, t_atom *atom, rvec xcm,
     return tm;
 }
 
-real sub_xcm(rvec x[], int gnx, int *index, t_atom atom[], rvec xcm,
+real sub_xcm(rvec x[], int gnx, const int *index, const t_atom atom[], rvec xcm,
              gmx_bool bQ)
 {
     int  i, ii;
@@ -280,7 +280,7 @@ void add_xcm(rvec x[], int gnx, int *index, rvec xcm)
     }
 }
 
-void orient_princ(t_atoms *atoms, int isize, int *index,
+void orient_princ(const t_atoms *atoms, int isize, const int *index,
                   int natoms, rvec x[], rvec *v, rvec d)
 {
     int     i, m;
index 32ab524be952074dda85b83dcb2c4e10a2e77e35..426fefb57b82f99af1e1a9677ee3591e1981344d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016, 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.
@@ -51,24 +51,24 @@ extern "C" {
 void rotate_atoms(int gnx, int index[], rvec x[], matrix trans);
 /* Rotate all atoms in index using matrix trans */
 
-void principal_comp(int n, int index[], t_atom atom[], rvec x[],
+void principal_comp(int n, const int index[], t_atom atom[], rvec x[],
                     matrix trans, rvec d);
 /* Calculate the principal components of atoms in index. Atoms are
  * mass weighted. It is assumed that the center of mass is in the origin!
  */
 
-void orient_princ(t_atoms *atoms, int isize, int *index,
+void orient_princ(const t_atoms *atoms, int isize, const int *index,
                   int natoms, rvec x[], rvec *v, rvec d);
 /* rotates molecule to align principal axes with coordinate axes */
 
-real calc_xcm(rvec x[], int gnx, int *index, t_atom *atom, rvec xcm,
+real calc_xcm(const rvec x[], int gnx, const int *index, const t_atom *atom, rvec xcm,
               gmx_bool bQ);
 /* Calculate the center of mass of the atoms in index. if bQ then the atoms
  * will be charge weighted rather than mass weighted.
  * Returns the total mass/charge.
  */
 
-real sub_xcm(rvec x[], int gnx, int *index, t_atom atom[], rvec xcm,
+real sub_xcm(rvec x[], int gnx, const int *index, const t_atom atom[], rvec xcm,
              gmx_bool bQ);
 /* Calc. the center of mass and subtract it from all coordinates.
  * Returns the original center of mass in xcm
index 781f6ef431fb2265b7219807b4e3d4465965b757..c9600073094c495844a6fe0d8c633c59073b55bf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -335,7 +335,7 @@ extern gmx_structurefactors_t *gmx_structurefactors_init(const char *datfn)
 
 
 extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, int * index,
-                             int isize, t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf)
+                             int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf)
 /* given the group's index, return the (continuous) array of atoms */
 {
     int           i;
index eb11a7eb2d8768fce2f6aaef936b36335a1c62d7..8c1bb45177f13ff557c30ccb30f7f244808a2c3a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -74,7 +74,7 @@ double CMSF (gmx_structurefactors_t *gsf, int type, int nh, double lambda, doubl
 int return_atom_type (const char *name, gmx_structurefactors_t *gsf);
 
 void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, int * index,
-                      int isize, struct t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf);
+                      int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf);
 
 int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
                              const char* fnXVG, const char *fnTRX,
index 5d12b27a0fa6183906259b90f162a78976876d6d..9f66a33aa65171f0c612d9b6daf5d1cc19ed7b6c 100644 (file)
@@ -110,7 +110,7 @@ static int rm_interactions(int ifunc, int nrmols, t_molinfo mols[])
 }
 
 static int check_atom_names(const char *fn1, const char *fn2,
-                            gmx_mtop_t *mtop, t_atoms *at)
+                            gmx_mtop_t *mtop, const t_atoms *at)
 {
     int      mb, m, i, j, nmismatch;
     t_atoms *tat;
index 23a3c88a9169bcdfa7ed600a55e7b4c4605a6291..93f9ba6c49e63ffbe7e4880f1ab8d83cab5206cf 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -216,7 +216,7 @@ static void sort_molecule(t_atoms **atoms_solvt, std::vector<RVec> *x,
     sfree(moltypes);
 }
 
-static void rm_res_pbc(t_atoms *atoms, std::vector<RVec> *x, matrix box)
+static void rm_res_pbc(const t_atoms *atoms, std::vector<RVec> *x, matrix box)
 {
     int  start, nat;
     rvec xcg;
index 7b8f96141a3e0bacc4f214de1edd60d5acbedb68..57a1c8f25f21d11cb290429c8ee78748cc94fd4b 100644 (file)
@@ -1128,7 +1128,7 @@ char **do_top(gmx_bool          bVerbose,
               int              *nrmols,
               t_molinfo       **molinfo,
               t_molinfo       **intermolecular_interactions,
-              t_inputrec       *ir,
+              const t_inputrec *ir,
               int              *nmolblock,
               gmx_molblock_t  **molblock,
               gmx_bool          bGenborn,
index d03fc5db29c84a13db4659a503ef99d8a5a553c2..27d8e70c4af0d4ff62243f4b02c55c18fd4842c5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016, 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.
@@ -47,25 +47,25 @@ struct gmx_molblock_t;
 double check_mol(gmx_mtop_t *mtop, warninp_t wi);
 /* Check mass and charge */
 
-char **do_top(gmx_bool         bVerbose,
-              const char      *topfile,
-              const char      *topppfile,
-              t_gromppopts    *opts,
-              gmx_bool         bZero,
-              struct t_symtab *symtab,
-              t_params         plist[],
-              int             *combination_rule,
-              double          *repulsion_power,
-              real            *fudgeQQ,
-              gpp_atomtype_t   atype,
-              int             *nrmols,
-              t_molinfo      **molinfo,
-              t_molinfo      **intermolecular_interactions,
-              t_inputrec      *ir,
-              int             *nmolblock,
-              gmx_molblock_t **molblock,
-              gmx_bool         bGB,
-              warninp_t        wi);
+char **do_top(gmx_bool          bVerbose,
+              const char       *topfile,
+              const char       *topppfile,
+              t_gromppopts     *opts,
+              gmx_bool          bZero,
+              struct t_symtab  *symtab,
+              t_params          plist[],
+              int              *combination_rule,
+              double           *repulsion_power,
+              real             *fudgeQQ,
+              gpp_atomtype_t    atype,
+              int              *nrmols,
+              t_molinfo       **molinfo,
+              t_molinfo       **intermolecular_interactions,
+              const t_inputrec *ir,
+              int              *nmolblock,
+              gmx_molblock_t  **molblock,
+              gmx_bool          bGB,
+              warninp_t         wi);
 
 /* This routine expects sys->molt[m].ilist to be of size F_NRE and ordered. */
 void generate_qmexcl(gmx_mtop_t *sys, t_inputrec *ir, warninp_t    wi);
index 4971ad76cac1a70cfda9c6d9968311fd1c8f5059..63fbaff99242c689f2b57861beda713952e56d79 100644 (file)
@@ -102,7 +102,7 @@ static gmx_bool is_bond(int nnm, t_nm2type nmt[], char *ai, char *aj, real blen)
 }
 
 void mk_bonds(int nnm, t_nm2type nmt[],
-              t_atoms *atoms, rvec x[], t_params *bond, int nbond[],
+              t_atoms *atoms, const rvec x[], t_params *bond, int nbond[],
               gmx_bool bPBC, matrix box)
 {
     t_param b;
@@ -275,7 +275,7 @@ void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRoun
     lo_set_force_const(&plist[F_PDIHS], c, 3, bRound, TRUE, bParam);
 }
 
-void calc_angles_dihs(t_params *ang, t_params *dih, rvec x[], gmx_bool bPBC,
+void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPBC,
                       matrix box)
 {
     int    i, ai, aj, ak, al, t1, t2, t3;
index 41e80d614f23ebc13522a4fabbca3ed0b594cbd4..be4e53b487d37680416cf64be3b8f1dfaba9ec26 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2016, 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.
@@ -57,7 +57,7 @@ void gmx_mat4_copy(mat4 a, mat4 b)
     }
 }
 
-void gmx_mat4_transform_point(mat4 m, rvec x, vec4 v)
+void gmx_mat4_transform_point(mat4 m, const rvec x, vec4 v)
 {
     int i;
 
index 40516c60c6aaf73762d8657b3e863bb1500a8a91..9ed4690683763808864f5fdc6b485f6fe60abfdd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2016, 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.
@@ -65,7 +65,7 @@ typedef real mat4[4][4];
 
 void gmx_mat4_copy(mat4 a, mat4 b);
 
-void gmx_mat4_transform_point(mat4 m, rvec x, vec4 v);
+void gmx_mat4_transform_point(mat4 m, const rvec x, vec4 v);
 
 /*! \brief
  * Computes the product of two `mat4` matrices as A = B * C.
index 1b6adbb0196be6ad0d7b8dc6ada59e63f28bf810..83cd9dc5b4a55094e775516dfa4068d709c1ddd3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016, 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.
@@ -110,7 +110,7 @@ real rhodev(int natoms, real mass[], rvec x[], rvec xp[])
     return calc_similar_ind(TRUE, natoms, NULL, mass, x, xp);
 }
 
-void calc_fit_R(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x, matrix R)
+void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x, matrix R)
 {
     int      c, r, n, j, i, irot, s;
     double **omega, **om;
@@ -259,7 +259,7 @@ void calc_fit_R(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x, matrix R)
     sfree(om);
 }
 
-void do_fit_ndim(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x)
+void do_fit_ndim(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x)
 {
     int    j, m, r, c;
     matrix R;
@@ -286,7 +286,7 @@ void do_fit_ndim(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x)
     }
 }
 
-void do_fit(int natoms, real *w_rls, rvec *xp, rvec *x)
+void do_fit(int natoms, real *w_rls, const rvec *xp, rvec *x)
 {
     do_fit_ndim(3, natoms, w_rls, xp, x);
 }
index cb6b9981295847d99037af3ce04f69e285a5ffed..2c73d4538d9951fb975c0ba9ae3b20f91f0b5d41 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016, 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.
@@ -66,7 +66,7 @@ real rhodev(int natoms, real mass[], rvec x[], rvec xp[]);
  * Maiorov & Crippen, PROTEINS 22, 273 (1995).
  */
 
-void calc_fit_R(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x,
+void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x,
                 matrix R);
 /* Calculates the rotation matrix R for which
  * sum_i w_rls_i (xp_i - R x_i).(xp_i - R x_i)
@@ -75,7 +75,7 @@ void calc_fit_R(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x,
  * x_rotated[i] = sum R[i][j]*x[j]
  */
 
-void do_fit_ndim(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x);
+void do_fit_ndim(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x);
 /* Do a least squares fit of x to xp. Atoms which have zero mass
  * (w_rls[i]) are not taken into account in fitting.
  * This makes is possible to fit eg. on Calpha atoms and orient
@@ -83,7 +83,7 @@ void do_fit_ndim(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x);
  * therefore both xp and x should be centered round the origin.
  */
 
-void do_fit(int natoms, real *w_rls, rvec *xp, rvec *x);
+void do_fit(int natoms, real *w_rls, const rvec *xp, rvec *x);
 /* Calls do_fit with ndim=3, thus fitting in 3D */
 
 void reset_x_ndim(int ndim, int ncm, const int *ind_cm,
index 94fd494f247efb70bba2f829fa1b9f80f58554e8..71314c45d3babe0e2dbb8419a35995fb95dd1a41 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016, 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.
@@ -277,7 +277,7 @@ void count_bonded_distances(const gmx_mtop_t *mtop, const t_inputrec *ir,
 }
 
 static void pp_group_load(const gmx_mtop_t *mtop, const t_inputrec *ir,
-                          matrix box,
+                          const matrix box,
                           int *nq_tot, int *nlj_tot,
                           double *cost_pp,
                           gmx_bool *bChargePerturbed, gmx_bool *bTypePerturbed)
@@ -404,7 +404,7 @@ static void pp_group_load(const gmx_mtop_t *mtop, const t_inputrec *ir,
 }
 
 static void pp_verlet_load(const gmx_mtop_t *mtop, const t_inputrec *ir,
-                           matrix box,
+                           const matrix box,
                            int *nq_tot, int *nlj_tot,
                            double *cost_pp,
                            gmx_bool *bChargePerturbed, gmx_bool *bTypePerturbed)
@@ -516,7 +516,7 @@ static void pp_verlet_load(const gmx_mtop_t *mtop, const t_inputrec *ir,
 }
 
 float pme_load_estimate(const gmx_mtop_t *mtop, const t_inputrec *ir,
-                        matrix box)
+                        const matrix box)
 {
     int            nq_tot, nlj_tot;
     gmx_bool       bChargePerturbed, bTypePerturbed;
index 810f822d29fdb3b91a136cef6f78eefefb169ce9..de9f9abca1a6464b4c5aab94e485fa6238fee632 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016, 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.
@@ -52,7 +52,7 @@ void count_bonded_distances(const gmx_mtop_t *mtop, const t_inputrec *ir,
  */
 
 float pme_load_estimate(const gmx_mtop_t *mtop, const t_inputrec *ir,
-                        matrix box);
+                        const matrix box);
 /* Returns an estimate for the relative load of the PME mesh calculation
  * in the total force calculation.
  * This estimate is reasonable for recent Intel and AMD x86_64 CPUs.
index 404a9d83cd14db25f0f18542d71c778f3c9f0264..d551166a29752e9d00700e4b03f639c1eab2d559 100644 (file)
@@ -503,7 +503,7 @@ void done_graph(t_graph *g)
  *
  ************************************************************/
 
-static void mk_1shift_tric(int npbcdim, matrix box, const rvec hbox,
+static void mk_1shift_tric(int npbcdim, const matrix box, const rvec hbox,
                            const rvec xi, const rvec xj, int *mi, int *mj)
 {
     /* Calculate periodicity for triclinic box... */
@@ -571,7 +571,7 @@ static void mk_1shift(int npbcdim, const rvec hbox, const rvec xi, const rvec xj
     }
 }
 
-static void mk_1shift_screw(matrix box, const rvec hbox,
+static void mk_1shift_screw(const matrix box, const rvec hbox,
                             const rvec xi, const rvec xj, int *mi, int *mj)
 {
     /* Calculate periodicity for rectangular box... */
@@ -629,7 +629,7 @@ static void mk_1shift_screw(matrix box, const rvec hbox,
 }
 
 static int mk_grey(egCol egc[], t_graph *g, int *AtomI,
-                   int npbcdim, matrix box, const rvec x[], int *nerror)
+                   int npbcdim, const matrix box, const rvec x[], int *nerror)
 {
     int          m, j, ng, ai, aj, g0;
     rvec         dx, hbox;
@@ -717,7 +717,7 @@ static int first_colour(int fC, egCol Col, t_graph *g, egCol egc[])
 }
 
 void mk_mshift(FILE *log, t_graph *g, int ePBC,
-               matrix box, const rvec x[])
+               const matrix box, const rvec x[])
 {
     static int nerror_tot = 0;
     int        npbcdim;
@@ -845,7 +845,7 @@ void mk_mshift(FILE *log, t_graph *g, int ePBC,
  *
  ************************************************************/
 
-void shift_x(const t_graph *g, matrix box, const rvec x[], rvec x_s[])
+void shift_x(const t_graph *g, const matrix box, const rvec x[], rvec x_s[])
 {
     ivec    *is;
     int      g0, g1;
@@ -917,7 +917,7 @@ void shift_x(const t_graph *g, matrix box, const rvec x[], rvec x_s[])
     }
 }
 
-void shift_self(const t_graph *g, matrix box, rvec x[])
+void shift_self(const t_graph *g, const matrix box, rvec x[])
 {
     ivec    *is;
     int      g0, g1;
@@ -963,7 +963,7 @@ void shift_self(const t_graph *g, matrix box, rvec x[])
     }
 }
 
-void unshift_x(const t_graph *g, matrix box, rvec x[], const rvec x_s[])
+void unshift_x(const t_graph *g, const matrix box, rvec x[], const rvec x_s[])
 {
     ivec    *is;
     int      g0, g1;
@@ -1016,7 +1016,7 @@ void unshift_x(const t_graph *g, matrix box, rvec x[], const rvec x_s[])
     }
 }
 
-void unshift_self(const t_graph *g, matrix box, rvec x[])
+void unshift_self(const t_graph *g, const matrix box, rvec x[])
 {
     ivec *is;
     int   g0, g1;
index 192a0dac8d10046105fef81f36e8e83833b3e7fe..c5540bc34b8647b20106b9793e5be8c37cdcd03f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -95,19 +95,19 @@ void p_graph(FILE *log, const char *title, t_graph *g);
 /* Print a graph to log */
 
 void mk_mshift(FILE *log, t_graph *g, int ePBC,
-               matrix box, const rvec x[]);
+               const matrix box, const rvec x[]);
 /* Calculate the mshift codes, based on the connection graph in g. */
 
-void shift_x(const t_graph *g, matrix box, const rvec x[], rvec x_s[]);
+void shift_x(const t_graph *g, const matrix box, const rvec x[], rvec x_s[]);
 /* Add the shift vector to x, and store in x_s (may be same array as x) */
 
-void shift_self(const t_graph *g, matrix box, rvec x[]);
+void shift_self(const t_graph *g, const matrix box, rvec x[]);
 /* Id. but in place */
 
-void unshift_x(const t_graph *g, matrix box, rvec x[], const rvec x_s[]);
+void unshift_x(const t_graph *g, const matrix box, rvec x[], const rvec x_s[]);
 /* Subtract the shift vector from x_s, and store in x (may be same array) */
 
-void unshift_self(const t_graph *g, matrix box, rvec x[]);
+void unshift_self(const t_graph *g, const matrix box, rvec x[]);
 /* Id, but in place */
 
 #ifdef __cplusplus
index 4440ec87a41f36b7760cd2912804aa0f7cebf241..0a8df5247c2bdd83cb4350fe85b92ad4c73a54e0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -60,7 +60,7 @@ typedef struct {
 } rmpbc_graph_t;
 
 struct gmx_rmpbc {
-    t_idef        *idef;
+    const t_idef  *idef;
     int            natoms_init;
     int            ePBC;
     int            ngraph;
@@ -109,7 +109,7 @@ static t_graph *gmx_rmpbc_get_graph(gmx_rmpbc_t gpbc, int ePBC, int natoms)
     return gr->gr;
 }
 
-gmx_rmpbc_t gmx_rmpbc_init(t_idef *idef, int ePBC, int natoms)
+gmx_rmpbc_t gmx_rmpbc_init(const t_idef *idef, int ePBC, int natoms)
 {
     gmx_rmpbc_t gpbc;
 
@@ -155,7 +155,7 @@ void gmx_rmpbc_done(gmx_rmpbc_t gpbc)
     }
 }
 
-static int gmx_rmpbc_ePBC(gmx_rmpbc_t gpbc, matrix box)
+static int gmx_rmpbc_ePBC(gmx_rmpbc_t gpbc, const matrix box)
 {
     if (NULL != gpbc && gpbc->ePBC >= 0)
     {
@@ -167,7 +167,7 @@ static int gmx_rmpbc_ePBC(gmx_rmpbc_t gpbc, matrix box)
     }
 }
 
-void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[])
+void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[])
 {
     int      ePBC;
     t_graph *gr;
@@ -181,7 +181,7 @@ void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[])
     }
 }
 
-void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[], rvec x_s[])
+void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[], rvec x_s[])
 {
     int      ePBC;
     t_graph *gr;
@@ -220,7 +220,7 @@ void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, t_trxframe *fr)
     }
 }
 
-void rm_gropbc(t_atoms *atoms, rvec x[], matrix box)
+void rm_gropbc(const t_atoms *atoms, rvec x[], const matrix box)
 {
     real dist;
     int  n, m, d;
index ff9107a7d2a27a8b4d5859530358eeccc674fa7c..31922fde683020f602e7b5a1cbc37cf1dc4f6697 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2016, 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.
@@ -49,11 +49,11 @@ struct t_trxframe;
 
 typedef struct gmx_rmpbc *gmx_rmpbc_t;
 
-gmx_rmpbc_t gmx_rmpbc_init(struct t_idef *idef, int ePBC, int natoms);
+gmx_rmpbc_t gmx_rmpbc_init(const t_idef *idef, int ePBC, int natoms);
 
 void gmx_rmpbc_done(gmx_rmpbc_t gpbc);
 
-void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[]);
+void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[]);
 /* Correct coordinates x for atoms within every molecule for the periodic
  * boundary conditions such that every molecule is whole.
  * natoms is the size x and can be smaller than the number
@@ -61,14 +61,14 @@ void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[]);
  * When ePBC=-1, the type of pbc is guessed from the box matrix.
  */
 
-void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[],
+void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[],
                     rvec x_s[]);
 /* As gmx_rmpbc, but outputs in x_s and does not modify x. */
 
 void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, struct t_trxframe *fr);
 /* As gmx_rmpbc but operates on a t_trxframe data structure. */
 
-void rm_gropbc(struct t_atoms *atoms, rvec x[], matrix box);
+void rm_gropbc(const t_atoms *atoms, rvec x[], const matrix box);
 /* Simple routine for use in analysis tools that just have a pdb or
  * similar file.
  */
index ef6f82b732f82f8573567e6e0f591887e900f403..88f6ac48c776c1cc0d11b4350df5bcbda73ed4cb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -86,7 +86,7 @@ typedef struct {
     float bBox;
 } t_fr_time;
 
-static void tpx2system(FILE *fp, gmx_mtop_t *mtop)
+static void tpx2system(FILE *fp, const gmx_mtop_t *mtop)
 {
     int                       nmol, nvsite = 0;
     gmx_mtop_atomloop_block_t aloop;
@@ -110,7 +110,7 @@ static void tpx2system(FILE *fp, gmx_mtop_t *mtop)
     fprintf(fp, "\n\n");
 }
 
-static void tpx2params(FILE *fp, t_inputrec *ir)
+static void tpx2params(FILE *fp, const t_inputrec *ir)
 {
     fprintf(fp, "\\subsection{Simulation settings}\n");
     fprintf(fp, "A total of %g ns were simulated with a time step of %g fs.\n",
index c5afe10f5825604a275097a935a50a9806191e2b..b7313c51f5f604197c9e84b4a630eb6c20df789e 100644 (file)
@@ -232,7 +232,7 @@ cmp_double(FILE *fp, const char *s, int index, double i1, double i2, double ftol
     }
 }
 
-static void cmp_rvec(FILE *fp, const char *s, int index, rvec i1, rvec i2, real ftol, real abstol)
+static void cmp_rvec(FILE *fp, const char *s, int index, const rvec i1, const rvec i2, real ftol, real abstol)
 {
     if (!equal_real(i1[XX], i2[XX], ftol, abstol) ||
         !equal_real(i1[YY], i2[YY], ftol, abstol) ||
@@ -251,7 +251,7 @@ static void cmp_rvec(FILE *fp, const char *s, int index, rvec i1, rvec i2, real
     }
 }
 
-static void cmp_ivec(FILE *fp, const char *s, int index, ivec i1, ivec i2)
+static void cmp_ivec(FILE *fp, const char *s, int index, const ivec i1, const ivec i2)
 {
     if ((i1[XX] != i2[XX]) || (i1[YY] != i2[YY]) || (i1[ZZ] != i2[ZZ]))
     {
@@ -268,7 +268,7 @@ static void cmp_ivec(FILE *fp, const char *s, int index, ivec i1, ivec i2)
     }
 }
 
-static void cmp_ilist(FILE *fp, int ftype, t_ilist *il1, t_ilist *il2)
+static void cmp_ilist(FILE *fp, int ftype, const t_ilist *il1, const t_ilist *il2)
 {
     int  i;
     char buf[256];
@@ -294,7 +294,7 @@ static void cmp_ilist(FILE *fp, int ftype, t_ilist *il1, t_ilist *il2)
 }
 
 void cmp_iparm(FILE *fp, const char *s, t_functype ft,
-               t_iparams ip1, t_iparams ip2, real ftol, real abstol)
+               const t_iparams &ip1, const t_iparams &ip2, real ftol, real abstol)
 {
     int      i;
     gmx_bool bDiff;
@@ -313,7 +313,7 @@ void cmp_iparm(FILE *fp, const char *s, t_functype ft,
     }
 }
 
-void cmp_iparm_AB(FILE *fp, const char *s, t_functype ft, t_iparams ip1, real ftol, real abstol)
+void cmp_iparm_AB(FILE *fp, const char *s, t_functype ft, const t_iparams &ip1, real ftol, real abstol)
 {
     int      nrfpA, nrfpB, p0, i;
     gmx_bool bDiff;
@@ -367,7 +367,7 @@ static void cmp_cmap(FILE *fp, const gmx_cmap_t *cmap1, const gmx_cmap_t *cmap2,
     }
 }
 
-static void cmp_idef(FILE *fp, t_idef *id1, t_idef *id2, real ftol, real abstol)
+static void cmp_idef(FILE *fp, const t_idef *id1, const t_idef *id2, real ftol, real abstol)
 {
     int  i;
     char buf1[64], buf2[64];
@@ -401,7 +401,7 @@ static void cmp_idef(FILE *fp, t_idef *id1, t_idef *id2, real ftol, real abstol)
     }
 }
 
-static void cmp_block(FILE *fp, t_block *b1, t_block *b2, const char *s)
+static void cmp_block(FILE *fp, const t_block *b1, const t_block *b2, const char *s)
 {
     char buf[32];
 
@@ -410,7 +410,7 @@ static void cmp_block(FILE *fp, t_block *b1, t_block *b2, const char *s)
     cmp_int(fp, buf, -1, b1->nr, b2->nr);
 }
 
-static void cmp_blocka(FILE *fp, t_blocka *b1, t_blocka *b2, const char *s)
+static void cmp_blocka(FILE *fp, const t_blocka *b1, const t_blocka *b2, const char *s)
 {
     char buf[32];
 
@@ -421,7 +421,7 @@ static void cmp_blocka(FILE *fp, t_blocka *b1, t_blocka *b2, const char *s)
     cmp_int(fp, buf, -1, b1->nra, b2->nra);
 }
 
-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, const t_atom *a1, const t_atom *a2, real ftol, real abstol)
 {
     if (a2)
     {
@@ -443,7 +443,7 @@ static void cmp_atom(FILE *fp, int index, t_atom *a1, t_atom *a2, real ftol, rea
     }
 }
 
-static void cmp_atoms(FILE *fp, t_atoms *a1, t_atoms *a2, real ftol, real abstol)
+static void cmp_atoms(FILE *fp, const t_atoms *a1, const t_atoms *a2, real ftol, real abstol)
 {
     int i;
 
@@ -466,7 +466,7 @@ static void cmp_atoms(FILE *fp, t_atoms *a1, t_atoms *a2, real ftol, real abstol
     }
 }
 
-static void cmp_top(FILE *fp, t_topology *t1, t_topology *t2, real ftol, real abstol)
+static void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, real abstol)
 {
     fprintf(fp, "comparing top\n");
     if (t2)
@@ -485,7 +485,7 @@ static void cmp_top(FILE *fp, t_topology *t1, t_topology *t2, real ftol, real ab
     }
 }
 
-static void cmp_groups(FILE *fp, gmx_groups_t *g0, gmx_groups_t *g1,
+static void cmp_groups(FILE *fp, const gmx_groups_t *g0, const gmx_groups_t *g1,
                        int natoms0, int natoms1)
 {
     int  i, j;
@@ -522,7 +522,7 @@ static void cmp_groups(FILE *fp, gmx_groups_t *g0, gmx_groups_t *g1,
      */
 }
 
-static void cmp_rvecs_rmstol(FILE *fp, const char *title, int n, rvec x1[], rvec x2[],
+static void cmp_rvecs_rmstol(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
                              real ftol, real abstol)
 {
     int    i, m;
@@ -555,7 +555,7 @@ static void cmp_rvecs_rmstol(FILE *fp, const char *title, int n, rvec x1[], rvec
     }
 }
 
-static void cmp_rvecs(FILE *fp, const char *title, int n, rvec x1[], rvec x2[],
+static void cmp_rvecs(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
                       gmx_bool bRMSD, real ftol, real abstol)
 {
     int    i, m;
@@ -580,7 +580,7 @@ static void cmp_rvecs(FILE *fp, const char *title, int n, rvec x1[], rvec x2[],
     }
 }
 
-static void cmp_grpopts(FILE *fp, t_grpopts *opt1, t_grpopts *opt2, real ftol, real abstol)
+static void cmp_grpopts(FILE *fp, const t_grpopts *opt1, const t_grpopts *opt2, real ftol, real abstol)
 {
     int  i, j;
     char buf1[256], buf2[256];
@@ -631,7 +631,7 @@ static void cmp_grpopts(FILE *fp, t_grpopts *opt1, t_grpopts *opt2, real ftol, r
     }
 }
 
-static void cmp_cosines(FILE *fp, const char *s, t_cosines c1[DIM], t_cosines c2[DIM], real ftol, real abstol)
+static void cmp_cosines(FILE *fp, const char *s, const t_cosines c1[DIM], const t_cosines c2[DIM], real ftol, real abstol)
 {
     int  i, m;
     char buf[256];
@@ -652,7 +652,7 @@ static void cmp_pull(FILE *fp)
     fprintf(fp, "WARNING: Both files use COM pulling, but comparing of the pull struct is not implemented (yet). The pull parameters could be the same or different.\n");
 }
 
-static void cmp_simtempvals(FILE *fp, t_simtemp *simtemp1, t_simtemp *simtemp2, int n_lambda, real ftol, real abstol)
+static void cmp_simtempvals(FILE *fp, const t_simtemp *simtemp1, const t_simtemp *simtemp2, int n_lambda, real ftol, real abstol)
 {
     int i;
     cmp_int(fp, "inputrec->simtempvals->eSimTempScale", -1, simtemp1->eSimTempScale, simtemp2->eSimTempScale);
@@ -664,7 +664,7 @@ static void cmp_simtempvals(FILE *fp, t_simtemp *simtemp1, t_simtemp *simtemp2,
     }
 }
 
-static void cmp_expandedvals(FILE *fp, t_expanded *expand1, t_expanded *expand2, int n_lambda, real ftol, real abstol)
+static void cmp_expandedvals(FILE *fp, const t_expanded *expand1, const t_expanded *expand2, int n_lambda, real ftol, real abstol)
 {
     int i;
 
@@ -700,7 +700,7 @@ static void cmp_expandedvals(FILE *fp, t_expanded *expand1, t_expanded *expand2,
     cmp_real(fp, "inputrec->expandedvals->mc-temperature", -1, expand1->mc_temp, expand2->mc_temp, ftol, abstol);
 }
 
-static void cmp_fepvals(FILE *fp, t_lambda *fep1, t_lambda *fep2, real ftol, real abstol)
+static void cmp_fepvals(FILE *fp, const t_lambda *fep1, const t_lambda *fep2, real ftol, real abstol)
 {
     int i, j;
     cmp_int(fp, "inputrec->nstdhdl", -1, fep1->nstdhdl, fep2->nstdhdl);
@@ -728,7 +728,7 @@ static void cmp_fepvals(FILE *fp, t_lambda *fep1, t_lambda *fep2, real ftol, rea
     cmp_double(fp, "inputrec->dh_hist_spacing", -1, fep1->dh_hist_spacing, fep2->dh_hist_spacing, ftol, abstol);
 }
 
-static void cmp_inputrec(FILE *fp, t_inputrec *ir1, t_inputrec *ir2, real ftol, real abstol)
+static void cmp_inputrec(FILE *fp, const t_inputrec *ir1, const t_inputrec *ir2, real ftol, real abstol)
 {
     fprintf(fp, "comparing inputrec\n");
 
@@ -889,7 +889,7 @@ static void comp_pull_AB(FILE *fp, pull_params_t *pull, real ftol, real abstol)
     }
 }
 
-static void comp_state(t_state *st1, t_state *st2,
+static void comp_state(const t_state *st1, const t_state *st2,
                        gmx_bool bRMSD, real ftol, real abstol)
 {
     int i, j, nc;
index ee49c5e3162407414b0e36d3c3223e1cee1c1275..1ea889841a8e9225933c83bb8eea35f1f553c315 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
@@ -47,6 +47,9 @@ void
 comp_tpx(const char *fn1, const char *fn2, gmx_bool bRMSD, real ftol, real abstol);
 /* Compare two binary run input files */
 
+void comp_tpx_a_and_b_states(const char *fn, real ftol, real abstol);
+/* Compare two A and B states of a free-energy run input file. */
+
 void
 comp_trx(const gmx_output_env_t *oenv, const char *fn1, const char *fn2,
          gmx_bool bRMSD, real ftol, real abstol);
index 22f5566b64481e8272c6dc61bb9038d37f8ee404..cc04615c90aa68ed1d6a7207be706889c496aaba 100644 (file)
@@ -176,7 +176,7 @@ void gmx_pdbinfo_init_default(t_pdbinfo *pdbinfo)
     std::fill(pdbinfo->uij, pdbinfo->uij+6, 0.0);
 }
 
-t_atoms *copy_t_atoms(t_atoms *src)
+t_atoms *copy_t_atoms(const t_atoms *src)
 {
     t_atoms *dst;
     int      i;
index 832af3e3fddc1f5ce70904482bda6b6dc2140354..faadaa98a3caba907454d3f66239ef0d91584d3f 100644 (file)
@@ -146,7 +146,7 @@ void init_t_atoms(t_atoms *atoms, int natoms, gmx_bool bPdbinfo);
 
 void gmx_pdbinfo_init_default(t_pdbinfo *pdbinfo);
 
-t_atoms *copy_t_atoms(t_atoms *src);
+t_atoms *copy_t_atoms(const t_atoms *src);
 /* copy an atoms struct from src to a new one */
 
 void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra);
index ef7ec745e626b2b40126e3e6d6af7eb06c583b03..0825ef1e667bf35cf21fe9c55fd67aec3784bc18 100644 (file)
@@ -201,7 +201,7 @@ p_status(const char *const *restype, int nres,
 
 
 static int *
-mk_aid(t_atoms *atoms, const char ** restype, const char * typestring, int *nra, gmx_bool bMatch)
+mk_aid(const t_atoms *atoms, const char ** restype, const char * typestring, int *nra, gmx_bool bMatch)
 /* Make an array of ints for all atoms with residuetypes matching typestring, or the opposite if bMatch is false */
 {
     int     *a;
@@ -232,7 +232,7 @@ typedef struct {
     char    *gname;
 } restp_t;
 
-static void analyse_other(const char ** restype, t_atoms *atoms,
+static void analyse_other(const char ** restype, const t_atoms *atoms,
                           t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
     restp_t *restp = NULL;
@@ -375,7 +375,7 @@ typedef struct gmx_help_make_index_group
     int compareto;
 } t_gmx_help_make_index_group;
 
-static void analyse_prot(const char ** restype, t_atoms *atoms,
+static void analyse_prot(const char ** restype, const t_atoms *atoms,
                          t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
     /* lists of atomnames to be used in constructing index groups: */
@@ -573,7 +573,7 @@ static void analyse_prot(const char ** restype, t_atoms *atoms,
 }
 
 
-void analyse(t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
+void analyse(const t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
 {
     gmx_residuetype_t*rt = NULL;
     char             *resnm;
@@ -1023,7 +1023,7 @@ void rd_index_nrs(char *statfile, int ngrps, int isize[],
     rd_groups(grps, gnames, grpnames, ngrps, isize, index, grpnr);
 }
 
-void get_index(t_atoms *atoms, const char *fnm, int ngrps,
+void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
                int isize[], int *index[], char *grpnames[])
 {
     char    ***gnames;
index d21ead00a36c2c92f6c915caeace27479413a939..f22ca9084ec641fa7b62b5287a923d78a14f355d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016, 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.
@@ -79,7 +79,7 @@ void rd_index_nrs(char *statfile, int ngrps, int isize[],
                   int *index[], char *grpnames[], int grpnr[]);
 /* the same but also reads the number of the selected group*/
 
-void get_index(struct t_atoms *atoms, const char *fnm, int ngrps,
+void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
                int isize[], int *index[], char *grpnames[]);
 /* Does the same as rd_index, but if the fnm pointer is NULL it
  * will not read from fnm, but it will make default index groups
@@ -102,7 +102,7 @@ void write_index(const char *outf, struct t_blocka *b, char **gnames, gmx_bool b
 void add_grp(struct t_blocka *b, char ***gnames, int nra, int a[], const char *name);
 /* Ads group a with name name to block b and namelist gnames */
 
-void analyse(struct t_atoms *atoms, struct t_blocka *gb, char ***gn,
+void analyse(const t_atoms *atoms, struct t_blocka *gb, char ***gn,
              gmx_bool bASK, gmx_bool bVerb);
 /* Makes index groups gb with names gn for atoms in atoms.
  * bASK=FALSE gives default groups.
index 0edae2ac89cfe54bec4b7ea3f86b76d42620e58e..5ec58477747454534a9b2b2726ebf992dffaefb0 100644 (file)
@@ -1193,7 +1193,7 @@ t_topology gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop)
     return top;
 }
 
-std::vector<size_t> get_atom_index(gmx_mtop_t *mtop)
+std::vector<size_t> get_atom_index(const gmx_mtop_t *mtop)
 {
 
     std::vector<size_t>       atom_index;
index bab89e9acb99eb1052767d3f209b7ec6660e880b..3c01d34064eb05f1e187a8e4280145333330e2be 100644 (file)
@@ -273,6 +273,6 @@ gmx_mtop_t_to_t_topology(gmx_mtop_t *mtop);
  * \param[in]  mtop Molecular topology
  * \returns Vector that will be filled with the atom indices
  */
-std::vector<size_t> get_atom_index(gmx_mtop_t *mtop);
+std::vector<size_t> get_atom_index(const gmx_mtop_t *mtop);
 
 #endif