*
* 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,2017, 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.
z1 = x1[a[index[i-1]+j]][axis];
z2 = x1[a[index[i+1]+j]][axis];
z_ave = 0.5 * (z1 + z2);
- if (z_ave < 0)
+ slice = (int)((nslices*z_ave)/box[axis][axis]);
+ while (slice < 0)
{
- z_ave += box[axis][axis];
- }
- if (z_ave > box[axis][axis])
- {
- z_ave -= box[axis][axis];
+ slice += nslices;
}
+ slice = slice % nslices;
- slice = (int)(0.5 + (z_ave / (*slWidth))) - 1;
slCount[slice]++; /* determine slice, increase count */
slFrameorder[slice] += 0.5 * (3 * cossum[axis] - 1);