summaryrefslogtreecommitdiff
path: root/src/Persistent_cohomology/example/plain_homology.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Persistent_cohomology/example/plain_homology.cpp')
-rw-r--r--src/Persistent_cohomology/example/plain_homology.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Persistent_cohomology/example/plain_homology.cpp b/src/Persistent_cohomology/example/plain_homology.cpp
index 0a692717..2156ffd9 100644
--- a/src/Persistent_cohomology/example/plain_homology.cpp
+++ b/src/Persistent_cohomology/example/plain_homology.cpp
@@ -24,6 +24,7 @@
#include <gudhi/Persistent_cohomology.h>
#include <iostream>
+#include <vector>
using namespace Gudhi;
@@ -76,9 +77,16 @@ int main() {
// Print the result. The format is, on each line: 2 dim 0 inf
// where 2 represents the field, dim the dimension of the feature.
- // 2 0 0 inf
- // 2 0 0 inf
- // 2 1 0 inf
+ // 2 0 0 inf
+ // 2 0 0 inf
+ // 2 1 0 inf
// means that in Z/2Z-homology, the Betti numbers are b0=2 and b1=1.
pcoh.output_diagram();
+
+ // Print the Betti numbers are b0=2 and b1=1.
+ std::cout << std::endl;
+ std::cout << "The Betti numbers are : ";
+ for (int i = 0; i < st.dimension(); i++)
+ std::cout << "b" << i << " = " << pcoh.betti_number(i) << " ; ";
+ std::cout << std::endl;
}