created local copy of point before using Cartesian_ranges

This commit is contained in:
Sven Oesau 2024-03-01 17:29:17 +01:00
parent fcbb9221f8
commit 130cf57758
1 changed files with 3 additions and 1 deletions

View File

@ -1366,7 +1366,9 @@ private: // functions :
auto child_node = child(node, i); auto child_node = child(node, i);
FT squared_distance = 0; FT squared_distance = 0;
for (const auto& r : cartesian_range(m_traits.construct_center_d_object()(search_bounds), barycenter(child_node))) { Point c = m_traits.construct_center_d_object()(search_bounds);
Point b = barycenter(child_node);
for (const auto r : cartesian_range(c, b)) {
FT d = (get<0>(r) - get<1>(r)); FT d = (get<0>(r) - get<1>(r));
squared_distance += d * d; squared_distance += d * d;
} }