From cf62cd62c2d41df632499ce8a758ba4a53d24a7c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 25 Nov 2003 23:06:28 +0000 Subject: [PATCH] distance_instance no longer created on the heap --- .../CGAL/Orthogonal_k_neighbor_search.h | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Packages/Spatial_searching/include/CGAL/Orthogonal_k_neighbor_search.h b/Packages/Spatial_searching/include/CGAL/Orthogonal_k_neighbor_search.h index 02792655405..65857911a2c 100644 --- a/Packages/Spatial_searching/include/CGAL/Orthogonal_k_neighbor_search.h +++ b/Packages/Spatial_searching/include/CGAL/Orthogonal_k_neighbor_search.h @@ -78,7 +78,7 @@ int max_k; int actual_k; -Distance* distance_instance; +Distance distance_instance; inline bool branch(FT distance) { if (actual_k - new_distance(rd,old_off,new_off,new_cut_dim); + distance_instance.new_distance(rd,old_off, + new_off, + new_cut_dim); if (branch(new_rd)) compute_neighbors_orthogonally(N->upper(), new_rd); @@ -235,8 +234,9 @@ Distance* distance_instance; if (old_off - new_distance(rd,old_off,new_off,new_cut_dim); + distance_instance. new_distance(rd,old_off, + new_off, + new_cut_dim); if (branch(new_rd)) compute_neighbors_orthogonally(N->lower(), new_rd); @@ -250,8 +250,7 @@ Distance* distance_instance; for (Point_d_iterator it=N->begin(); it != N->end(); it++) { number_of_items_visited++; FT distance_to_query_object= - distance_instance-> - transformed_distance(query_object,**it); + distance_instance.transformed_distance(query_object,**it); insert(*it,distance_to_query_object); } }