diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-03-20 13:44:20 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2017-03-20 13:44:20 +0000 |
commit | 10411aae9845d28d36a9d4394bd668ed84d540f1 (patch) | |
tree | 0d62f001377fa6b7c8a75adac0818ad1790d8302 /src/cython/include/Subsampling_interface.h | |
parent | 948341a6bf6e9ee8b5e61ae0e2b9ce6452751b76 (diff) |
constify interfaces
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2203 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 55cf020d2a7989dc4e7125bcf6f91443aad4dda1
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); |