summaryrefslogtreecommitdiff
path: root/src/Persistent_cohomology/example/custom_persistence_sort.cpp
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-23 09:37:35 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-09-23 09:37:35 +0000
commit0101a149fc124d62f8a4966654fa30e01f57d424 (patch)
tree934cb37b846b3b7e9e7008c20336b35fe868e426 /src/Persistent_cohomology/example/custom_persistence_sort.cpp
parent143d7809306d21f120d9177128751a41b8460533 (diff)
Fix cpplints
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alpha_complex_create_complex@1548 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b8d7d5b4bde8aeec92d6bfc79b8c146c551317c0
Diffstat (limited to 'src/Persistent_cohomology/example/custom_persistence_sort.cpp')
-rw-r--r--src/Persistent_cohomology/example/custom_persistence_sort.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Persistent_cohomology/example/custom_persistence_sort.cpp b/src/Persistent_cohomology/example/custom_persistence_sort.cpp
index 8e254700..64f2a4dc 100644
--- a/src/Persistent_cohomology/example/custom_persistence_sort.cpp
+++ b/src/Persistent_cohomology/example/custom_persistence_sort.cpp
@@ -97,18 +97,18 @@ int main(int argc, char **argv) {
std::cout << "Simplicial complex is of dimension " << simplex.dimension() <<
" - " << simplex.num_simplices() << " simplices - " <<
simplex.num_vertices() << " vertices." << std::endl;
-
+
// Sort the simplices in the order of the filtration
simplex.initialize_filtration();
-
+
std::cout << "Simplex_tree dim: " << simplex.dimension() << std::endl;
-
+
Persistent_cohomology pcoh(simplex);
-
+
// initializes the coefficient field for homology - Z/3Z
pcoh.init_coefficients(3);
pcoh.compute_persistent_cohomology(0.2);
-
+
// Custom sort and output persistence
cmp_intervals_by_dim_then_length cmp(&simplex);
auto persistent_pairs = pcoh.get_persistent_pairs();
@@ -118,13 +118,13 @@ int main(int argc, char **argv) {
<< simplex.filtration(get<0>(pair)) << " "
<< simplex.filtration(get<1>(pair)) << std::endl;
}
-
+
// Persistent Betti numbers
std::cout << "The persistent Betti numbers in interval [0.40, 0.41] are : ";
for (int dim = 0; dim < simplex.dimension(); dim++)
std::cout << "b" << dim << " = " << pcoh.persistent_betti_number(dim, 0.40, 0.41) << " ; ";
std::cout << std::endl;
-
+
// Betti numbers
std::vector<int> betti_numbers = pcoh.betti_numbers();
std::cout << "The Betti numbers are : ";