summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-05 15:42:42 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-12-05 15:42:42 +0000
commit3e2c4df7d6ac217f09d3aff6d238e71de8229e5b (patch)
tree14fb2bd9bcfcd32bf5d115e2a1b1c9b697bdffe3 /src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
parent6d1bfe69ea473088eb2ca3ede626a2accaa58205 (diff)
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
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Neighbors_finder.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Neighbors_finder.h12
1 files changed, 6 insertions, 6 deletions
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 <CGAL/Weighted_Minkowski_distance.h>
#include <CGAL/Search_traits.h>
@@ -50,9 +50,9 @@ namespace bottleneck_distance {
class Neighbors_finder {
typedef CGAL::Dimension_tag<2> D;
- typedef CGAL::Search_traits<double, Internal_point, const double*, CGAL::Construct_coord_iterator, D> Traits;
+ typedef CGAL::Search_traits<double, Internal_point, const double*, Construct_coord_iterator, D> Traits;
typedef CGAL::Weighted_Minkowski_distance<Traits> Distance;
- typedef CGAL::Orthogonal_incremental_neighbor_search<Traits, Distance> K_neighbor_search;
+ typedef CGAL::Orthogonal_k_neighbor_search<Traits, Distance> 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<std::shared_ptr<Neighbors_finder>> neighbors_finder;
+ std::vector<std::unique_ptr<Neighbors_finder>> 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<double, 2> 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<Neighbors_finder>(new Neighbors_finder(g, r)));
+ neighbors_finder.emplace_back(std::unique_ptr<Neighbors_finder>(new Neighbors_finder(g, r)));
neighbors_finder.at(vlayer)->add(v_point_index);
}