Skip to content

Commit 596ecfb

Browse files
committed
try fixing floating point exceptions test error
1 parent 46a8d62 commit 596ecfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/colvargrid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ class colvar_grid_gradient : public colvar_grid<cvm::real>
16121612
std::vector<int> bin(nd, 0);
16131613
// We process points where exp(-d^2 / 2sigma^2) > 10^-3
16141614
// This implies distance < 3.72 * sigma
1615-
cvm::real inv_squared_smooth = 1/ (smoothing*smoothing);
1615+
cvm::real inv_squared_smooth = 1/ (std::min(smoothing*smoothing, 1e-5));
16161616
cvm::real const cutoff_factor = 3.72;
16171617
// TODO: make sure that this is not > min nx /2
16181618
cvm::real const cutoff = cutoff_factor * smoothing; // take like floor()

0 commit comments

Comments
 (0)