biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into pygromacs
[alexxy/gromacs.git]
/
src
/
gromacs
/
gmxlib
/
calcgrid.cpp
diff --git
a/src/gromacs/gmxlib/calcgrid.cpp
b/src/gromacs/gmxlib/calcgrid.cpp
index 80da0e1a396ae58606c4d38242c81ed5cadfe1d2..b1e7aa8e073d9e9d34f08db0806c5b4f9a4e062e 100644
(file)
--- a/
src/gromacs/gmxlib/calcgrid.cpp
+++ b/
src/gromacs/gmxlib/calcgrid.cpp
@@
-38,7
+38,9
@@
#include "gromacs/legacyheaders/calcgrid.h"
#include "gromacs/legacyheaders/calcgrid.h"
-#include <math.h>
+#include <cmath>
+
+#include <algorithm>
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/utility/fatalerror.h"
@@
-98,7
+100,7
@@
real calc_grid(FILE *fp, matrix box, real gr_sp,
{
box_size[d] += box[d][i]*box[d][i];
}
{
box_size[d] += box[d][i]*box[d][i];
}
- box_size[d] = sqrt(box_size[d]);
+ box_size[d] = s
td::s
qrt(box_size[d]);
}
n[XX] = *nx;
}
n[XX] = *nx;
@@
-119,7
+121,7
@@
real calc_grid(FILE *fp, matrix box, real gr_sp,
{
if (n[d] <= 0)
{
{
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)
i = g_initNR - 1;
if (grid_init[i] >= nmin)
@@
-156,11
+158,8
@@
real calc_grid(FILE *fp, matrix box, real gr_sp,
}
}
}
}
- 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];
}
*nx = n[XX];
*ny = n[YY];