From 29499b02d1b6eafcc6419a0b6b4469152ea20a09 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 30 Sep 2016 14:24:41 +0000 Subject: Fix compilation issues git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/rips_complex_module@1596 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 343308ef914e6a6617890f49a55eb0bb8db15ee9 --- src/GudhUI/utils/Persistence_compute.h | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'src/GudhUI/utils/Persistence_compute.h') diff --git a/src/GudhUI/utils/Persistence_compute.h b/src/GudhUI/utils/Persistence_compute.h index 97165490..fa5bafc1 100644 --- a/src/GudhUI/utils/Persistence_compute.h +++ b/src/GudhUI/utils/Persistence_compute.h @@ -29,6 +29,7 @@ #include #include #include +#include #include @@ -69,22 +70,26 @@ template class Persistence_compute { points.emplace_back(std::move(pt_to_add)); } + using Simplex_tree = Gudhi::Simplex_tree<>; + using Filtration_value = Simplex_tree::Filtration_value; + using Rips_complex = Gudhi::rips_complex::Rips_complex; + using Field_Zp = Gudhi::persistent_cohomology::Field_Zp; + using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology; + + Rips_complex rips_complex(points, params.threshold, euclidean_distance); - Graph_t prox_graph = compute_proximity_graph(points, params.threshold, euclidean_distance); - Gudhi::Simplex_tree<> st; - st.insert_graph(prox_graph); - st.expansion(params.max_dim); - - Gudhi::persistent_cohomology::Persistent_cohomology< Gudhi::Simplex_tree<>, - Gudhi::persistent_cohomology::Field_Zp > pcoh(st); - // initializes the coefficient field for homology - pcoh.init_coefficients(params.p); - // put params.min_pers - pcoh.compute_persistent_cohomology(params.min_pers); - stream << "persistence: \n"; - stream << "p dimension birth death: \n"; - - pcoh.output_diagram(stream); + Simplex_tree st; + if (rips_complex.create_complex(st, params.max_dim)) { + Persistent_cohomology pcoh(st); + // initializes the coefficient field for homology + pcoh.init_coefficients(params.p); + // put params.min_pers + pcoh.compute_persistent_cohomology(params.min_pers); + stream << "persistence: \n"; + stream << "p dimension birth death: \n"; + + pcoh.output_diagram(stream); + } } }; -- cgit v1.2.3