We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46a8d62 commit 596ecfbCopy full SHA for 596ecfb
src/colvargrid.h
@@ -1612,7 +1612,7 @@ class colvar_grid_gradient : public colvar_grid<cvm::real>
1612
std::vector<int> bin(nd, 0);
1613
// We process points where exp(-d^2 / 2sigma^2) > 10^-3
1614
// This implies distance < 3.72 * sigma
1615
- cvm::real inv_squared_smooth = 1/ (smoothing*smoothing);
+ cvm::real inv_squared_smooth = 1/ (std::min(smoothing*smoothing, 1e-5));
1616
cvm::real const cutoff_factor = 3.72;
1617
// TODO: make sure that this is not > min nx /2
1618
cvm::real const cutoff = cutoff_factor * smoothing; // take like floor()
0 commit comments