diff options
author | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-03-20 13:04:38 +0000 |
---|---|---|
committer | glisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-03-20 13:04:38 +0000 |
commit | c19dafdee66ca80c5bf5e71129d9cca9b9243c92 (patch) | |
tree | 2fcd7eda4e7cf8af89aac147e02d188787ec2962 /src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h | |
parent | 8feab25e21b6f8f5702c035be6aadc63d7c9b422 (diff) |
Let the witness code match its doc better.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1057 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 99dc557a03f1ea85730ce286b80e384257ab2a77
Diffstat (limited to 'src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h')
-rw-r--r-- | src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h index a73c04ac..ebf6aad1 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h @@ -23,8 +23,11 @@ #ifndef LANDMARK_CHOICE_BY_RANDOM_POINT_H_ #define LANDMARK_CHOICE_BY_RANDOM_POINT_H_ +#include <boost/range/size.hpp> + #include <queue> // for priority_queue<> #include <utility> // for pair<> +#include <iterator> #include <vector> #include <set> @@ -50,7 +53,7 @@ namespace witness_complex { void landmark_choice_by_random_point(Point_random_access_range const &points, int nbL, KNearestNeighbours &knn) { - int nbP = points.end() - points.begin(); + int nbP = boost::size(points); assert(nbP >= nbL); std::set<int> landmarks; int current_number_of_landmarks = 0; // counter for landmarks @@ -63,7 +66,7 @@ namespace witness_complex { landmarks.insert(chosen_landmark); } - int dim = points.begin()->size(); + int dim = boost::size(*std::begin(points)); typedef std::pair<double, int> dist_i; typedef bool (*comp)(dist_i, dist_i); knn = KNearestNeighbours(nbP); |