summaryrefslogtreecommitdiff
path: root/src/Witness_complex/example/witness_complex_sphere.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Witness_complex/example/witness_complex_sphere.cpp')
-rw-r--r--src/Witness_complex/example/witness_complex_sphere.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp
index b26c9f36..7ab86cc0 100644
--- a/src/Witness_complex/example/witness_complex_sphere.cpp
+++ b/src/Witness_complex/example/witness_complex_sphere.cpp
@@ -27,7 +27,8 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Witness_complex.h>
-#include <gudhi/Landmark_choice_by_random_point.h>
+#include <gudhi/Construct_closest_landmark_table.h>
+#include <gudhi/pick_n_random_points.h>
#include <gudhi/reader_utils.h>
#include <iostream>
@@ -39,6 +40,8 @@
#include "generators.h"
+typedef Gudhi::Simplex_tree<> Simplex_tree;
+
/** Write a gnuplot readable file.
* Data range is a random access range of pairs (arg, value)
*/
@@ -61,13 +64,13 @@ int main(int argc, char * const argv[]) {
clock_t start, end;
// Construct the Simplex Tree
- Gudhi::Simplex_tree<> simplex_tree;
+ Simplex_tree simplex_tree;
std::vector< std::pair<int, double> > l_time;
// Read the point file
for (int nbP = 500; nbP < 10000; nbP += 500) {
- Point_Vector point_vector;
+ Point_Vector point_vector, landmarks;
generate_points_sphere(point_vector, nbP, 4);
std::cout << "Successfully generated " << point_vector.size() << " points.\n";
std::cout << "Ambient dimension is " << point_vector[0].size() << ".\n";
@@ -75,7 +78,8 @@ int main(int argc, char * const argv[]) {
// Choose landmarks
start = clock();
std::vector<std::vector< int > > knn;
- Gudhi::witness_complex::landmark_choice_by_random_point(point_vector, number_of_landmarks, knn);
+ Gudhi::subsampling::pick_n_random_points(point_vector, 100, std::back_inserter(landmarks));
+ Gudhi::witness_complex::construct_closest_landmark_table<Simplex_tree::Filtration_value>(point_vector, landmarks, knn);
// Compute witness complex
Gudhi::witness_complex::witness_complex(knn, number_of_landmarks, point_vector[0].size(), simplex_tree);