diff options
Diffstat (limited to 'src/Persistent_cohomology/example/rips_persistence.cpp')
-rw-r--r-- | src/Persistent_cohomology/example/rips_persistence.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/Persistent_cohomology/example/rips_persistence.cpp b/src/Persistent_cohomology/example/rips_persistence.cpp index bc62b736..b70d0283 100644 --- a/src/Persistent_cohomology/example/rips_persistence.cpp +++ b/src/Persistent_cohomology/example/rips_persistence.cpp @@ -66,29 +66,29 @@ int main(int argc, char * argv[]) { // Construct the Rips complex in a Simplex Tree Simplex_tree simplex_tree; - if (rips_complex_from_file.create_complex(simplex_tree, dim_max)) { - std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n"; - std::cout << " and has dimension " << simplex_tree.dimension() << " \n"; - - // Sort the simplices in the order of the filtration - simplex_tree.initialize_filtration(); - - // Compute the persistence diagram of the complex - Persistent_cohomology pcoh(simplex_tree); - // initializes the coefficient field for homology - pcoh.init_coefficients(p); - - pcoh.compute_persistent_cohomology(min_persistence); - - // Output the diagram in filediag - if (filediag.empty()) { - pcoh.output_diagram(); - } else { - std::ofstream out(filediag); - pcoh.output_diagram(out); - out.close(); - } + rips_complex_from_file.create_complex(simplex_tree, dim_max); + std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n"; + std::cout << " and has dimension " << simplex_tree.dimension() << " \n"; + + // Sort the simplices in the order of the filtration + simplex_tree.initialize_filtration(); + + // Compute the persistence diagram of the complex + Persistent_cohomology pcoh(simplex_tree); + // initializes the coefficient field for homology + pcoh.init_coefficients(p); + + pcoh.compute_persistent_cohomology(min_persistence); + + // Output the diagram in filediag + if (filediag.empty()) { + pcoh.output_diagram(); + } else { + std::ofstream out(filediag); + pcoh.output_diagram(out); + out.close(); } + return 0; } |