*
* 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.
rvec x_s[], /* Coords before update */
rvec prime[], /* Output coords */
t_nrnb *nrnb, /* Performance measure */
- real *lagr, /* The Lagrange multipliers */
+ real * const lagr, /* The Lagrange multipliers */
real lambda, /* FEP lambda */
real *dvdlambda, /* FEP force */
real invdt, /* 1/delta_t */
*
* 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.
gmx_bool bshakef(FILE *log, gmx_shakedata_t shaked,
real invmass[], int nblocks, int sblock[],
t_idef *idef, t_inputrec *ir, rvec x_s[], rvec prime[],
- t_nrnb *nrnb, real *scaled_lagrange_multiplier, real lambda, real *dvdlambda,
+ t_nrnb *nrnb, real * const scaled_lagrange_multiplier, real lambda, real *dvdlambda,
real invdt, rvec *v, gmx_bool bCalcVir, tensor vir_r_m_dr,
gmx_bool bDumpOnError, int econq)
{
t_iatom *iatoms;
- real dt_2, dvdl;
+ real *lam, dt_2, dvdl;
int i, n0, ncon, blen, type, ll;
int tnit = 0, trij = 0;
scaled_lagrange_multiplier[ll] = 0;
}
+ // TODO Rewrite this block so that it is obvious that i, iatoms
+ // and lam are all iteration variables. Is this easier if the
+ // sblock data structure is organized differently?
iatoms = &(idef->il[F_CONSTR].iatoms[sblock[0]]);
+ lam = scaled_lagrange_multiplier;
for (i = 0; (i < nblocks); )
{
blen = (sblock[i+1]-sblock[i]);
tnit += n0*blen;
trij += blen;
iatoms += 3*blen; /* Increment pointer! */
- scaled_lagrange_multiplier += blen;
+ lam += blen;
i++;
}
/* only for position part? */