summaryrefslogtreecommitdiff
path: root/src/Witness_complex/example
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-20 15:24:36 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-20 15:24:36 +0000
commitdb1398bcf173f372fc3ef7a410e4e72b0192f8cc (patch)
tree16737fa5c160d4ca431be9dbb29409c2da28aa12 /src/Witness_complex/example
parent49d726423c3f270f542ca93d43387e0dbcdd0ca9 (diff)
non-Euclidean example works, but the test not anymore
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1975 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 251638e6417f1059529d57a8a87364a17cf9f5a2
Diffstat (limited to 'src/Witness_complex/example')
-rw-r--r--src/Witness_complex/example/example_nearest_landmark_table.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Witness_complex/example/example_nearest_landmark_table.cpp b/src/Witness_complex/example/example_nearest_landmark_table.cpp
index 00ec17e0..becf74e7 100644
--- a/src/Witness_complex/example/example_nearest_landmark_table.cpp
+++ b/src/Witness_complex/example/example_nearest_landmark_table.cpp
@@ -17,6 +17,7 @@
#include <utility>
#include <string>
#include <vector>
+#include <list>
int main(int argc, char * const argv[]) {
typedef std::vector<std::pair<std::size_t, double>> Nearest_landmark_range;
@@ -26,21 +27,18 @@ int main(int argc, char * const argv[]) {
Gudhi::Simplex_tree<> simplex_tree;
Nearest_landmark_table nlt;
- // Example contains 10 witnesses and 5 landmarks
+ // Example contains 5 witnesses and 5 landmarks
Nearest_landmark_range w0 = {std::make_pair(0,0), std::make_pair(1,1), std::make_pair(2,2), std::make_pair(3,3), std::make_pair(4,4)}; nlt.push_back(w0);
Nearest_landmark_range w1 = {std::make_pair(1,0), std::make_pair(2,1), std::make_pair(3,2), std::make_pair(4,3), std::make_pair(0,4)}; nlt.push_back(w1);
Nearest_landmark_range w2 = {std::make_pair(2,0), std::make_pair(3,1), std::make_pair(4,2), std::make_pair(0,3), std::make_pair(1,4)}; nlt.push_back(w2);
Nearest_landmark_range w3 = {std::make_pair(3,0), std::make_pair(4,1), std::make_pair(0,2), std::make_pair(1,3), std::make_pair(2,4)}; nlt.push_back(w3);
Nearest_landmark_range w4 = {std::make_pair(4,0), std::make_pair(0,1), std::make_pair(1,2), std::make_pair(2,3), std::make_pair(3,4)}; nlt.push_back(w4);
- Nearest_landmark_range x0 = {std::make_pair(0,0), std::make_pair(4,1), std::make_pair(3,2), std::make_pair(2,3), std::make_pair(1,4)}; nlt.push_back(x0);
- Nearest_landmark_range x1 = {std::make_pair(1,0), std::make_pair(0,1), std::make_pair(4,2), std::make_pair(3,3), std::make_pair(2,4)}; nlt.push_back(x1);
- Nearest_landmark_range x2 = {std::make_pair(2,0), std::make_pair(1,1), std::make_pair(0,2), std::make_pair(4,3), std::make_pair(3,4)}; nlt.push_back(x2);
- Nearest_landmark_range x3 = {std::make_pair(3,0), std::make_pair(2,1), std::make_pair(1,2), std::make_pair(0,3), std::make_pair(4,4)}; nlt.push_back(x3);
- Nearest_landmark_range x4 = {std::make_pair(4,0), std::make_pair(3,1), std::make_pair(2,2), std::make_pair(1,3), std::make_pair(0,4)}; nlt.push_back(x4);
Witness_complex witness_complex(nlt);
witness_complex.create_complex(simplex_tree, 4.1);
+ std::cout << "Number of simplices: " << simplex_tree.num_simplices() << std::endl;
+
Gudhi::persistent_cohomology::Persistent_cohomology<Gudhi::Simplex_tree<>, Gudhi::persistent_cohomology::Field_Zp > pcoh(simplex_tree);
// initializes the coefficient field for homology
pcoh.init_coefficients(11);