diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2020-12-10 23:36:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-10 23:36:58 +0100 |
commit | 10794c300e349fef918b9b8e91d4c2aee7a01890 (patch) | |
tree | 1ccbbaa9b31c98d4921f2745eb88ae45f9d43aef /src/python/include/Subsampling_interface.h | |
parent | d1b7c8fd3e66c19203967d559582af713417aeca (diff) | |
parent | a2783dd8db753a407cfad329d03e2a56b2095f3d (diff) |
Merge pull request #409 from mglisse/fardist
Pass a distance function instead of a kernel to choose_n_farthest_points
Diffstat (limited to 'src/python/include/Subsampling_interface.h')
-rw-r--r-- | src/python/include/Subsampling_interface.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/python/include/Subsampling_interface.h b/src/python/include/Subsampling_interface.h index cdda851f..6aee7231 100644 --- a/src/python/include/Subsampling_interface.h +++ b/src/python/include/Subsampling_interface.h @@ -11,6 +11,7 @@ #ifndef INCLUDE_SUBSAMPLING_INTERFACE_H_ #define INCLUDE_SUBSAMPLING_INTERFACE_H_ +#include <gudhi/distance_functions.h> #include <gudhi/choose_n_farthest_points.h> #include <gudhi/pick_n_random_points.h> #include <gudhi/sparsify_point_set.h> @@ -27,14 +28,13 @@ namespace subsampling { using Subsampling_dynamic_kernel = CGAL::Epick_d< CGAL::Dynamic_dimension_tag >; using Subsampling_point_d = Subsampling_dynamic_kernel::Point_d; -using Subsampling_ft = Subsampling_dynamic_kernel::FT; // ------ choose_n_farthest_points ------ std::vector<std::vector<double>> subsampling_n_farthest_points(const std::vector<std::vector<double>>& points, unsigned nb_points) { std::vector<std::vector<double>> landmarks; - Subsampling_dynamic_kernel k; - choose_n_farthest_points(k, points, nb_points, random_starting_point, std::back_inserter(landmarks)); + choose_n_farthest_points(Euclidean_distance(), points, nb_points, + random_starting_point, std::back_inserter(landmarks)); return landmarks; } @@ -42,8 +42,8 @@ std::vector<std::vector<double>> subsampling_n_farthest_points(const std::vector std::vector<std::vector<double>> subsampling_n_farthest_points(const std::vector<std::vector<double>>& points, unsigned nb_points, unsigned starting_point) { std::vector<std::vector<double>> landmarks; - Subsampling_dynamic_kernel k; - choose_n_farthest_points(k, points, nb_points, starting_point, std::back_inserter(landmarks)); + choose_n_farthest_points(Euclidean_distance(), points, nb_points, + starting_point, std::back_inserter(landmarks)); return landmarks; } |