summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-02 15:14:17 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-02 15:14:17 +0000
commit1f07634127072d447b22c4d5edaec95577f792e4 (patch)
tree8eb454537bf73d00571f2c3f4aa50efc51ba796e /src
parentead71ec7ab6f5b1d23a0102289530d5f99572fe0 (diff)
Changed the examples in witness complex package
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1239 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1ab3b8e4b99d52e749fe5ec67d41283be4258e81
Diffstat (limited to 'src')
-rw-r--r--src/Witness_complex/example/witness_complex_from_file.cpp6
-rw-r--r--src/Witness_complex/example/witness_complex_sphere.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/Witness_complex/example/witness_complex_from_file.cpp b/src/Witness_complex/example/witness_complex_from_file.cpp
index 53207ad2..fbc3cf1d 100644
--- a/src/Witness_complex/example/witness_complex_from_file.cpp
+++ b/src/Witness_complex/example/witness_complex_from_file.cpp
@@ -25,6 +25,7 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Witness_complex.h>
+#include <gudhi/Construct_closest_landmark_table.h>
#include <gudhi/Landmark_choice_by_random_point.h>
#include <gudhi/reader_utils.h>
@@ -78,7 +79,7 @@ int main(int argc, char * const argv[]) {
Gudhi::Simplex_tree<> simplex_tree;
// Read the point file
- Point_Vector point_vector;
+ Point_Vector point_vector, landmarks;
read_points_cust(file_name, point_vector);
std::cout << "Successfully read " << point_vector.size() << " points.\n";
std::cout << "Ambient dimension is " << point_vector[0].size() << ".\n";
@@ -86,7 +87,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, nbL, knn);
+ Gudhi::landmark_choice_by_random_point(point_vector, 100, std::back_inserter(landmarks));
+ Gudhi::witness_complex::construct_closest_landmark_table(point_vector, landmarks, knn);
end = clock();
std::cout << "Landmark choice for " << nbL << " landmarks took "
<< static_cast<double>(end - start) / CLOCKS_PER_SEC << " s. \n";
diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp
index b26c9f36..9cf2f119 100644
--- a/src/Witness_complex/example/witness_complex_sphere.cpp
+++ b/src/Witness_complex/example/witness_complex_sphere.cpp
@@ -27,6 +27,7 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Witness_complex.h>
+#include <gudhi/Construct_closest_landmark_table.h>
#include <gudhi/Landmark_choice_by_random_point.h>
#include <gudhi/reader_utils.h>
@@ -67,7 +68,7 @@ int main(int argc, char * const argv[]) {
// 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 +76,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::landmark_choice_by_random_point(point_vector, 100, std::back_inserter(landmarks));
+ Gudhi::witness_complex::construct_closest_landmark_table(point_vector, landmarks, knn);
// Compute witness complex
Gudhi::witness_complex::witness_complex(knn, number_of_landmarks, point_vector[0].size(), simplex_tree);