#include "gromacs/legacyheaders/calcgrid.h"
-#include <math.h>
+#include <cmath>
+
+#include <algorithm>
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/utility/fatalerror.h"
{
box_size[d] += box[d][i]*box[d][i];
}
- box_size[d] = sqrt(box_size[d]);
+ box_size[d] = std::sqrt(box_size[d]);
}
n[XX] = *nx;
{
if (n[d] <= 0)
{
- nmin = (int)(box_size[d]/gr_sp + 0.999);
+ nmin = static_cast<int>(box_size[d]/gr_sp + 0.999);
i = g_initNR - 1;
if (grid_init[i] >= nmin)
}
}
- spacing[d] = box_size[d]/n[d];
- if (spacing[d] > max_spacing)
- {
- max_spacing = spacing[d];
- }
+ spacing[d] = box_size[d]/n[d];
+ max_spacing = std::max(max_spacing, spacing[d]);
}
*nx = n[XX];
*ny = n[YY];