From d55d30d2fadff5b7f9a045c596e9f8ad37c6b206 Mon Sep 17 00:00:00 2001 From: salinasd Date: Thu, 5 Feb 2015 15:30:39 +0000 Subject: skbl add test skbl constructor git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@454 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3d83eeb565fb1d4299edaf9958a54bbe7719aedf --- .../include/gudhi/Skeleton_blocker_complex.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/Skeleton_blocker/include') diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h index 865ff55a..fb1e440d 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h @@ -239,8 +239,21 @@ public: } if(all_edges_here){ //eg this->contains(max_face) max_face.add_vertex(nv); - if(!cofaces[first_v]->contains(max_face)) + if(!cofaces[first_v]->contains(max_face)){ + // if there exists a blocker included in max_face, we remove it + // as it is not a minimum missing face + // the other alternative would be to check to all properfaces + // are in the complex before adding a blocker but that + // would be more expensive if there are few blockers + std::vector blockers_to_remove; + for(auto b : blocker_range(first_v)) + if(b->contains(max_face)) + blockers_to_remove.push_back(b); + for(auto b : blockers_to_remove) + this->delete_blocker(b); + add_blocker(max_face); + } max_face.remove_vertex(nv); } } @@ -690,9 +703,8 @@ public: * @remark sigma has to belongs to the set of blockers */ void remove_blocker(const Blocker_handle sigma) { - for (auto vertex : *sigma) { + for (auto vertex : *sigma) remove_blocker(sigma, vertex); - } num_blockers_--; } -- cgit v1.2.3