diff options
Diffstat (limited to 'src/cython/include/Subsampling_interface.h')
-rw-r--r-- | src/cython/include/Subsampling_interface.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/cython/include/Subsampling_interface.h b/src/cython/include/Subsampling_interface.h index fb047441..5fc16767 100644 --- a/src/cython/include/Subsampling_interface.h +++ b/src/cython/include/Subsampling_interface.h @@ -42,7 +42,8 @@ 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(std::vector<std::vector<double>>& points, unsigned nb_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, std::back_inserter(landmarks)); @@ -50,7 +51,8 @@ std::vector<std::vector<double>> subsampling_n_farthest_points(std::vector<std:: return landmarks; } -std::vector<std::vector<double>> subsampling_n_farthest_points(std::vector<std::vector<double>>& points, unsigned nb_points, unsigned starting_point) { +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)); @@ -58,34 +60,39 @@ std::vector<std::vector<double>> subsampling_n_farthest_points(std::vector<std:: return landmarks; } -std::vector<std::vector<double>> subsampling_n_farthest_points_from_file(std::string& off_file, unsigned nb_points) { +std::vector<std::vector<double>> subsampling_n_farthest_points_from_file(const std::string& off_file, + unsigned nb_points) { Gudhi::Points_off_reader<std::vector<double>> off_reader(off_file); std::vector<std::vector<double>> points = off_reader.get_point_cloud(); return subsampling_n_farthest_points(points, nb_points); } -std::vector<std::vector<double>> subsampling_n_farthest_points_from_file(std::string& off_file, unsigned nb_points, unsigned starting_point) { +std::vector<std::vector<double>> subsampling_n_farthest_points_from_file(const std::string& off_file, + unsigned nb_points, unsigned starting_point) { Gudhi::Points_off_reader<std::vector<double>> off_reader(off_file); std::vector<std::vector<double>> points = off_reader.get_point_cloud(); return subsampling_n_farthest_points(points, nb_points, starting_point); } // ------ pick_n_random_points ------ -std::vector<std::vector<double>> subsampling_n_random_points(std::vector<std::vector<double>>& points, unsigned nb_points) { +std::vector<std::vector<double>> subsampling_n_random_points(const std::vector<std::vector<double>>& points, + unsigned nb_points) { std::vector<std::vector<double>> landmarks; pick_n_random_points(points, nb_points, std::back_inserter(landmarks)); return landmarks; } -std::vector<std::vector<double>> subsampling_n_random_points_from_file(std::string& off_file, unsigned nb_points) { +std::vector<std::vector<double>> subsampling_n_random_points_from_file(const std::string& off_file, + unsigned nb_points) { Gudhi::Points_off_reader<std::vector<double>> off_reader(off_file); std::vector<std::vector<double>> points = off_reader.get_point_cloud(); return subsampling_n_random_points(points, nb_points); } // ------ sparsify_point_set ------ -std::vector<std::vector<double>> subsampling_sparsify_points(std::vector<std::vector<double>>& points, double min_squared_dist) { +std::vector<std::vector<double>> subsampling_sparsify_points(const std::vector<std::vector<double>>& points, + double min_squared_dist) { std::vector<Subsampling_point_d> input, output; for (auto point : points) input.push_back(Subsampling_point_d(point.size(), point.begin(), point.end())); @@ -98,7 +105,8 @@ std::vector<std::vector<double>> subsampling_sparsify_points(std::vector<std::ve return landmarks; } -std::vector<std::vector<double>> subsampling_sparsify_points_from_file(std::string& off_file, double min_squared_dist) { +std::vector<std::vector<double>> subsampling_sparsify_points_from_file(const std::string& off_file, + double min_squared_dist) { Gudhi::Points_off_reader<std::vector<double>> off_reader(off_file); std::vector<std::vector<double>> points = off_reader.get_point_cloud(); return subsampling_sparsify_points(points, min_squared_dist); |