-void cshake(atom_id iatom[], int ncon, int *nnit, int maxnit,
- real dist2[], real xp[], real rij[], real m2[], real omega,
- real invmass[], real tt[], real lagr[], int *nerror)
+/*! \brief Inner kernel for SHAKE constraints
+ *
+ * Original implementation from R.C. van Schaik and W.F. van Gunsteren
+ * (ETH Zuerich, June 1992), adapted for GROMACS by David van der
+ * Spoel November 1992.
+ *
+ * The algorithm here is based section five of Ryckaert, Ciccotti and
+ * Berendsen, J Comp Phys, 23, 327, 1977.
+ *
+ * \param[in] iatom Mini-topology of triples of constraint type (unused in this
+ * function) and indices of the two atoms involved
+ * \param[in] ncon Number of constraints
+ * \param[out] nnit Number of iterations performed
+ * \param[in] maxnit Maximum number of iterations permitted
+ * \param[in] constraint_distance_squared The objective value for each constraint
+ * \param[inout] positions The initial (and final) values of the positions of all atoms
+ * \param[in] initial_displacements The initial displacements of each constraint
+ * \param[in] half_of_reduced_mass Half of the reduced mass for each constraint
+ * \param[in] omega SHAKE over-relaxation factor (set non-1.0 by
+ * using shake-sor=yes in the .mdp, but there is no documentation anywhere)
+ * \param[in] invmass Inverse mass of each atom
+ * \param[in] distance_squared_tolerance Multiplicative tolerance on the difference in the
+ * square of the constrained distance (see code)
+ * \param[out] scaled_lagrange_multiplier Scaled Lagrange multiplier for each constraint (-2 * eta from p. 336
+ * of the paper, divided by the constraint distance)
+ * \param[out] nerror Zero upon success, returns one more than the index of the
+ * problematic constraint if the input was malformed
+ *
+ * \todo Make SHAKE use better data structures, in particular for iatom. */
+void cshake(const atom_id iatom[], int ncon, int *nnit, int maxnit,
+ const real constraint_distance_squared[], real positions[],
+ const real initial_displacements[], const real half_of_reduced_mass[], real omega,
+ const real invmass[], const real distance_squared_tolerance[],
+ real scaled_lagrange_multiplier[], int *nerror)