From 97ee612693818558e9ba8a56f5442ebd3e97b2e9 Mon Sep 17 00:00:00 2001 From: Doug Shi-Dong Date: Thu, 26 Sep 2019 00:31:07 -0400 Subject: [PATCH] Fix Manifold get_new_point() The weights can be negative, we simply want to avoid dividing by 0. --- source/grid/manifold.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 3f4a1217ce..5072c095af 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -95,7 +95,7 @@ Manifold::get_new_point( for (unsigned int i = 1; i < n_points; ++i) { double weight = 0.0; - if ((weights[permutation[i]] + w) < tol) + if (std::abs(weights[permutation[i]] + w) < tol) weight = 0.0; else weight = w / (weights[permutation[i]] + w); -- 2.39.5