From 3e2c4df7d6ac217f09d3aff6d238e71de8229e5b Mon Sep 17 00:00:00 2001 From: fgodi Date: Mon, 5 Dec 2016 15:42:42 +0000 Subject: review prise en compte git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1821 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 4c24c2bebc49c70d0502ffdb1f23e451d17a3b88 --- src/Bottleneck_distance/include/gudhi/Neighbors_finder.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Bottleneck_distance/include/gudhi/Neighbors_finder.h') diff --git a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h index 90ddabef..e6acafc6 100644 --- a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h +++ b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h @@ -26,7 +26,7 @@ // Inclusion order is important for CGAL patch #include "CGAL/Kd_tree_node.h" #include "CGAL/Kd_tree.h" -#include "CGAL/Orthogonal_incremental_neighbor_search.h" +#include "CGAL/Orthogonal_k_neighbor_search.h" #include #include @@ -50,9 +50,9 @@ namespace bottleneck_distance { class Neighbors_finder { typedef CGAL::Dimension_tag<2> D; - typedef CGAL::Search_traits Traits; + typedef CGAL::Search_traits Traits; typedef CGAL::Weighted_Minkowski_distance Distance; - typedef CGAL::Orthogonal_incremental_neighbor_search K_neighbor_search; + typedef CGAL::Orthogonal_k_neighbor_search K_neighbor_search; typedef K_neighbor_search::Tree Kd_tree; public: @@ -93,7 +93,7 @@ public: private: const Persistence_graph& g; const double r; - std::vector> neighbors_finder; + std::vector> neighbors_finder; }; inline Neighbors_finder::Neighbors_finder(const Persistence_graph& g, double r) : @@ -123,7 +123,7 @@ inline int Neighbors_finder::pull_near(int u_point_index) { //Is the query point near to a V point in the plane ? Internal_point u_point = g.get_u_point(u_point_index); std::array w = { {1., 1.} }; - K_neighbor_search search(kd_t, u_point, 0., true, Distance(0, 2, w.begin(), w.end())); + K_neighbor_search search(kd_t, u_point, 1, 0., true, Distance(0, 2, w.begin(), w.end())); auto it = search.begin(); if(it==search.end() || g.distance(u_point_index, it->first.point_index) > r) return null_point_index(); @@ -148,7 +148,7 @@ inline Layered_neighbors_finder::Layered_neighbors_finder(const Persistence_grap inline void Layered_neighbors_finder::add(int v_point_index, int vlayer) { for (int l = neighbors_finder.size(); l <= vlayer; l++) - neighbors_finder.emplace_back(std::shared_ptr(new Neighbors_finder(g, r))); + neighbors_finder.emplace_back(std::unique_ptr(new Neighbors_finder(g, r))); neighbors_finder.at(vlayer)->add(v_point_index); } -- cgit v1.2.3