From 4a34c0b7b8be8b8e275b13823da31127bbd5f3b2 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sun, 22 Nov 2020 23:37:18 +0100 Subject: Handle squared radius Make it work without a breaking change, we can always make a change later in a separate PR. --- src/Subsampling/include/gudhi/pick_n_random_points.h | 4 +++- src/Subsampling/include/gudhi/sparsify_point_set.h | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Subsampling') diff --git a/src/Subsampling/include/gudhi/pick_n_random_points.h b/src/Subsampling/include/gudhi/pick_n_random_points.h index c2c71f83..e4246c29 100644 --- a/src/Subsampling/include/gudhi/pick_n_random_points.h +++ b/src/Subsampling/include/gudhi/pick_n_random_points.h @@ -11,7 +11,9 @@ #ifndef PICK_N_RANDOM_POINTS_H_ #define PICK_N_RANDOM_POINTS_H_ -#include +#ifdef GUDHI_SUBSAMPLING_PROFILING +# include +#endif #include diff --git a/src/Subsampling/include/gudhi/sparsify_point_set.h b/src/Subsampling/include/gudhi/sparsify_point_set.h index afa6d45a..71e8917b 100644 --- a/src/Subsampling/include/gudhi/sparsify_point_set.h +++ b/src/Subsampling/include/gudhi/sparsify_point_set.h @@ -74,8 +74,7 @@ sparsify_point_set( // If another point Q is closer that min_squared_dist, mark Q to be dropped auto drop = [&dropped_points] (std::ptrdiff_t neighbor_point_idx) { dropped_points[neighbor_point_idx] = true; }; - // FIXME: what if FT does not support sqrt? - points_ds.all_near_neighbors(pt, sqrt(min_squared_dist), boost::make_function_output_iterator(std::ref(drop))); + points_ds.all_near_neighbors2(pt, min_squared_dist, min_squared_dist, boost::make_function_output_iterator(std::ref(drop))); } #ifdef GUDHI_SUBSAMPLING_PROFILING -- cgit v1.2.3