-misc-misplaced-const,\
-misc-incorrect-roundings,-misc-macro-parentheses,-readability-function-size,-readability-else-after-return,\
-readability-inconsistent-declaration-parameter-name,-misc-throw-by-value-catch-by-reference,\
- -readability-non-const-parameter,-readability-implicit-bool-conversion,\
+ -readability-implicit-bool-conversion,\
modernize-use-nullptr,modernize-use-emplace;-warnings-as-errors=*;-fix")
endif()
void
-AbstractAverageHistogram::scaleAllByVector(real factor[])
+AbstractAverageHistogram::scaleAllByVector(const real factor[])
{
for (int c = 0; c < columnCount(); ++c)
{
/*
* 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,2018, 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.
//! Scales all histograms by a uniform scaling factor.
void scaleAll(real factor);
//! Scales the value of each bin by a different scaling factor.
- void scaleAllByVector(real factor[]);
+ void scaleAllByVector(const real factor[]);
/*! \brief
* Notifies attached modules of the histogram data.
*
void
-AnalysisDataVectorPlotModule::setWriteMask(bool bWrite[DIM + 1])
+AnalysisDataVectorPlotModule::setWriteMask(const bool bWrite[DIM + 1])
{
for (int i = 0; i < DIM + 1; ++i)
{
/*
* 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,2018, 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.
/*! \brief
* Set mask for what to write.
*/
- void setWriteMask(bool bWrite[4]);
+ void setWriteMask(const bool bWrite[4]);
virtual void pointsAdded(const AnalysisDataPointSetRef &points);
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, 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.
* \param[out] corr output correlation
* \param[in] fft FFT data structure
*/
-static void cross_corr_low(int n, real f[], real g[], real corr[], gmx_fft_t fft)
+static void cross_corr_low(int n, const real f[], const real g[], real corr[], gmx_fft_t fft)
{
int i;
const int size = zeroPaddingSize(n);
fprintf(fp, "\n");
}
-real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0,
+real do_lmfit(int ndata, const real c1[], real sig[], real dt, const real *x0,
real begintimefit, real endtimefit, const gmx_output_env_t *oenv,
gmx_bool bVerbose, int eFitFn, double fitparms[], int fix,
const char *fn_fitted)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2018, 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.
* \param[in] fn_fitted If not NULL file to print the data and fitted curve to
* \return integral.
*/
-real do_lmfit(int ndata, real c1[], real sig[], real dt, real *x0,
+real do_lmfit(int ndata, const real c1[], real sig[], real dt, const real *x0,
real begintimefit, real endtimefit, const gmx_output_env_t *oenv,
gmx_bool bVerbose, int eFitFn, double fitparms[], int fix,
const char *fn_fitted);
const double x[],
const double y[],
const double dy[],
- double parm[],
+ double parm[], // NOLINT(readability-non-const-parameter)
bool bVerbose,
int eFitFn,
int nfix)
}
*/
-static void ddindex2xyz(ivec nc, int ind, ivec xyz)
+static void ddindex2xyz(const ivec nc, int ind, ivec xyz)
{
xyz[XX] = ind / (nc[YY]*nc[ZZ]);
xyz[YY] = (ind / nc[ZZ]) % nc[YY];
gmx_domdec_comm_dim_t *cd, int pulse,
int *ncg_cell,
gmx::ArrayRef<int> index_gl,
- int *recv_i,
+ const int *recv_i,
rvec *cg_cm, rvec *recv_vr,
gmx::ArrayRef<int> cgindex,
cginfo_mb_t *cginfo_mb, int *cginfo)
}
}
-static gmx_bool missing_link(t_blocka *link, int cg_gl, char *bLocalCG)
+static gmx_bool missing_link(t_blocka *link, int cg_gl, const char *bLocalCG)
{
int i;
gmx_bool bMiss;
real skew_fac2_d, real skew_fac_01,
rvec *v_d, rvec *v_0, rvec *v_1,
const dd_corners_t *c,
- rvec sf2_round,
+ const rvec sf2_round,
gmx_bool bDistBonded,
gmx_bool bBondComm,
gmx_bool bDist2B,
gmx_bool bDistMB,
rvec *cg_cm,
- int *cginfo,
+ const int *cginfo,
std::vector<int> *localAtomGroups,
dd_comm_setup_work_t *work)
{
/*! \brief Generate the local topology and virtual site data */
void dd_make_local_top(struct gmx_domdec_t *dd, struct gmx_domdec_zones_t *zones,
int npbcdim, matrix box,
- rvec cellsize_min, ivec npulse,
+ rvec cellsize_min, const ivec npulse,
t_forcerec *fr,
rvec *cgcm_or_x,
gmx_vsite_t *vsite,
int *count,
gmx_bool bConstr, gmx_bool bSettle,
gmx_bool bBCheck,
- int *r_index, int *r_il,
+ const int *r_index, int *r_il,
gmx_bool bLinkToAllAtoms,
gmx_bool bAssign)
{
}
/*! \brief Store a bonded interaction at the end of \p il */
-static inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il)
+static inline void add_ifunc(int nral, const t_iatom *tiatoms, t_ilist *il)
{
t_iatom *liatoms;
int k;
const gmx_domdec_t *dd,
const gmx_domdec_zones_t *zones,
const gmx_molblock_t *molb,
- gmx_bool bRCheckMB, ivec rcheck, gmx_bool bRCheck2B,
+ gmx_bool bRCheckMB, const ivec rcheck, gmx_bool bRCheck2B,
real rc2,
int *la2lc,
t_pbc *pbc_null,
void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
int npbcdim, matrix box,
- rvec cellsize_min, ivec npulse,
+ rvec cellsize_min, const ivec npulse,
t_forcerec *fr,
rvec *cgcm_or_x,
gmx_vsite_t *vsite,
#define DD_FLAG_FW(d) (1<<(16+(d)*2))
#define DD_FLAG_BW(d) (1<<(16+(d)*2+1))
-static int compact_and_copy_vec_at(int ncg, int *move,
+static int compact_and_copy_vec_at(int ncg, const int *move,
const gmx::RangePartitioning &atomGroups,
int nvec, int vec,
rvec *src, gmx_domdec_comm_t *comm,
return home_pos;
}
-static int compact_and_copy_vec_cg(int ncg, int *move,
+static int compact_and_copy_vec_cg(int ncg, const int *move,
const gmx::RangePartitioning &atomGroups,
int nvec, rvec *src, gmx_domdec_comm_t *comm,
gmx_bool bCompact)
static void calc_cg_move(FILE *fplog, gmx_int64_t step,
gmx_domdec_t *dd,
t_state *state,
- ivec tric_dir, matrix tcm,
- rvec cell_x0, rvec cell_x1,
- rvec limitd, rvec limit0, rvec limit1,
+ const ivec tric_dir, matrix tcm,
+ const rvec cell_x0, const rvec cell_x1,
+ rvec limitd, const rvec limit0, const rvec limit1,
const gmx::RangePartitioning &atomGroups,
int cg_start, int cg_end,
rvec *cg_cm,
}
-static void rmfit(int nat, rvec *xcoll, rvec transvec, matrix rotmat)
+static void rmfit(int nat, rvec *xcoll, const rvec transvec, matrix rotmat)
{
rvec vec;
matrix tmat;
}
//! Make tables for the structure factor parts
-static void tabulateStructureFactors(int natom, const rvec x[], int kmax, cvec **eir, rvec lll)
+static void tabulateStructureFactors(int natom, const rvec x[], int kmax, cvec **eir, const rvec lll)
{
int i, j, m;
int numThreads, int thread,
t_forcerec *fr,
const t_inputrec *ir,
- real *chargeA, real *chargeB,
- real *C6A, real *C6B,
- real *sigmaA, real *sigmaB,
- real *sigma3A, real *sigma3B,
+ const real *chargeA, const real *chargeB,
+ const real *C6A, const real *C6B,
+ const real *sigmaA, const real *sigmaB,
+ const real *sigma3A, const real *sigma3B,
gmx_bool bHaveChargeOrTypePerturbed,
gmx_bool calc_excl_corr,
const t_blocka *excl,
int numThreads, int thread,
t_forcerec *fr,
const t_inputrec *ir,
- real *chargeA, real *chargeB,
- real *C6A, real *C6B,
- real *sigmaA, real *sigmaB,
- real *sigma3A, real *sigma3B,
+ const real *chargeA, const real *chargeB,
+ const real *C6A, const real *C6B,
+ const real *sigmaA, const real *sigmaB,
+ const real *sigma3A, const real *sigma3B,
gmx_bool bHaveChargeOrTypePerturbed,
gmx_bool calc_excl_corr,
const t_blocka *excl,
}
-real gather_energy_bsplines(gmx_pme_t *pme, real *grid,
+real gather_energy_bsplines(gmx_pme_t *pme, const real *grid,
pme_atomcomm_t *atc)
{
splinedata_t *spline;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, 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.
real scale);
real
-gather_energy_bsplines(struct gmx_pme_t *pme, real *grid,
+gather_energy_bsplines(struct gmx_pme_t *pme, const real *grid,
pme_atomcomm_t *atc);
#endif
#endif
-int copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index)
+int copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, const real *pmegrid, real *fftgrid, int grid_index)
{
ivec local_fft_ndata, local_fft_offset, local_fft_size;
ivec local_pme_size;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, 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.
#endif
int
-copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, real *pmegrid, real *fftgrid, int grid_index);
+copy_pmegrid_to_fftgrid(const gmx_pme_t *pme, const real *pmegrid, real *fftgrid, int grid_index);
int
copy_fftgrid_to_pmegrid(gmx_pme_t *pme, const real *fftgrid, real *pmegrid, int grid_index,
}
static void dd_pmeredist_pos_coeffs(struct gmx_pme_t *pme,
- int n, gmx_bool bX, rvec *x, real *data,
+ int n, gmx_bool bX, rvec *x, const real *data,
pme_atomcomm_t *atc)
{
int *commnode, *buf_index;
}
static void make_bsplines(splinevec theta, splinevec dtheta, int order,
- rvec fractx[], int nr, int ind[], real coefficient[],
+ rvec fractx[], int nr, const int ind[], const real coefficient[],
gmx_bool bDoSplines)
{
/* construct splines for local atoms */
/*! \brief Calculate initial Lorentz-Berthelot coefficients for LJ-PME */
static void
-calc_initial_lb_coeffs(struct gmx_pme_t *pme, real *local_c6, real *local_sigma)
+calc_initial_lb_coeffs(struct gmx_pme_t *pme, const real *local_c6, const real *local_sigma)
{
int i;
for (i = 0; i < pme->atc[0].n; ++i)
/*! \brief Calculate next Lorentz-Berthelot coefficients for LJ-PME */
static void
-calc_next_lb_coeffs(struct gmx_pme_t *pme, real *local_sigma)
+calc_next_lb_coeffs(struct gmx_pme_t *pme, const real *local_sigma)
{
int i;
#endif
#endif
-static int vmax(int* a, int s)
+static int vmax(const int* a, int s)
{
int i, max = 0;
for (i = 0; i < s; i++)
NG, MG, KG is size of global data*/
static void splitaxes(t_complex* lout, const t_complex* lin,
int maxN, int maxM, int maxK, int pM,
- int P, int NG, int *N, int* oN, int starty, int startz, int endy, int endz)
+ int P, int NG, const int *N, const int* oN, int starty, int startz, int endy, int endz)
{
int x, y, z, i;
int in_i, out_i, in_z, out_z, in_y, out_y;
KG global size*/
static void joinAxesTrans13(t_complex* lout, const t_complex* lin,
int maxN, int maxM, int maxK, int pM,
- int P, int KG, int* K, int* oK, int starty, int startx, int endy, int endx)
+ int P, int KG, const int* K, const int* oK, int starty, int startx, int endy, int endx)
{
int i, x, y, z;
int out_i, in_i, out_x, in_x, out_z, in_z;
N,M,K local size
MG, global size*/
static void joinAxesTrans12(t_complex* lout, const t_complex* lin, int maxN, int maxM, int maxK, int pN,
- int P, int MG, int* M, int* oM, int startx, int startz, int endx, int endz)
+ int P, int MG, const int* M, const int* oM, int startx, int startz, int endx, int endz)
{
int i, z, y, x;
int out_i, in_i, out_z, in_z, out_x, in_x;
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2005 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
};
int
-gmx_parallel_3dfft_init (gmx_parallel_3dfft_t * pfft_setup,
- ivec ndata,
- real ** real_data,
- t_complex ** complex_data,
- MPI_Comm comm[2],
- gmx_bool bReproducible,
- int nthreads,
- gmx::PinningPolicy realGridAllocation)
+gmx_parallel_3dfft_init (gmx_parallel_3dfft_t * pfft_setup,
+ const ivec ndata,
+ real ** real_data,
+ t_complex ** complex_data,
+ MPI_Comm comm[2],
+ gmx_bool bReproducible,
+ int nthreads,
+ gmx::PinningPolicy realGridAllocation)
{
int rN = ndata[2], M = ndata[1], K = ndata[0];
int flags = FFT5D_REALCOMPLEX | FFT5D_ORDER_YZ; /* FFT5D_DEBUG */
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2005 David van der Spoel, Erik Lindahl, University of Groningen.
- * Copyright (c) 2013,2014,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
int
gmx_parallel_3dfft_init (gmx_parallel_3dfft_t * pfft_setup,
- ivec ndata,
+ const ivec ndata,
real **real_data,
t_complex **complex_data,
MPI_Comm comm[2],
sfree(fr);
}
-static real ener_tensor_diag(int n, int *ind1, int *ind2,
+static real ener_tensor_diag(int n, const int *ind1, const int *ind2,
gmx_enxnm_t *enm1,
- int *tensi, int i,
+ const int *tensi, int i,
t_energy e1[], t_energy e2[])
{
int d1, d2;
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2005, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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 write_espresso_conf_indexed(FILE *out, const char *title,
- const t_atoms *atoms, int nx, int *index,
+ const t_atoms *atoms, int nx, const int *index,
const rvec *x, const rvec *v, const matrix box)
{
int i, j;
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2005, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
int get_espresso_coordnum(const char *infile);
void write_espresso_conf_indexed(FILE *out, const char *title,
- const t_atoms *atoms, int nx, int *index,
+ const t_atoms *atoms, int nx, const int *index,
const rvec *x, const rvec *v, const matrix box);
#endif
| So I don't need to call 'sizeofints for those calls.
*/
-static int sizeofints( const int num_of_ints, unsigned int sizes[])
+static int sizeofints( const int num_of_ints, const unsigned int sizes[])
{
int i, num;
int bytes[32];
*/
static void receiveints(int buf[], const int num_of_ints, int num_of_bits,
- unsigned int sizes[], int nums[])
+ const unsigned int sizes[], int nums[])
{
int bytes[32];
int i, j, num_of_bytes, p, num;
static void write_xpm_map_split(FILE *out, int n_x, int n_y,
- int *nlevel_top, real lo_top, real hi_top,
+ const int *nlevel_top, real lo_top, real hi_top,
t_rgb rlo_top, t_rgb rhi_top,
gmx_bool bDiscreteColor,
int *nlevel_bot, real lo_bot, real hi_bot,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
sfree(index);
}
-static int line2type(char *line)
+static int line2type(const char *line)
{
int k;
char type[8];
}
static int read_atom(t_symtab *symtab,
- char line[], int type, int natom,
+ const char line[], int type, int natom,
t_atoms *atoms, rvec x[], int chainnum, gmx_bool bChange)
{
t_atom *atomn;
}
-void calc_distribution_props(int nh, int histo[], real start,
+void calc_distribution_props(int nh, const int histo[], real start,
int nkkk, t_karplus kkk[],
real *S2)
{
}
}
-static real calc_fraction(real angles[], int nangles)
+static real calc_fraction(const real angles[], int nangles)
{
int i;
real trans = 0, gauche = 0;
}
static void calc_dihs(struct t_pbc *pbc,
- int n4, int index[], real ang[], rvec x_s[])
+ int n4, const int index[], real ang[], rvec x_s[])
{
int i, ix, t1, t2, t3;
rvec r_ij, r_kj, r_kl, m, n;
}
}
-void normalize_histo(int npoints, int histo[], real dx, real normhisto[])
+void normalize_histo(int npoints, const int histo[], real dx, real normhisto[])
{
int i;
double d, fac;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
-int BinarySearch (real *array, int low, int high, real key, int direction)
+int BinarySearch (const real *array, int low, int high, real key, int direction)
{
int iMid, iMax, iMin;
iMax = high+2;
return BinarySearch(array, low, high, key, direction);
}
-int LinearSearch (double *array, int startindx, int stopindx,
+int LinearSearch (const double *array, int startindx, int stopindx,
double key, int *count, int direction)
{
/*Iterative implementation - assume elements sorted*/
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014,2015,2018, 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 insertionSort(real *ar, int *perm, int start, int end, int direction);
-int BinarySearch(real *ar, int start, int end, real key, int direction);
+int BinarySearch(const real *ar, int start, int end, real key, int direction);
int start_binsearch(real *array, int *perm, int low, int high,
real key, int direction);
-int LinearSearch(double *array, int startindx, int stopindx,
+int LinearSearch(const double *array, int startindx, int stopindx,
double key, int *count, int direction);
#ifdef __cplusplus
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2013,2014,2015,2018, 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/math/vec.h"
#include "gromacs/utility/smalloc.h"
-gmx_bool convolution(int dataSize, real *x, int kernelSize, real* kernel)
+gmx_bool convolution(int dataSize, real *x, int kernelSize, const real* kernel)
{
int i, j, k;
real *out;
/* Assuming kernel is shorter than x */
gmx_bool periodic_convolution(int datasize, real *x, int kernelsize,
- real *kernel)
+ const real *kernel)
{
int i, j, idx;
real *filtered;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2013,2014,2018, 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.
#endif
extern gmx_bool convolution(int dataSize, real* in, int kernelSize,
- real* kernel);
+ const real* kernel);
extern gmx_bool periodic_convolution(int dsize, real *in, int ksize,
- real* kernel);
+ const real* kernel);
extern void gausskernel(real *out, int size, real var);
#ifdef __cplusplus
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-static void my_calc_xcm(int nbb, int bbind[], rvec x[], rvec xcm)
+static void my_calc_xcm(int nbb, const int bbind[], rvec x[], rvec xcm)
{
int i, m, ai;
}
}
-static void my_sub_xcm(int nbb, int bbind[], rvec x[], rvec xcm)
+static void my_sub_xcm(int nbb, const int bbind[], rvec x[], rvec xcm)
{
int i, ai;
static void inprod_matrix(const char *matfile, int natoms,
int nvec1, int *eignr1, rvec **eigvec1,
- int nvec2, int *eignr2, rvec **eigvec2,
- gmx_bool bSelect, int noutvec, int *outvec)
+ int nvec2, const int *eignr2, rvec **eigvec2,
+ gmx_bool bSelect, int noutvec, const int *outvec)
{
FILE *out;
real **mat;
const char *extremefile, gmx_bool bExtrAll, real extreme,
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,
+ const real *sqrtm, rvec *xav,
int *eignr, rvec **eigvec,
int noutvec, int *outvec, gmx_bool bSplit,
const gmx_output_env_t *oenv)
static void components(const char *outfile, int natoms,
int *eignr, rvec **eigvec,
- int noutvec, int *outvec,
+ int noutvec, const int *outvec,
const gmx_output_env_t *oenv)
{
int g, s, v, i;
fprintf(stderr, "\n");
}
-static void rmsf(const char *outfile, int natoms, real *sqrtm,
+static void rmsf(const char *outfile, int natoms, const real *sqrtm,
int *eignr, rvec **eigvec,
- int noutvec, int *outvec,
+ int noutvec, const int *outvec,
real *eigval, int neig,
const gmx_output_env_t *oenv)
{
sfree(x);
}
-static real cosine_content(int nhp, int n, real *y)
+static real cosine_content(int nhp, int n, const real *y)
/* Assumes n equidistant points */
{
double fac, cosyint, yyint;
*
* See Eqn A17, Hess, JCP 116 (2002) 209-217 for details.
*/
-static real optimal_error_estimate(double sigma, double fitparm[], real tTotal)
+static real optimal_error_estimate(double sigma, const double fitparm[], real tTotal)
{
double ss = fitparm[1]*fitparm[0]+(1-fitparm[1])*fitparm[2];
if ((tTotal <= 0) || (ss <= 0))
return lambda;
}
-static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba,
+static void read_bar_xvg_lowlevel(const char *fn, const real *temp, xvg_t *ba,
lambda_components_t *lc)
{
int i;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
axis[c1] = ax[c0]*tmp[c0] + ax[c1]*tmp[c1];
}
-static void calc_axes(rvec x[], t_atom atom[], int gnx[], int *index[],
+static void calc_axes(rvec x[], t_atom atom[], const int gnx[], int *index[],
gmx_bool bRot, t_bundle *bun)
{
int end, i, div, d;
fprintf(stderr, "\n");
}
-static void copy_dih_data(real in[], real out[], int nf, gmx_bool bLEAVE)
+static void copy_dih_data(const real in[], real out[], int nf, gmx_bool bLEAVE)
{
/* if bLEAVE, do nothing to data in copying to out
* otherwise multiply by 180/pi to convert rad to deg */
static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
int nf, int maxchi, real **dih,
int nlist, t_dlist dlist[],
- int index[],
+ const 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, const t_atoms *atoms,
clust->ncl = k-1;
}
-static rvec **read_whole_trj(const char *fn, int isize, int index[], int skip,
+static rvec **read_whole_trj(const char *fn, int isize, const int index[], int skip,
int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc)
{
rvec **xx, *x;
static const int NOTSET = -9368163;
-static void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm)
+static void calc_rm_cm(int isize, const int index[], const t_atoms *atoms, rvec x[], rvec xcm)
{
int i, d;
real tm, m;
}
}
-static int build_res_index(int isize, int index[], t_atom atom[], int rindex[])
+static int build_res_index(int isize, const int index[], t_atom atom[], int rindex[])
{
int i, r;
return r;
}
-static int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
+static int find_res_end(int i, int isize, const int index[], const t_atoms *atoms)
{
int rnr;
return std::strcmp(s1, s2);
}
-static int find_next_match_atoms_in_res(int *i1, int index1[],
+static int find_next_match_atoms_in_res(int *i1, const int index1[],
int m1, char **atnms1[],
- int *i2, int index2[],
+ int *i2, const int index2[],
int m2, char **atnms2[])
{
int dx, dy, dmax, cmp;
}
static int find_next_match_res(int *rnr1, int isize1,
- int index1[], t_resinfo *resinfo1,
+ const int index1[], t_resinfo *resinfo1,
int *rnr2, int isize2,
- int index2[], t_resinfo *resinfo2)
+ const int index2[], t_resinfo *resinfo2)
{
int dx, dy, dmax, cmp, rr1, rr2;
gmx_bool bFW = FALSE, bFF = FALSE;
return cmp;
}
-static int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
+static int find_first_atom_in_res(int rnr, int isize, const int index[], t_atom atom[])
{
int i;
}
}
-static void calc_mj(t_topology top, int ePBC, matrix box, gmx_bool bNoJump, int isize, int index0[], \
+static void calc_mj(t_topology top, int ePBC, matrix box, gmx_bool bNoJump, int isize, const int index0[], \
rvec fr[], rvec mj, real mass2[], real qmol[])
{
}
-static real calc_cacf(FILE *fcacf, real prefactor, real cacf[], real time[], int nfr, int vfr[], int ei, int nshift)
+static real calc_cacf(FILE *fcacf, real prefactor, real cacf[], real time[], int nfr, const int vfr[], int ei, int nshift)
{
int i;
}
-static void calc_mjdsp(FILE *fmjdsp, real prefactor, real dsp2[], real time[], int nfr, real refr[])
+static void calc_mjdsp(FILE *fmjdsp, real prefactor, real dsp2[], real time[], int nfr, const real refr[])
{
int i;
int ePBC, t_topology top, t_trxframe fr, real temp,
real bfit, real efit, real bvit, real evit,
t_trxstatus *status, int isize, int nmols, int nshift,
- int *index0, int indexm[], real mass2[],
+ const int *index0, int indexm[], real mass2[],
real qmol[], real eps_rf, const gmx_output_env_t *oenv)
{
int i, j;
return nr;
}
-static void center_coords(t_atoms *atoms, int *index_center, int ncenter,
+static void center_coords(t_atoms *atoms, const int *index_center, int ncenter,
matrix box, rvec x0[])
{
int i, k, m;
}
}
-static void calc_electron_density(const char *fn, int **index, int gnx[],
+static void calc_electron_density(const char *fn, int **index, const int gnx[],
double ***slDensity, int *nslices, t_topology *top,
int ePBC,
int axis, int nr_grps, real *slWidth,
sfree(x0); /* free memory used by coordinate array */
}
-static void calc_density(const char *fn, int **index, int gnx[],
+static void calc_density(const char *fn, int **index, const int gnx[],
double ***slDensity, int *nslices, t_topology *top, int ePBC,
int axis, int nr_grps, real *slWidth, gmx_bool bCenter,
int *index_center, int ncenter,
}
-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)
+static void density_in_time (const char *fn, int **index, const 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)
{
/*
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
return nbegin;
}
-static real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[],
+static real numerical_deriv(int nx, real x[], const real y[], const real fity[], real combined[], real dy[],
real tendInt, int nsmooth)
{
FILE *tmpfp;
return integralSmth;
}
-static void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
+static void do_four(const char *fn, const char *cn, int nx, const real x[], const real dy[],
real eps0, real epsRF, const gmx_output_env_t *oenv)
{
FILE *fp, *cp;
static void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[],
- int mindex[], rvec x[], rvec mu[],
+ const int mindex[], rvec x[], rvec mu[],
int ePBC, const matrix box, const t_atom *atom, const int *nAtom)
{
static rvec *xcm[2] = { nullptr, nullptr};
xvgrclose(fp);
}
-static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol,
+static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, const ivec iMu, rvec mu, real *vol,
real *t, int nre, t_enxframe *fr)
{
int i;
return bCont;
}
-static void neutralize_mols(int n, int *index, const t_block *mols, t_atom *atom)
+static void neutralize_mols(int n, const int *index, const t_block *mols, t_atom *atom)
{
double mtot, qtot;
int ncharged, m, a0, a1, a;
t_ilist *disres, t_iparams forceparams[],
rvec x[], rvec4 f[],
t_pbc *pbc, t_graph *g, t_dr_result dr[],
- int clust_id, int isize, int index[], real vvindex[],
+ int clust_id, int isize, const int index[], real vvindex[],
t_fcdata *fcd)
{
t_iatom *forceatoms;
}
}
-static gmx_bool is_core(int i, int isize, int index[])
+static gmx_bool is_core(int i, int isize, const int index[])
{
int kk;
gmx_bool bIC = FALSE;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, 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 int strip_dssp(char *dsspfile, int nres,
- gmx_bool bPhobres[], real t,
+ const gmx_bool bPhobres[], real t,
real *acc, FILE *fTArea,
t_matrix *mat, int average_area[],
const gmx_output_env_t *oenv)
}
static void norm_acc(t_atoms *atoms, int nres,
- real av_area[], real norm_av_area[])
+ const real av_area[], real norm_av_area[])
{
int i, n, n_surf;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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/smalloc.h"
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 head, rvec tail, int isize, const int index[],
rvec xout[], rvec vout[])
{
rvec arrow, xcm;
return tmass;
}
-static real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval,
+static real calc_geom(int isize, const int *index, rvec *x, rvec geom_center, rvec minval,
rvec maxval, gmx_bool bDiam)
{
real diam2, d;
}
}
-static void scale_conf(int natom, rvec x[], matrix box, rvec scale)
+static void scale_conf(int natom, rvec x[], matrix box, const rvec scale)
{
int i, j;
sfree(img);
}
-static void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize)
+static void visualize_box(FILE *out, int a0, int r0, matrix box, const rvec gridsize)
{
int *edge;
rvec *vert, shift;
gmx_int64_t step, double t,
real reftemp,
enerdata_t *edat,
- int nset, int set[], gmx_bool *bIsEner,
+ int nset, const int set[], const gmx_bool *bIsEner,
char **leg, gmx_enxnm_t *enm,
real Vaver, real ezero,
int nbmin, int nbmax,
}
static void fec(const char *ene2fn, const char *runavgfn,
- real reftemp, int nset, int set[], char *leg[],
+ real reftemp, int nset, const int set[], char *leg[],
enerdata_t *edat, double time[],
const gmx_output_env_t *oenv)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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/futil.h"
#include "gromacs/utility/smalloc.h"
-static void insert_ion(int nsa, int *nwater,
+static void insert_ion(int nsa, const int *nwater,
gmx_bool bSet[], int repl[], int index[],
rvec x[], t_pbc *pbc,
int sign, int q, const char *ionname,
return str;
}
-static void sort_ions(int nsa, int nw, int repl[], int index[],
+static void sort_ions(int nsa, int nw, const int repl[], const int index[],
t_atoms *atoms, rvec x[],
const char *p_name, const char *n_name)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
}
static void calc_gyro_z(rvec x[], matrix box,
- int gnx, int index[], t_atom atom[],
+ int gnx, const int index[], t_atom atom[],
int nz, real time, FILE *out)
{
static dvec *inertia = nullptr;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
/* directions. */
/****************************************************************************/
-static void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
+static void calc_h2order(const char *fn, const int index[], int ngx, rvec **slDipole,
real **slOrder, real *slWidth, int *nslices,
const t_topology *top, int ePBC,
int axis, gmx_bool bMicel, int micel[], int nmic,
}
}
-static gmx_bool is_hb(unsigned int hbexist[], int frame)
+static gmx_bool is_hb(const unsigned int hbexist[], int frame)
{
return ((hbexist[OFFSET(frame)] & MASK(frame)) != 0) ? 1 : 0;
}
}
}
-static void add_dh(t_donors *ddd, int id, int ih, int grp, unsigned char *datable)
+static void add_dh(t_donors *ddd, int id, int ih, int grp, const unsigned char *datable)
{
int i;
}
}
-static void pbc_correct_gem(rvec dx, matrix box, rvec hbox);
+static void pbc_correct_gem(rvec dx, matrix box, const rvec hbox);
static void pbc_in_gridbox(rvec dx, matrix box);
static void build_grid(t_hbdata *hb, rvec x[], rvec xshell,
}
}
-static void count_da_grid(ivec ngrid, t_gridcell ***grid, t_icell danr)
+static void count_da_grid(const ivec ngrid, t_gridcell ***grid, t_icell danr)
{
int gr, xi, yi, zi;
/* New GMX record! 5 * in a row. Congratulations!
* Sorry, only four left.
*/
-static void free_grid(ivec ngrid, t_gridcell ****grid)
+static void free_grid(const ivec ngrid, t_gridcell ****grid)
{
int y, z;
t_gridcell ***g = *grid;
g = nullptr;
}
-static void pbc_correct_gem(rvec dx, matrix box, rvec hbox)
+static void pbc_correct_gem(rvec dx, matrix box, const rvec hbox)
{
int m;
gmx_bool bDone = FALSE;
}
}
-void compute_derivative(int nn, real x[], real y[], real dydx[])
+void compute_derivative(int nn, const real x[], const real y[], real dydx[])
{
int j;
static void dump_hbmap(t_hbdata *hb,
int nfile, t_filenm fnm[], gmx_bool bTwo,
- gmx_bool bContact, int isize[], int *index[], char *grpnames[],
+ gmx_bool bContact, const int isize[], int *index[], char *grpnames[],
const t_atoms *atoms)
{
FILE *fp, *fplog;
static void find_tetra_order_grid(t_topology top, int ePBC,
int natoms, matrix box,
- rvec x[], int maxidx, int index[],
+ rvec x[], int maxidx, const int index[],
real *sgmean, real *skmean,
int nslicex, int nslicey, int nslicez,
real ***sggrid, real ***skgrid)
}
-static void read_eigenvalues(int vecs[], const char *eigfile, real values[],
+static void read_eigenvalues(const int vecs[], const char *eigfile, real values[],
gmx_bool bHesse, real kT, int natoms_average_struct)
{
int neig, nrow, i;
}
static void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
- int igro[], const rvec *x, const char* structure)
+ const int igro[], const rvec *x, const char* structure)
{
/* filter2edx copies coordinates from x to edx which are given in index
*/
gmx_bool bCase = FALSE;
-static int or_groups(int nr1, int *at1, int nr2, int *at2,
+static int or_groups(int nr1, const int *at1, int nr2, const int *at2,
int *nr, int *at)
{
int i1, i2, max = 0;
return *nr;
}
-static int and_groups(int nr1, int *at1, int nr2, int *at2,
+static int and_groups(int nr1, const int *at1, int nr2, const int *at2,
int *nr, int *at)
{
int i1, i2;
return *nr;
}
-static void copy2block(int n, int *index, t_blocka *block)
+static void copy2block(int n, const int *index, t_blocka *block)
{
int i, n0;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
return natm;
}
-static void calc_mat(int nres, int natoms, int rndx[],
- rvec x[], int *index,
+static void calc_mat(int nres, int natoms, const int rndx[],
+ rvec x[], const int *index,
real trunc, real **mdmat, int **nmat, int ePBC, matrix box)
{
int i, j, resi, resj;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
static void periodic_dist(int ePBC,
- matrix box, rvec x[], int n, int index[],
+ matrix box, rvec x[], int n, const int index[],
real *rmin, real *rmax, int *min_ind)
{
#define NSHIFT_MAX 26
sfree(x0);
}
-static int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
+static int find_residues(const t_atoms *atoms, int n, const int index[], int **resindex)
{
int i;
int nres = 0, resnr, presnr = 0;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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/gmxassert.h"
#include "gromacs/utility/smalloc.h"
-static int calc_ntype(int nft, int *ft, const t_idef *idef)
+static int calc_ntype(int nft, const int *ft, const t_idef *idef)
{
int i, f, nf = 0;
return nf;
}
-static void fill_ft_ind(int nft, int *ft, const t_idef *idef,
+static void fill_ft_ind(int nft, const int *ft, const t_idef *idef,
int ft_ind[], char *grpnames[])
{
char buf[125];
}
}
-static void fill_ang(int nft, int *ft, int fac,
- int nr[], int *index[], int ft_ind[], const t_topology *top,
+static void fill_ang(int nft, const int *ft, int fac,
+ int nr[], int *index[], const int ft_ind[], const t_topology *top,
gmx_bool bNoH, real hq)
{
int f, ftype, i, j, indg, nr_fac;
return nb;
}
-static void calc_violations(real rt[], real rav3[], int nb, int index[],
+static void calc_violations(real rt[], real rav3[], int nb, const int index[],
real bounds[], real *viol, double *st, double *sa)
{
const real sixth = 1.0/6.0;
static void find_nearest_neighbours(int ePBC,
int natoms, matrix box,
- rvec x[], int maxidx, int index[],
+ rvec x[], int maxidx, const int index[],
real *sgmean, real *skmean,
int nslice, int slice_dim,
real sgslice[], real skslice[],
/* Print name of first atom in all groups in index file */
-static void print_types(int index[], int a[], int ngrps,
+static void print_types(const int index[], int a[], int ngrps,
char *groups[], const t_topology *top)
{
int i;
}
}
-static void calc_order(const char *fn, int *index, int *a, rvec **order,
+static void calc_order(const char *fn, const int *index, int *a, rvec **order,
real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced,
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,
xvgrclose(slOrd);
}
-static 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)
+static void write_bfactors(t_filenm *fnm, int nfile, const int *index, const 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*/
/* Estimate the reciprocal space part error of the SPME Ewald sum. */
static real estimate_reciprocal(
- t_inputinfo *info,
- rvec x[], /* array of particles */
- real q[], /* array of charges */
- int nr, /* number of charges = size of the charge array */
- FILE gmx_unused *fp_out,
- gmx_bool bVerbose,
- int seed, /* The seed for the random number generator */
- int *nsamples, /* Return the number of samples used if Monte Carlo
- * algorithm is used for self energy error estimate */
- t_commrec *cr)
+ t_inputinfo *info,
+ rvec x[], /* array of particles */
+ const real q[], /* array of charges */
+ int nr, /* number of charges = size of the charge array */
+ FILE gmx_unused *fp_out,
+ gmx_bool bVerbose,
+ int seed, /* The seed for the random number generator */
+ int *nsamples, /* Return the number of samples used if Monte Carlo
+ * algorithm is used for self energy error estimate */
+ t_commrec *cr)
{
real e_rec = 0; /* reciprocal error estimate */
real e_rec1 = 0; /* Error estimate term 1*/
/* this routine integrates the array data and returns the resulting array */
/* routine uses simple trapezoid rule */
-static void p_integrate(double *result, double data[], int ndata, double slWidth)
+static void p_integrate(double *result, const double data[], int ndata, double slWidth)
{
int i, slice;
double sum;
#include "gromacs/utility/strdb.h"
-static void calc_dist(int nind, int index[], const rvec x[], int ePBC, matrix box,
+static void calc_dist(int nind, const int index[], const rvec x[], int ePBC, matrix box,
real **d)
{
int i, j;
}
}
-static void calc_dist_tot(int nind, int index[], rvec x[],
+static void calc_dist_tot(int nind, const int index[], rvec x[],
int ePBC, matrix box,
real **d, real **dtot, real **dtot2,
gmx_bool bNMR, real **dtot1_3, real **dtot1_6)
}
static int analyze_noe_equivalent(const char *eq_fn,
- const t_atoms *atoms, int isize, int *index,
+ const t_atoms *atoms, int isize, const int *index,
gmx_bool bSumH,
int *noe_index, t_noe_gr *noe_gr)
{
return buf;
}
-static void calc_noe(int isize, int *noe_index,
+static void calc_noe(int isize, const int *noe_index,
real **dtot1_3, real **dtot1_6, int gnr, t_noe **noe)
{
int i, j, gi, gj;
}
static void average_residues(double f[], double **U, int uind,
- int isize, int index[], real w_rls[],
+ int isize, const int index[], const real w_rls[],
const t_atoms *atoms)
{
int i, j, start;
#include "gromacs/utility/smalloc.h"
-static int index2(int *ibox, int x, int y)
+static int index2(const int *ibox, int x, int y)
{
return (ibox[1]*x+y);
}
-static int index3(int *ibox, int x, int y, int z)
+static int index3(const int *ibox, int x, int y, int z)
{
return (ibox[2]*(ibox[1]*x+y)+z);
}
gmx_ffclose(fp);
}
-static void write_xplor(const char *file, real *data, int *ibox, real dmin[], real dmax[])
+static void write_xplor(const char *file, const real *data, int *ibox, const real dmin[], const real dmax[])
{
XplorMap *xm;
int i, j, k, n;
sfree(xm);
}
-static void normalize_p_e(int len, double *P, int *nbin, real *E, real pmin)
+static void normalize_p_e(int len, double *P, const int *nbin, real *E, real pmin)
{
int i;
double Ptot = 0;
}
static inline
-gmx_bool is_local_minimum_from_below(const t_minimum *this_min,
- int dimension_index,
- int dimension_min,
- int neighbour_index,
- real *W)
+gmx_bool is_local_minimum_from_below(const t_minimum *this_min,
+ int dimension_index,
+ int dimension_min,
+ int neighbour_index,
+ const real *W)
{
return ((dimension_index == dimension_min) ||
((dimension_index > dimension_min) &&
}
static inline
-gmx_bool is_local_minimum_from_above(const t_minimum *this_min,
- int dimension_index,
- int dimension_max,
- int neighbour_index,
- real *W)
+gmx_bool is_local_minimum_from_above(const t_minimum *this_min,
+ int dimension_index,
+ int dimension_max,
+ int neighbour_index,
+ const real *W)
{
return ((dimension_index == dimension_max) ||
((dimension_index < dimension_max) &&
gmx_bool bGE, int nenerT, real **enerT,
real Tref,
real pmax, real gmax,
- real *emin, real *emax, int nlevels, real pmin,
- int *idim, int *ibox,
+ const real *emin, const real *emax, int nlevels, real pmin,
+ const int *idim, int *ibox,
gmx_bool bXmin, real *xmin, gmx_bool bXmax, real *xmax)
{
FILE *fp;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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/smalloc.h"
static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
- int index[], rvec xref, gmx_bool bPBC)
+ const int index[], rvec xref, gmx_bool bPBC)
{
const real tol = 1e-4;
gmx_bool bChanged;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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/smalloc.h"
static void calc_com_pbc(int nrefat, const t_topology *top, rvec x[], t_pbc *pbc,
- int index[], rvec xref, int ePBC)
+ const int index[], rvec xref, int ePBC)
{
const real tol = 1e-4;
gmx_bool bChanged;
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-static void low_print_data(FILE *fp, real time, rvec x[], int n, int *index,
- gmx_bool bDim[], const char *sffmt)
+static void low_print_data(FILE *fp, real time, rvec x[], int n, const int *index,
+ const gmx_bool bDim[], const char *sffmt)
{
int i, ii, d;
fprintf(fp, "\n");
}
-static void average_data(rvec x[], rvec xav[], real *mass,
- int ngrps, int isize[], int **index)
+static void average_data(rvec x[], rvec xav[], const real *mass,
+ int ngrps, const int isize[], int **index)
{
int g, i, ind, d;
real m;
}
static void make_legend(FILE *fp, int ngrps, int isize, int index[],
- char **name, gmx_bool bCom, gmx_bool bMol, gmx_bool bDim[],
+ char **name, gmx_bool bCom, gmx_bool bMol, const gmx_bool bDim[],
const gmx_output_env_t *oenv)
{
char **leg;
sfree(leg);
}
-static real ekrot(rvec x[], rvec v[], real mass[], int isize, int index[])
+static real ekrot(rvec x[], rvec v[], const real mass[], int isize, const int index[])
{
real TCM[5][5], L[5][5];
double tm, m0, lxx, lxy, lxz, lyy, lyz, lzz, ekrot;
return ekrot;
}
-static real ektrans(rvec v[], real mass[], int isize, int index[])
+static real ektrans(rvec v[], const real mass[], int isize, const int index[])
{
dvec mvcom;
double mtot;
return dnorm2(mvcom)/(mtot*2);
}
-static real temp(rvec v[], real mass[], int isize, int index[])
+static real temp(rvec v[], const real mass[], int isize, const int index[])
{
double ekin2;
int i, j;
const char *title, t_atoms *atoms, int ePBC, matrix box,
int isize, int *index, int nfr_x, rvec *x,
int nfr_v, rvec *sum,
- gmx_bool bDim[], real scale_factor,
+ const gmx_bool bDim[], real scale_factor,
const gmx_output_env_t *oenv)
{
FILE *fp;
}
}
-static void update_histo(int gnx, int index[], rvec v[],
+static void update_histo(int gnx, const int index[], rvec v[],
int *nhisto, int **histo, real binwidth)
{
int i, m, in, nnn;
static void calc_pbc_cluster(int ecenter, int nrefat, t_topology *top, int ePBC,
- rvec x[], int index[], matrix box)
+ rvec x[], const int index[], matrix box)
{
int m, i, j, j0, j1, jj, ai, aj;
int imin, jmin;
}
}
-static void center_x(int ecenter, rvec x[], matrix box, int n, int nc, int ci[])
+static void center_x(int ecenter, rvec x[], matrix box, int n, int nc, const int ci[])
{
int i, m, ai;
rvec cmin, cmax, box_center, dx;
/* Make additional TPR files with more computational load for the
* direct space processors: */
static void make_benchmark_tprs(
- const char *fn_sim_tpr, /* READ : User-provided tpr file */
- char *fn_bench_tprs[], /* WRITE: Names of benchmark tpr files */
- gmx_int64_t benchsteps, /* Number of time steps for benchmark runs */
- gmx_int64_t statesteps, /* Step counter in checkpoint file */
- real rmin, /* Minimal Coulomb radius */
- real rmax, /* Maximal Coulomb radius */
- real bScaleRvdw, /* Scale rvdw along with rcoulomb */
- int *ntprs, /* No. of TPRs to write, each with a different
- rcoulomb and fourierspacing */
- t_inputinfo *info, /* Contains information about mdp file options */
- FILE *fp) /* Write the output here */
+ const char *fn_sim_tpr, /* READ : User-provided tpr file */
+ char *fn_bench_tprs[], /* WRITE: Names of benchmark tpr files */
+ gmx_int64_t benchsteps, /* Number of time steps for benchmark runs */
+ gmx_int64_t statesteps, /* Step counter in checkpoint file */
+ real rmin, /* Minimal Coulomb radius */
+ real rmax, /* Maximal Coulomb radius */
+ real bScaleRvdw, /* Scale rvdw along with rcoulomb */
+ const int *ntprs, /* No. of TPRs to write, each with a different
+ rcoulomb and fourierspacing */
+ t_inputinfo *info, /* Contains information about mdp file options */
+ FILE *fp) /* Write the output here */
{
int i, j, d;
t_state state;
}
-static void calc_spectrum(int n, real c[], real dt, const char *fn,
+static void calc_spectrum(int n, const real c[], real dt, const char *fn,
gmx_output_env_t *oenv, gmx_bool bRecip)
{
FILE *fp;
* After rapid convergence (using only substiantal contributions), we always switch to
* full precision.
*/
-static void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows,
+static void setup_acc_wham(const double *profile, t_UmbrellaWindow * window, int nWindows,
t_UmbrellaOptions *opt)
{
int i, j, k, nGrptot = 0, nContrib = 0, nTot = 0;
}
//! Compute the free energy offsets z (one of the two main WHAM routines)
-static double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows,
+static double calc_z(const double * profile, t_UmbrellaWindow * window, int nWindows,
t_UmbrellaOptions *opt, gmx_bool bExact)
{
double min = opt->min, dz = opt->dz, ztot_half, ztot;
*
* This is used to generate a random sequence distributed according to a histogram
*/
-static void searchCumulative(double xx[], int n, double x, int *j)
+static void searchCumulative(const double xx[], int n, double x, int *j)
{
int ju, jm, jl;
static void write_combined_matrix(int ecombine, const char *fn,
int nmat, t_matrix *mat1, t_matrix *mat2,
- real *cmin, real *cmax)
+ const real *cmin, const real *cmax)
{
int i, j, k, nlevels;
FILE *out;
}
}
-static void gradient_map(rvec grad, int nmap, t_mapping map[])
+static void gradient_map(const rvec grad, int nmap, t_mapping map[])
{
int i;
real c;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, 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.
real Jcsig; /* Standard deviation in Jc */
} t_karplus;
-void calc_distribution_props(int nh, int histo[],
+void calc_distribution_props(int nh, const int histo[],
real start, int nkkk, t_karplus kkk[],
real *S2);
/* This routine takes a dihedral distribution and calculates
* if both are 0, these values are computed by the routine itself
*/
-void normalize_histo(int npoints, int histo[], real dx, real normhisto[]);
+void normalize_histo(int npoints, const int histo[], real dx, real normhisto[]);
/*
* Normalize a histogram so that the integral over the histo is 1
*
real sigma_ct[], real sigma_nt[], real sigma_kt[],
real fit_start, real temp);
-void compute_derivative(int nn, real x[], real y[], real dydx[]);
+void compute_derivative(int nn, const real x[], const real y[], real dydx[]);
#ifdef __cplusplus
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
return ell;
}
-real ahx_len(int gnx, int index[], rvec x[])
+real ahx_len(int gnx, const int index[], rvec x[])
/* Assume we have a list of Calpha atoms only! */
{
rvec dx;
return norm(dx);
}
-real radius(FILE *fp, int nca, int ca_index[], rvec x[])
+real radius(FILE *fp, int nca, const int ca_index[], rvec x[])
/* Assume we have all the backbone */
{
real dl2, dlt;
return std::sqrt(dlt/nca);
}
-static real rot(rvec x1, rvec x2)
+static real rot(rvec x1, const rvec x2)
{
real phi1, dphi, cp, sp;
real xx, yy;
return dphi;
}
-real twist(int nca, int caindex[], rvec x[])
+real twist(int nca, const int caindex[], rvec x[])
{
real pt, dphi;
int i, a0, a1;
return (pt/(nca-1));
}
-real ca_phi(int gnx, int index[], rvec x[])
+real ca_phi(int gnx, const int index[], rvec x[])
/* Assume we have a list of Calpha atoms only! */
{
real phi, phitot;
return norm(dipje);
}
-real rise(int gnx, int index[], rvec x[])
+real rise(int gnx, const int index[], rvec x[])
/* Assume we have a list of Calpha atoms only! */
{
real z, z0, ztot;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, 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.
efhAHX, efhNR
};
-extern real ahx_len(int gnx, int index[], rvec x[]);
+extern real ahx_len(int gnx, const int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
extern real ellipticity(int nres, t_bb bb[]);
-extern real radius(FILE *fp, int nca, int ca_index[], rvec x[]);
+extern real radius(FILE *fp, int nca, const int ca_index[], rvec x[]);
/* Assume we have calphas */
-extern real twist(int nca, int caindex[], rvec x[]);
+extern real twist(int nca, const int caindex[], rvec x[]);
/* Calculate the twist of the helix */
extern real pprms(FILE *fp, int nbb, t_bb bb[]);
* and the distance per residue
*/
-extern real ca_phi(int gnx, int index[], rvec x[]);
+extern real ca_phi(int gnx, const int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
extern real dip(int nbb, const int bbind[], const rvec x[], const t_atom atom[]);
-extern real rise(int gnx, int index[], rvec x[]);
+extern real rise(int gnx, const int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
extern void av_hblen(FILE *fp3, FILE *fp3a,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
return -1;
}
-static void add_xr(t_xrama *xr, int ff[5], const t_atoms *atoms)
+static void add_xr(t_xrama *xr, const int ff[5], const t_atoms *atoms)
{
char buf[12];
int i;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, 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.
}
gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (
- gmx_sans_t *gsans,
- rvec *x,
- matrix box,
- int *index,
- int isize,
- double binwidth,
- gmx_bool bMC,
- gmx_bool bNORM,
- real mcover,
- unsigned int seed)
+ gmx_sans_t *gsans,
+ rvec *x,
+ matrix box,
+ const int *index,
+ int isize,
+ double binwidth,
+ gmx_bool bMC,
+ gmx_bool bNORM,
+ real mcover,
+ unsigned int seed)
{
gmx_radial_distribution_histogram_t *pr = nullptr;
rvec dist;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2018, 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.
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,
- matrix box,
- int *index,
- int isize,
- double binwidth,
- gmx_bool bMC,
- gmx_bool bNORM,
- real mcover,
- unsigned int seed);
+gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (gmx_sans_t *gsans,
+ rvec *x,
+ matrix box,
+ const int *index,
+ int isize,
+ double binwidth,
+ gmx_bool bMC,
+ gmx_bool bNORM,
+ real mcover,
+ unsigned int seed);
gmx_static_structurefactor_t *convert_histogram_to_intensity_curve (gmx_radial_distribution_histogram_t *pr, double start_q, double end_q, double q_step);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, 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.
sfree(ev);
}
-void rotate_atoms(int gnx, int *index, rvec x[], matrix trans)
+void rotate_atoms(int gnx, const int *index, rvec x[], matrix trans)
{
real xt, yt, zt;
int i, ii;
return tm;
}
-void add_xcm(rvec x[], int gnx, int *index, rvec xcm)
+void add_xcm(rvec x[], int gnx, const int *index, rvec xcm)
{
int i, ii;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016,2018, 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.
extern "C" {
#endif
-void rotate_atoms(int gnx, int index[], rvec x[], matrix trans);
+void rotate_atoms(int gnx, const int index[], rvec x[], matrix trans);
/* Rotate all atoms in index using matrix trans */
void principal_comp(int n, const int index[], t_atom atom[], rvec x[],
* Returns the total mass
*/
-void add_xcm(rvec x[], int gnx, int *index, rvec xcm);
+void add_xcm(rvec x[], int gnx, const int *index, rvec xcm);
/* Increment all atoms in index with xcm */
#ifdef __cplusplus
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
}
-extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, int * index,
+extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, const int * index,
int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf)
/* given the group's index, return the (continuous) array of atoms */
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
int return_atom_type (const char *name, gmx_structurefactors_t *gsf);
-void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, int * index,
+void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, const int * index,
int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf);
int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
return RGAS*(std::log(qT) + 2.5);
}
-double calcRotationalEntropy(real temperature,
- int natom,
- gmx_bool linear,
- rvec theta,
- real sigma_r)
+double calcRotationalEntropy(real temperature,
+ int natom,
+ gmx_bool linear,
+ const rvec theta,
+ real sigma_r)
{
GMX_RELEASE_ASSERT(sigma_r > 0, "Symmetry factor should be larger than zero");
GMX_RELEASE_ASSERT(temperature > 0, "Temperature should be larger than zero");
* \param[in] sigma_r Symmetry factor, should be >= 1
* \returns The rotational entropy
*/
-double calcRotationalEntropy(real temperature,
- int natom,
- gmx_bool linear,
- rvec theta,
- real sigma_r);
+double calcRotationalEntropy(real temperature,
+ int natom,
+ gmx_bool linear,
+ const rvec theta,
+ real sigma_r);
/*! \brief Compute internal energy due to vibrational motion
*
*
* 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,2018, 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.
}
/* Make a new box around a configuration*/
-void make_new_box(int natoms, rvec *x, matrix box, rvec box_space,
+void make_new_box(int natoms, rvec *x, matrix box, const rvec box_space,
gmx_bool bCenter)
{
int i, m;
*
* 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,2018, 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 rotate_conf(int natom, rvec *x, rvec *v, real alfa, real beta, real gamma);
/*rotate() rotates a configuration alfa degrees around the x_axis and beta degrees around the y_axis, *v can be NULL */
-void make_new_box(int natoms, rvec *x, matrix box, rvec box_space,
+void make_new_box(int natoms, rvec *x, matrix box, const rvec box_space,
gmx_bool bCenter);
/* Generates a box around a configuration, box_space is optional extra
* space around it. If bCenter then coordinates will be centered in
}
static void
-setup_aadata(gmx_allvsall_data_t ** p_aadata,
- const t_blocka * excl,
- int natoms,
- int * type,
- int ntype,
- real * pvdwparam)
+setup_aadata(gmx_allvsall_data_t ** p_aadata,
+ const t_blocka * excl,
+ int natoms,
+ const int * type,
+ int ntype,
+ const real * pvdwparam)
{
int i, j, idx;
gmx_allvsall_data_t *aadata;
#define NCONSTR_INDEX asize(constr_index)
static double pr_av(FILE *log, t_commrec *cr,
- double fav, double ftot[], const char *title)
+ double fav, const double ftot[], const char *title)
{
int i, perc;
double dperc, unb;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017,2018, 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 add_param(t_params *ps, int ai, int aj, real *c, char *s)
+void add_param(t_params *ps, int ai, int aj, const real *c, char *s)
{
int i;
*
* 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,2018, 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/gmxpreprocess/pdb2top.h"
#include "gromacs/utility/real.h"
-void add_param(t_params *ps, int ai, int aj, real *c, char *s);
+void add_param(t_params *ps, int ai, int aj, const real *c, char *s);
void add_imp_param(t_params *ps, int ai, int aj, int ak, int al,
real c0, real c1, char *s);
}
static void append_interaction(t_ilist *ilist,
- int type, int nral, int a[MAXATOMLIST])
+ int type, int nral, const int a[MAXATOMLIST])
{
int i, where1;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
}
}
-static void set_p(t_param *p, int ai[4], real *c, char *s)
+static void set_p(t_param *p, const int ai[4], const real *c, char *s)
{
int j;
}
}
-static int n_hydro(int a[], char ***atomname)
+static int n_hydro(const int a[], char ***atomname)
{
int i, nh = 0;
char c0, c1, *aname;
}
static void get_atomnames_min(int n, char **anm,
- int resind, t_atoms *atoms, int *a)
+ int resind, t_atoms *atoms, const int *a)
{
int m;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, 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.
low_mspeed(tempi, mtop, v, &rng);
}
-static real calc_cm(int natoms, real mass[], rvec x[], rvec v[],
+static real calc_cm(int natoms, const real mass[], rvec x[], rvec v[],
rvec xcm, rvec vcm, rvec acm, matrix L)
{
rvec dx, a0;
}
static void print_bonds(FILE *fp, int o2n[],
- int nrHatoms, int Hatoms[], int Heavy,
- int nrheavies, int heavies[])
+ int nrHatoms, const int Hatoms[], int Heavy,
+ int nrheavies, const int heavies[])
{
int i;
#include "gromacs/utility/smalloc.h"
static void rand_rot(int natoms, rvec x[], rvec v[], vec4 xrot[], vec4 vrot[],
- gmx::DefaultRandomEngine * rng, rvec max_rot)
+ gmx::DefaultRandomEngine * rng, const rvec max_rot)
{
mat4 mt1, mt2, mr[DIM], mtemp1, mtemp2, mtemp3, mxtot, mvtot;
rvec xcm;
}
static void hacksearch_atom(int *ii, int *jj, char *name,
- int nab[], t_hack *ab[],
+ const int nab[], t_hack *ab[],
int resind, t_atoms *pdba)
{
int i, j;
}
-static void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader)
+static void dump_ab(FILE *out, int natom, const int nab[], t_hack *ab[], gmx_bool bHeader)
{
int i, j;
static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
int nterpairs,
t_hackblock **ntdb, t_hackblock **ctdb,
- int *rN, int *rC)
+ const int *rN, const int *rC)
{
int i, rnr;
t_hackblock *hb, *ahptr;
static void expand_hackblocks(t_atoms *pdba, t_hackblock hb[],
int nab[], t_hack *ab[],
- int nterpairs, int *rN, int *rC)
+ int nterpairs, const int *rN, const int *rC)
{
int i, j;
gmx_bool bN, bC;
}
}
-static int check_atoms_present(t_atoms *pdba, int nab[], t_hack *ab[])
+static int check_atoms_present(t_atoms *pdba, const int nab[], t_hack *ab[])
{
int i, j, k, rnr, nadd;
}
static void
-spline1d( double dx,
- double * y,
- int n,
- double * u,
- double * y2 )
+spline1d( double dx,
+ const double * y,
+ int n,
+ double * u,
+ double * y2 )
{
int i;
double p, q;
static void
-interpolate1d( double xmin,
- double dx,
- double * ya,
- double * y2a,
- double x,
- double * y,
- double * y1)
+interpolate1d( double xmin,
+ double dx,
+ const double * ya,
+ const double * y2a,
+ double x,
+ double * y,
+ double * y1)
{
int ix;
double a, b;
static void
-setup_cmap (int grid_spacing,
- int nc,
- real * grid,
- gmx_cmap_t * cmap_grid)
+setup_cmap (int grid_spacing,
+ int nc,
+ const real * grid,
+ gmx_cmap_t * cmap_grid)
{
double *tmp_u, *tmp_u2, *tmp_yy, *tmp_y1, *tmp_t2, *tmp_grid;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
}
static void chk_allhb(t_atoms *pdba, rvec x[], t_blocka *hb,
- gmx_bool donor[], gmx_bool accept[], real dist)
+ const gmx_bool donor[], const gmx_bool accept[], real dist)
{
int i, j, k, ii, natom;
}
static gmx_bool chk_hbonds(int i, t_atoms *pdba, rvec x[],
- gmx_bool ad[], gmx_bool hbond[], rvec xh,
+ const gmx_bool ad[], gmx_bool hbond[], rvec xh,
real angle, real dist)
{
gmx_bool bHB;
}
-static void rename_resrtp(t_atoms *pdba, int nterpairs, int *r_start, int *r_end,
+static void rename_resrtp(t_atoms *pdba, int nterpairs, const int *r_start, const int *r_end,
int nrr, rtprename_t *rr, t_symtab *symtab,
gmx_bool bVerbose)
{
}
}
-void write_top(FILE *out, char *pr, char *molname,
+void write_top(FILE *out, char *pr, const char *molname,
t_atoms *at, gmx_bool bRTPresname,
int bts[], t_params plist[], t_excls excls[],
gpp_atomtype_t atype, int *cgnr, int nrexcl)
int nres, t_resinfo *resinfo,
int nterpairs,
t_hackblock **ntdb, t_hackblock **ctdb,
- int *rn, int *rc,
+ const int *rn, const int *rc,
gmx_bool bAllowMissing)
{
int i, j, k, l;
int nres, t_resinfo *resinfo,
int nterpairs,
t_hackblock **ntdb, t_hackblock **ctdb,
- int *rn, int *rc,
+ const int *rn, const int *rc,
gmx_bool bAllowMissing);
/* Get the database entries for the nres residues in resinfo
* and store them in restp and hb.
int nincl, char **incls,
int nmol, t_mols *mols);
-void write_top(FILE *out, char *pr, char *molname,
+void write_top(FILE *out, char *pr, const char *molname,
t_atoms *at, gmx_bool bRTPresname,
int bts[], t_params plist[], t_excls excls[],
gpp_atomtype_t atype, int *cgnr, int nrexcl);
}
-static void generate_qmexcl_moltype(gmx_moltype_t *molt, unsigned char *grpnr,
+static void generate_qmexcl_moltype(gmx_moltype_t *molt, const unsigned char *grpnr,
t_inputrec *ir, warninp_t wi)
{
/* This routine expects molt->ilist to be of size F_NRE and ordered. */
*
* 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,2018, 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.
}
}
-static int count_hydrogens (char ***atomname, int nra, int a[])
+static int count_hydrogens (char ***atomname, int nra, const int a[])
{
int i, nh;
(*nrbonded)++;
}
-static void get_bondeds(int nrat, t_iatom atoms[],
+static void get_bondeds(int nrat, const t_iatom atoms[],
at2vsitebond_t *at2vb,
int *nrbond, t_mybonded **bonds,
int *nrang, t_mybonded **angles,
} t_pindex;
static void check_vsite_constraints(t_params *plist,
- int cftype, int vsite_type[])
+ int cftype, const int vsite_type[])
{
int i, k, n;
int atom;
}
static void clean_vsite_bonds(t_params *plist, t_pindex pindex[],
- int cftype, int vsite_type[])
+ int cftype, const int vsite_type[])
{
int ftype, i, j, k, m, n, nvsite, nOut, kept_i;
int nconverted, nremoved;
}
static void clean_vsite_angles(t_params *plist, t_pindex pindex[],
- int cftype, int vsite_type[],
+ int cftype, const int vsite_type[],
at2vsitecon_t *at2vc)
{
int i, j, k, m, n, nvsite, kept_i;
}
static void clean_vsite_dihs(t_params *plist, t_pindex pindex[],
- int cftype, int vsite_type[])
+ int cftype, const int vsite_type[])
{
int i, kept_i;
t_params *ps;
/*! \brief Copied and modified from groupcoord.c shift_positions_group(). */
static void shift_positions(
- matrix box,
- rvec x[], /* The positions [0..nr] */
- ivec is, /* The shift [0..nr] */
- int nr) /* The number of positions */
+ matrix box,
+ rvec x[], /* The positions [0..nr] */
+ const ivec is, /* The shift [0..nr] */
+ int nr) /* The number of positions */
{
int i, tx, ty, tz;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2017,2018, 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 <cstdlib>
-int glatnr(int *global_atom_index, int i)
+int glatnr(const int *global_atom_index, int i)
{
int atnr;
* numbers starting at 1. When global_atom_index=NULL returns i+1.
*/
int
-glatnr(int *global_atom_index, int i);
+glatnr(const int *global_atom_index, int i);
#endif
/*! \brief Compute the energy and force for a single pair interaction */
static real
-evaluate_single(real r2, real tabscale, real *vftab, real tableStride,
+evaluate_single(real r2, real tabscale, const real *vftab, real tableStride,
real qq, real c6, real c12, real *velec, real *vvdw)
{
real rinv, r, rtab, eps, eps2, Y, F, Geps, Heps2, Fp, VVe, FFe, VVd, FFd, VVr, FFr, fscal;
/*! \brief Compute the energy and force for a single pair interaction under FEP */
static real
free_energy_evaluate_single(real r2, real sc_r_power, real alpha_coul,
- real alpha_vdw, real tabscale, real *vftab, real tableStride,
+ real alpha_vdw, real tabscale, const real *vftab, real tableStride,
real qqA, real c6A, real c12A, real qqB,
- real c6B, real c12B, real LFC[2], real LFV[2], real DLF[2],
- real lfac_coul[2], real lfac_vdw[2], real dlfac_coul[2],
- real dlfac_vdw[2], real sigma6_def, real sigma6_min,
+ real c6B, real c12B, const real LFC[2], const real LFV[2], const real DLF[2],
+ const real lfac_coul[2], const real lfac_vdw[2], const real dlfac_coul[2],
+ const real dlfac_vdw[2], real sigma6_def, real sigma6_min,
real sigma2_def, real sigma2_min,
real *velectot, real *vvdwtot, real *dvdl)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, 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/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-real calc_similar_ind(gmx_bool bRho, int nind, int *index, real mass[],
+real calc_similar_ind(gmx_bool bRho, int nind, const int *index, const real mass[],
rvec x[], rvec xp[])
{
int i, j, d;
return calc_similar_ind(TRUE, natoms, nullptr, mass, x, xp);
}
-void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x, matrix R)
+void calc_fit_R(int ndim, int natoms, const real *w_rls, const rvec *xp, rvec *x, matrix R)
{
int c, r, n, j, i, irot, s;
double **omega, **om;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016,2018, 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.
extern "C" {
#endif
-real calc_similar_ind(gmx_bool bRho, int nind, int *index, real mass[],
+real calc_similar_ind(gmx_bool bRho, int nind, const int *index, const real mass[],
rvec x[], rvec xp[]);
/* Returns RMSD or Rho (depending on bRho) over all atoms in index */
* Maiorov & Crippen, PROTEINS 22, 273 (1995).
*/
-void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x,
+void calc_fit_R(int ndim, int natoms, const 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)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, 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/math/vec.h"
#include "gromacs/mdlib/gmx_omp_nthreads.h"
-void calc_mu(int start, int homenr, gmx::ArrayRef<gmx::RVec> x, real q[], real qB[],
+void calc_mu(int start, int homenr, gmx::ArrayRef<gmx::RVec> x, const real q[], const real qB[],
int nChargePerturbed,
dvec mu, dvec mu_B)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2017,2018, 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/arrayref.h"
#include "gromacs/utility/basedefinitions.h"
-void calc_mu(int start, int homenr, gmx::ArrayRef<gmx::RVec> x, real q[], real qB[],
+void calc_mu(int start, int homenr, gmx::ArrayRef<gmx::RVec> x, const real q[], const real qB[],
int nChargePerturbed,
dvec mu, dvec mu_B);
static void lo_fcv(int i0, int i1,
- real x[], real f[], tensor vir,
- int is[], real box[], gmx_bool bTriclinic)
+ const real x[], const real f[], tensor vir,
+ const int is[], const real box[], gmx_bool bTriclinic)
{
int i, i3, tx, ty, tz;
real xx, yy, zz;
}
}
-static void GenerateWeightedGibbsProbabilities(real *ene, double *p_k, double *pks, int nlim, real *nvals, real delta)
+static void GenerateWeightedGibbsProbabilities(const real *ene, double *p_k, double *pks, int nlim, real *nvals, real delta)
{
int i;
sfree(nene);
}
-static int FindMinimum(real *min_metric, int N)
+static int FindMinimum(const real *min_metric, int N)
{
real min_val;
return min_nval;
}
-static gmx_bool CheckHistogramRatios(int nhisto, real *histo, real ratio)
+static gmx_bool CheckHistogramRatios(int nhisto, const real *histo, real ratio)
{
int i;
}
}
-static real sum_v(int n, real v[])
+static real sum_v(int n, const real v[])
{
real t;
int i;
* The atom indices are retrieved from anrs_loc[0..nr_loc]
* Note that coll_ind[i] = i is needed in the serial case */
extern void communicate_group_positions(
- const t_commrec *cr, /* Pointer to MPI communication data */
- rvec *xcoll, /* Collective array of positions */
- ivec *shifts, /* Collective array of shifts for xcoll (can be NULL) */
- ivec *extra_shifts, /* (optional) Extra shifts since last time step */
- const gmx_bool bNS, /* (optional) NS step, the shifts have changed */
- const rvec *x_loc, /* Local positions on this node */
- const int nr, /* Total number of atoms in the group */
- const int nr_loc, /* Local number of atoms in the group */
- int *anrs_loc, /* Local atom numbers */
- int *coll_ind, /* Collective index */
- rvec *xcoll_old, /* (optional) Positions from the last time step,
- used to make group whole */
- matrix box) /* (optional) The box */
+ const t_commrec *cr, /* Pointer to MPI communication data */
+ rvec *xcoll, /* Collective array of positions */
+ ivec *shifts, /* Collective array of shifts for xcoll (can be NULL) */
+ ivec *extra_shifts, /* (optional) Extra shifts since last time step */
+ const gmx_bool bNS, /* (optional) NS step, the shifts have changed */
+ const rvec *x_loc, /* Local positions on this node */
+ const int nr, /* Total number of atoms in the group */
+ const int nr_loc, /* Local number of atoms in the group */
+ const int *anrs_loc, /* Local atom numbers */
+ const int *coll_ind, /* Collective index */
+ rvec *xcoll_old, /* (optional) Positions from the last time step,
+ used to make group whole */
+ matrix box) /* (optional) The box */
{
int i;
extern void communicate_group_positions(const t_commrec *cr, rvec *xcoll, ivec *shifts,
ivec *extra_shifts, const gmx_bool bNS,
const rvec *x_loc, const int nr, const int nr_loc,
- int *anrs_loc, int *coll_ind, rvec *xcoll_old,
+ const int *anrs_loc, const int *coll_ind, rvec *xcoll_old,
matrix box);
/*! \brief Calculates the center of the positions x locally.
//! Issues a warning when LINCS constraints cannot be satisfied.
static void lincs_warning(gmx_domdec_t *dd, const rvec *x, rvec *xprime, t_pbc *pbc,
- int ncons, int *bla, real *bllen, real wangle,
+ int ncons, const int *bla, real *bllen, real wangle,
int maxwarn, int *warncount)
{
int b, i, j;
return fp;
}
-static void copy_energy(t_mdebin *md, real e[], real ecpy[])
+static void copy_energy(t_mdebin *md, const real e[], real ecpy[])
{
int i, j;
static void mde_delta_h_init(t_mde_delta_h *dh, int nbins,
double dx, unsigned int ndhmax,
int type, int derivative, int nlambda,
- double *lambda)
+ const double *lambda)
{
int i;
}
/* resize performed in the md loop */
-static void resize(rvec *r_ins, rvec *r, pos_ins_t *pos_ins, rvec fac)
+static void resize(rvec *r_ins, rvec *r, pos_ins_t *pos_ins, const rvec fac)
{
int i, j, k, at, c = 0;
for (k = 0; k < pos_ins->pieces; k++)
}
/* Estimates the interaction volume^2 for non-local interactions */
-static real nonlocal_vol2(const struct gmx_domdec_zones_t *zones, rvec ls, real r)
+static real nonlocal_vol2(const struct gmx_domdec_zones_t *zones, const rvec ls, real r)
{
real cl, ca, za;
real vold_est;
*z = ci;
}
-static int ci_not_used(ivec n)
+static int ci_not_used(const ivec n)
{
/* Return an improbable value */
return xyz2ci(n[YY], n[ZZ], 3*n[XX], 3*n[YY], 3*n[ZZ]);
return mm;
} /* mk_MMrec */
-static void init_QMrec(int grpnr, t_QMrec *qm, int nr, int *atomarray,
+static void init_QMrec(int grpnr, t_QMrec *qm, int nr, const int *atomarray,
gmx_mtop_t *mtop, t_inputrec *ir)
{
/* fills the t_QMrec struct of QM group grpnr
return add_binr(b, r.size(), r.data());
}
-int add_bind(t_bin *b, int nr, double r[])
+int add_bind(t_bin *b, int nr, const double r[])
{
#define MULT 4
int i, rest, index;
int add_binr(t_bin *b, int nr, const real r[]);
int add_binr(t_bin *b, gmx::ArrayRef<const real> r);
-int add_bind(t_bin *b, int nr, double r[]);
+int add_bind(t_bin *b, int nr, const double r[]);
/* Add reals to the bin. Returns index */
void sum_bin(t_bin *b, const t_commrec *cr);
}
}
-static void print_transition_matrix(FILE *fplog, int n, int **nmoves, int *nattempt)
+static void print_transition_matrix(FILE *fplog, int n, int **nmoves, const int *nattempt)
{
int i, j, ntot;
float Tprint;
}
}
-static void print_ind(FILE *fplog, const char *leg, int n, int *ind, gmx_bool *bEx)
+static void print_ind(FILE *fplog, const char *leg, int n, int *ind, const gmx_bool *bEx)
{
int i;
}
void settle_proj(settledata *settled, ConstraintVariable econq,
- int nsettle, t_iatom iatoms[],
+ int nsettle, const t_iatom iatoms[],
const t_pbc *pbc,
const rvec x[],
rvec *der, rvec *derp,
* of coordinates working on settle type constraint.
*/
void settle_proj(settledata *settled, ConstraintVariable econq,
- int nsettle, t_iatom iatoms[],
+ int nsettle, const t_iatom iatoms[],
const t_pbc *pbc, /* PBC data pointer, can be NULL */
const rvec x[],
rvec *der, rvec *derp,
//! Implements RATTLE (ie. SHAKE for velocity verlet integrators)
static void
-crattle(int iatom[], int ncon, int *nnit, int maxnit,
- real constraint_distance_squared[], real vp[], real rij[], real m2[], real omega,
- const real invmass[], real distance_squared_tolerance[], real scaled_lagrange_multiplier[],
+crattle(const int iatom[], int ncon, int *nnit, int maxnit,
+ const real constraint_distance_squared[], real vp[], const real rij[], const real m2[], real omega,
+ const real invmass[], const real distance_squared_tolerance[], real scaled_lagrange_multiplier[],
int *nerror, real invdt)
{
/*
* removed. */
static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
int ns, t_shell s[],
- real mass[], gmx_mtop_t *mtop, gmx_bool bInit)
+ const real mass[], gmx_mtop_t *mtop, gmx_bool bInit)
{
int i, m, s1, n1, n2, n3;
real dt_1, fudge, tm, m1, m2, m3;
static void
-integrate_table(real vdwtab[], real scale, int offstart, int rstart, int rend,
+integrate_table(const real vdwtab[], real scale, int offstart, int rstart, int rend,
double *enerout, double *virout)
{
double enersum, virsum;
return ng;
}
-static int first_colour(int fC, egCol Col, t_graph *g, egCol egc[])
+static int first_colour(int fC, egCol Col, t_graph *g, const egCol egc[])
/* Return the first node with colour Col starting at fC.
* return -1 if none found.
*/
sfree(gs);
}
-static int filter_enerdterm(real *afrom, gmx_bool bToBuffer, real *ato,
+static int filter_enerdterm(const real *afrom, gmx_bool bToBuffer, real *ato,
gmx_bool bTemp, gmx_bool bPres, gmx_bool bEner)
{
int i, to, from;
}
static void do_update_vv_vel(int start, int nrend, real dt,
- rvec accel[], ivec nFreeze[], real invmass[],
- unsigned short ptype[], unsigned short cFREEZE[],
- unsigned short cACC[], rvec v[], const rvec f[],
+ rvec accel[], ivec nFreeze[], const real invmass[],
+ const unsigned short ptype[], const unsigned short cFREEZE[],
+ const unsigned short cACC[], rvec v[], const rvec f[],
gmx_bool bExtended, real veta, real alpha)
{
int gf = 0, ga = 0;
static void do_update_vv_pos(int start, int nrend, real dt,
ivec nFreeze[],
- unsigned short ptype[], unsigned short cFREEZE[],
+ const unsigned short ptype[], const unsigned short cFREEZE[],
const rvec x[], rvec xprime[], rvec v[],
gmx_bool bExtended, real veta)
{
doSDUpdateGeneral(gmx_stochd_t *sd,
int start, int nrend, real dt,
rvec accel[], ivec nFreeze[],
- real invmass[], unsigned short ptype[],
- unsigned short cFREEZE[], unsigned short cACC[],
- unsigned short cTC[],
+ const real invmass[], const unsigned short ptype[],
+ const unsigned short cFREEZE[], const unsigned short cACC[],
+ const unsigned short cTC[],
const rvec x[], rvec xprime[], rvec v[], const rvec f[],
- gmx_int64_t step, int seed, int *gatindex)
+ gmx_int64_t step, int seed, const int *gatindex)
{
if (updateType != SDUpdate::FrictionAndNoiseOnly)
{
static void do_update_bd(int start, int nrend, real dt,
ivec nFreeze[],
- real invmass[], unsigned short ptype[],
- unsigned short cFREEZE[], unsigned short cTC[],
+ const real invmass[], const unsigned short ptype[],
+ const unsigned short cFREEZE[], const unsigned short cTC[],
const rvec x[], rvec xprime[], rvec v[],
const rvec f[], real friction_coefficient,
- real *rf, gmx_int64_t step, int seed,
- int* gatindex)
+ const real *rf, gmx_int64_t step, int seed,
+ const int* gatindex)
{
/* note -- these appear to be full step velocities . . . */
int gf = 0, gt = 0;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
return vcm;
}
-static void update_tensor(rvec x, real m0, tensor I)
+static void update_tensor(const rvec x, real m0, tensor I)
{
real xy, xz, yz;
}
static bool set_affinity(const t_commrec *cr, int nthread_local, int intraNodeThreadOffset,
- int offset, int core_pinning_stride, int *localityOrder,
+ int offset, int core_pinning_stride, const int *localityOrder,
gmx::IThreadAffinityAccess *affinityAccess)
{
// Set the per-thread affinity. In order to be able to check the success
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, 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.
static void mk_igraph(t_graph *g, int ftype, const t_ilist *il,
int at_start, int at_end,
- int *part)
+ const int *part)
{
t_iatom *ia;
int i, j, np;
************************************************************/
static void mk_1shift_tric(int npbcdim, const matrix box, const rvec hbox,
- const rvec xi, const rvec xj, int *mi, int *mj)
+ const rvec xi, const rvec xj, const int *mi, int *mj)
{
/* Calculate periodicity for triclinic box... */
int m, d;
}
static void mk_1shift(int npbcdim, const rvec hbox, const rvec xi, const rvec xj,
- int *mi, int *mj)
+ const int *mi, int *mj)
{
/* Calculate periodicity for rectangular box... */
int m;
}
static void mk_1shift_screw(const matrix box, const rvec hbox,
- const rvec xi, const rvec xj, int *mi, int *mj)
+ const rvec xi, const rvec xj, const int *mi, int *mj)
{
/* Calculate periodicity for rectangular box... */
int signi, m;
return ng;
}
-static int first_colour(int fC, egCol Col, t_graph *g, egCol egc[])
+static int first_colour(int fC, egCol Col, t_graph *g, const egCol egc[])
/* Return the first node with colour Col starting at fC.
* return -1 if none found.
*/
static void init_pull_group_index(FILE *fplog, const t_commrec *cr,
int g, pull_group_work_t *pg,
- gmx_bool bConstraint, ivec pulldim_con,
+ gmx_bool bConstraint, const ivec pulldim_con,
const gmx_mtop_t *mtop,
const t_inputrec *ir, real lambda)
{
/* Returns the weight in a single slab, also calculates the Gaussian- and mass-
* weighted sum of positions for that slab */
-static real get_slab_weight(int j, t_rotgrp *rotg, rvec xc[], real mc[], rvec *x_weighted_sum)
+static real get_slab_weight(int j, t_rotgrp *rotg, rvec xc[], const real mc[], rvec *x_weighted_sum)
{
rvec curr_x; /* The position of an atom */
rvec curr_x_weighted; /* The gaussian-weighted position */
static real opt_angle_analytic(
- rvec* ref_s,
- rvec* act_s,
- real* weight,
- int natoms,
- rvec ref_com,
- rvec act_com,
- rvec axis)
+ rvec * ref_s,
+ rvec * act_s,
+ real * weight,
+ int natoms,
+ const rvec ref_com,
+ const rvec act_com,
+ rvec axis)
{
int i, j, k;
rvec *ref_s_1 = nullptr;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, 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.
* \ref CMP_INVALID is returned.
*/
static e_comparison_t
-comparison_type(char *str)
+comparison_type(const char *str)
{
switch (str[0])
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, 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.
return ok;
}
-static int low_lsq_y_ax_b(int n, real *xr, double *xd, real yr[],
+static int low_lsq_y_ax_b(int n, const real *xr, const double *xd, real yr[],
real *a, real *b, real *r, real *chi2)
{
gmx_stats_t lsq = gmx_stats_init();
* reference atom and determine the center with respect to this reference.
*/
static void get_molecule_center(
- rvec x[],
- int nat,
- real *weights,
- rvec center,
- t_pbc *pbc)
+ rvec x[],
+ int nat,
+ const real *weights,
+ rvec center,
+ t_pbc *pbc)
{
int i;
rvec weightedPBCimage;
* of which the indices were lumped together in the older version of the code.
*/
static void copyIndicesToGroup(
- int *indIons,
- int nIons,
- t_swapGroup *g,
- t_commrec *cr)
+ const int *indIons,
+ int nIons,
+ t_swapGroup *g,
+ t_commrec *cr)
{
g->nat = nIons;
}
static void copy2table(int n, int offset, int stride,
- double x[], double Vtab[], double Ftab[], real scalefactor,
+ const double x[], const double Vtab[], const double Ftab[], real scalefactor,
real dest[])
{
/* Use double prec. for the intermediary variables
}
}
-static void spline_forces(int nx, double h, double v[], gmx_bool bS3, gmx_bool bE3,
+static void spline_forces(int nx, double h, const double v[], gmx_bool bS3, gmx_bool bE3,
double f[])
{
int start, end, i;
return inv;
}
-static void reduce_block(gmx_bool bKeep[], t_block *block,
+static void reduce_block(const gmx_bool bKeep[], t_block *block,
const char *name)
{
int *index;
block->nr = newi;
}
-static void reduce_blocka(int invindex[], gmx_bool bKeep[], t_blocka *block,
+static void reduce_blocka(const int invindex[], const gmx_bool bKeep[], t_blocka *block,
const char *name)
{
int *index, *a;
block->nra = newj;
}
-static void reduce_rvec(int gnx, int index[], rvec vv[])
+static void reduce_rvec(int gnx, const int index[], rvec vv[])
{
rvec *ptr;
int i;
sfree(ptr);
}
-static void reduce_atom(int gnx, int index[], t_atom atom[], char ***atomname,
+static void reduce_atom(int gnx, const int index[], t_atom atom[], char ***atomname,
int *nres, t_resinfo *resinfo)
{
t_atom *ptr;
sfree(rinfo);
}
-static void reduce_ilist(int invindex[], gmx_bool bKeep[],
+static void reduce_ilist(const int invindex[], const gmx_bool bKeep[],
t_ilist *il, int nratoms, const char *name)
{
t_iatom *ia;
mtop->natoms = top.atoms.nr;
}
-static void zeroq(int index[], gmx_mtop_t *mtop)
+static void zeroq(const int index[], gmx_mtop_t *mtop)
{
for (gmx_moltype_t &moltype : mtop->moltype)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
/* return number of matching characters,
or NOTFOUND if not at least all characters in char *database match */
-static int dbcmp_len(char *search, char *database)
+static int dbcmp_len(const char *search, const char *database)
{
int i;
gmx_ffclose(out);
}
-void add_grp(t_blocka *b, char ***gnames, int nra, int a[], const char *name)
+void add_grp(t_blocka *b, char ***gnames, int nra, const int a[], const char *name)
{
int i;
/* compare index in `a' with group in `b' at `index',
when `index'<0 it is relative to end of `b' */
-static gmx_bool grp_cmp(t_blocka *b, int nra, int a[], int index)
+static gmx_bool grp_cmp(t_blocka *b, int nra, const int a[], int index)
{
int i;
}
-void check_index(char *gname, int n, int index[], char *traj, int natoms)
+void check_index(const char *gname, int n, int index[], const char *traj, int natoms)
{
int i;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016,2017,2018, 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.
struct t_atoms;
struct t_blocka;
-void check_index(char *gname, int n, int index[],
- char *traj, int natoms);
+void check_index(const char *gname, int n, int index[],
+ const char *traj, int natoms);
/* Checks if any index is smaller than zero or larger than natoms,
* if so a fatal_error is given with the gname (if gname=NULL, "Index" is used)
* and traj (if traj=NULL, "the trajectory" is used).
void write_index(const char *outf, struct t_blocka *b, char **gnames, gmx_bool bDuplicate, int natoms);
/* Writes index blocks to outf (writes an indexfile) */
-void add_grp(struct t_blocka *b, char ***gnames, int nra, int a[], const char *name);
+void add_grp(struct t_blocka *b, char ***gnames, int nra, const int a[], const char *name);
/* Ads group a with name name to block b and namelist gnames */
void analyse(const t_atoms *atoms, struct t_blocka *gb, char ***gn,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2006, The GROMACS development team.
- * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, 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.
/*! \brief
* Plots the surface into a PDB file, optionally including the original atoms.
*/
-void connolly_plot(const char *fn, int ndots, real dots[], rvec x[], t_atoms *atoms,
+void connolly_plot(const char *fn, int ndots, const real dots[], rvec x[], t_atoms *atoms,
t_symtab *symtab, int ePBC, const matrix box, gmx_bool bIncludeSolute)
{
const char *const atomnm = "DOT";