diff options
author | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-02-02 14:49:56 +0000 |
---|---|---|
committer | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-02-02 14:49:56 +0000 |
commit | 7e667b71d937f83b82240afbf90b8cde7225eb8a (patch) | |
tree | 6e816ab5a2a9290a365fb9f52e2418d4c94d142c /src/Witness_complex/include/gudhi | |
parent | db2c9248e50cd4eb91ec39802a2b2bce9565030d (diff) |
landmark choice functions are now static
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@994 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: f83d337feab944e2c823b8e127f1a8d612d0a1bd
Diffstat (limited to 'src/Witness_complex/include/gudhi')
-rw-r--r-- | src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h | 22 | ||||
-rw-r--r-- | src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h | 23 |
2 files changed, 11 insertions, 34 deletions
diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h index bb7e87f5..47cd888d 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h @@ -31,20 +31,9 @@ namespace Gudhi { namespace witness_complex { -/** - * \class Landmark_choice_by_furthest_point - * \brief The class `Landmark_choice_by_furthest_point` allows to construct the matrix - * of closest landmarks per witness by iteratively choosing the furthest witness - * from the set of already chosen landmarks as the new landmark. - * \ingroup witness_complex - */ - -class Landmark_choice_by_furthest_point { - private: - typedef std::vector<int> typeVectorVertex; + typedef std::vector<int> typeVectorVertex; - public: - /** + /** * \brief Landmark choice strategy by iteratively adding the furthest witness from the * current landmark set as the new landmark. * \details It chooses nbL landmarks from a random access range `points` and @@ -53,9 +42,9 @@ class Landmark_choice_by_furthest_point { template <typename KNearestNeighbours, typename Point_random_access_range> - Landmark_choice_by_furthest_point(Point_random_access_range const &points, - int nbL, - KNearestNeighbours &knn) { + void landmark_choice_by_furthest_point(Point_random_access_range const &points, + int nbL, + KNearestNeighbours &knn) { int nb_points = points.end() - points.begin(); assert(nb_points >= nbL); // distance matrix witness x landmarks @@ -98,7 +87,6 @@ class Landmark_choice_by_furthest_point { [&wit_land_dist, i](int a, int b) { return wit_land_dist[i][a] < wit_land_dist[i][b]; }); } -}; } // namespace witness_complex 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 4747dd73..dc364007 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 @@ -32,26 +32,16 @@ namespace Gudhi { namespace witness_complex { -/** - * \class Landmark_choice_by_random_point - * \brief The class `Landmark_choice_by_random_point` allows to construct the matrix - * of closest landmarks per witness by iteratively choosing a random non-chosen witness - * as a new landmark. - * \ingroup witness_complex - */ - -class Landmark_choice_by_random_point { - public: /** \brief Landmark choice strategy by taking random vertices for landmarks. * \details It chooses nbL distinct landmarks from a random access range `points` * and outputs a matrix {witness}*{closest landmarks} in knn. */ template <typename KNearestNeighbours, - typename Point_random_access_range> - Landmark_choice_by_random_point(Point_random_access_range const &points, - int nbL, - KNearestNeighbours &knn) { + typename Point_random_access_range> + void landmark_choice_by_random_point(Point_random_access_range const &points, + int nbL, + KNearestNeighbours &knn) { int nbP = points.end() - points.begin(); assert(nbP >= nbL); std::set<int> landmarks; @@ -71,8 +61,8 @@ class Landmark_choice_by_random_point { knn = KNearestNeighbours(nbP); for (int points_i = 0; points_i < nbP; points_i++) { std::priority_queue<dist_i, std::vector<dist_i>, comp> l_heap([&](dist_i j1, dist_i j2) { - return j1.first > j2.first; - }); + return j1.first > j2.first; + }); std::set<int>::iterator landmarks_it; int landmarks_i = 0; for (landmarks_it = landmarks.begin(), landmarks_i = 0; landmarks_it != landmarks.end(); @@ -87,7 +77,6 @@ class Landmark_choice_by_random_point { } } } -}; } // namespace witness_complex |