From 7e3cfb3aad5ad38779e48f77dc2ba24014814dc9 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 27 Mar 2018 14:01:50 +0000 Subject: No more deep copy of the simplicial complex in the Cech Blocker, just use the pointer git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3307 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 026cd5491d8e3030fce63beabd6e77bddebb05cc --- src/Cech_complex/include/gudhi/Cech_complex.h | 2 +- src/Cech_complex/include/gudhi/Cech_complex_blocker.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Cech_complex/include/gudhi/Cech_complex.h b/src/Cech_complex/include/gudhi/Cech_complex.h index 7c2e31ac..1cae7b0b 100644 --- a/src/Cech_complex/include/gudhi/Cech_complex.h +++ b/src/Cech_complex/include/gudhi/Cech_complex.h @@ -97,7 +97,7 @@ class Cech_complex { complex.insert_graph(cech_skeleton_graph_); // expand the graph until dimension dim_max complex.expansion_with_blockers(dim_max, - Cech_blocker(complex, this)); + Cech_blocker(&complex, this)); } /** @return max_radius value given at construction. */ diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h index c082815d..6755c826 100644 --- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h +++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h @@ -68,7 +68,7 @@ class Cech_blocker { * \return true if the simplex radius is greater than the Cech_complex max_radius*/ bool operator()(Simplex_handle sh) { Point_cloud points; - for (auto vertex : simplicial_complex_.simplex_vertex_range(sh)) { + for (auto vertex : sc_ptr_->simplex_vertex_range(sh)) { points.push_back(Point(cc_ptr_->point_iterator(vertex)->begin(), cc_ptr_->point_iterator(vertex)->end())); #ifdef DEBUG_TRACES @@ -80,17 +80,17 @@ class Cech_blocker { if (radius > cc_ptr_->max_radius()) std::cout << "radius > max_radius => expansion is blocked\n"; #endif // DEBUG_TRACES - simplicial_complex_.assign_filtration(sh, radius); + sc_ptr_->assign_filtration(sh, radius); return (radius > cc_ptr_->max_radius()); } /** \internal \brief Cech complex blocker constructor. */ - Cech_blocker(SimplicialComplexForCech& simplicial_complex, Cech_complex* cc_ptr) - : simplicial_complex_(simplicial_complex), + Cech_blocker(SimplicialComplexForCech* sc_ptr, Cech_complex* cc_ptr) + : sc_ptr_(sc_ptr), cc_ptr_(cc_ptr) { } private: - SimplicialComplexForCech simplicial_complex_; + SimplicialComplexForCech* sc_ptr_; Cech_complex* cc_ptr_; }; -- cgit v1.2.3