summaryrefslogtreecommitdiff
path: root/src/Subsampling
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2020-11-22 23:37:18 +0100
committerMarc Glisse <marc.glisse@inria.fr>2020-11-22 23:37:18 +0100
commit4a34c0b7b8be8b8e275b13823da31127bbd5f3b2 (patch)
treec29da51473d20f6e39e04dd713c5c29a0e5174a3 /src/Subsampling
parent0a071114ad08d2ce149f8b484dd8ff1b96b61fb1 (diff)
Handle squared radius
Make it work without a breaking change, we can always make a change later in a separate PR.
Diffstat (limited to 'src/Subsampling')
-rw-r--r--src/Subsampling/include/gudhi/pick_n_random_points.h4
-rw-r--r--src/Subsampling/include/gudhi/sparsify_point_set.h3
2 files changed, 4 insertions, 3 deletions
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 <gudhi/Clock.h>
+#ifdef GUDHI_SUBSAMPLING_PROFILING
+# include <gudhi/Clock.h>
+#endif
#include <boost/range/size.hpp>
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