From 6ec27d359e4e912b56ed377d9cefe25bf8789ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 6 Jun 2016 14:41:33 +0200 Subject: [PATCH] fix furthest orthogonal incremental neighbor previously the current distance was always larger than the initial one. As a result no branch of the tree could be filtered out and all the nodes were visited. --- .../include/CGAL/Orthogonal_incremental_neighbor_search.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Spatial_searching/include/CGAL/Orthogonal_incremental_neighbor_search.h b/Spatial_searching/include/CGAL/Orthogonal_incremental_neighbor_search.h index 932265f82ce..13eca80ece1 100644 --- a/Spatial_searching/include/CGAL/Orthogonal_incremental_neighbor_search.h +++ b/Spatial_searching/include/CGAL/Orthogonal_incremental_neighbor_search.h @@ -174,7 +174,7 @@ namespace CGAL { else{ distance_to_root= Orthogonal_distance_instance.max_distance_to_rectangle(q, - tree.bounding_box()); + tree.bounding_box(), dists); Node_with_distance *The_Root = new Node_with_distance(tree.root(), distance_to_root, dists); PriorityQueue.push(The_Root); @@ -372,10 +372,9 @@ namespace CGAL { FT diff1 = val - node->upper_low_value(); FT diff2 = val - node->lower_high_value(); if (diff1 + diff2 < FT(0.0)) { + diff1 = val - node->upper_high_value(); new_rd= Orthogonal_distance_instance.new_distance(copy_rd,dst,diff1,new_cut_dim); - - CGAL_assertion(new_rd >= copy_rd); Node_with_distance *Lower_Child = new Node_with_distance(node->lower(), copy_rd, dists); PriorityQueue.push(Lower_Child); @@ -385,8 +384,8 @@ namespace CGAL { } else { // compute new distance + diff2 = val - node->lower_low_value(); new_rd=Orthogonal_distance_instance.new_distance(copy_rd,dst,diff2,new_cut_dim); - CGAL_assertion(new_rd >= copy_rd); Node_with_distance *Upper_Child = new Node_with_distance(node->upper(), copy_rd, dists); PriorityQueue.push(Upper_Child);