From ff6ad8b959f6c20380f3d68ebb1bbbf1224adcfd Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 13 Oct 2015 15:34:28 +0000 Subject: Manual merge of skb_simplex_insertion after last trunk big modifications on Skbl git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/skb_simplex_insertion_merge@855 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d7f7721e2963de439a28040196423d4c0df07d3f --- .../include/gudhi/Skeleton_blocker_complex.h | 176 +++++++++++++-------- 1 file changed, 112 insertions(+), 64 deletions(-) (limited to 'src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h') diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h index 07f371a2..78384abf 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h @@ -94,16 +94,16 @@ class Skeleton_blocker_complex { /** * @brief A ordered set of integers that represents a simplex. */ - typedef Skeleton_blocker_simplex Simplex_handle; + typedef Skeleton_blocker_simplex Simplex; typedef Skeleton_blocker_simplex Root_simplex_handle; /** * @brief Handle to a blocker of the complex. */ - typedef Simplex_handle* Blocker_handle; + typedef Simplex* Blocker_handle; typedef typename Root_simplex_handle::Simplex_vertex_const_iterator Root_simplex_iterator; - typedef typename Simplex_handle::Simplex_vertex_const_iterator Simplex_handle_iterator; + typedef typename Simplex::Simplex_vertex_const_iterator Simplex_handle_iterator; protected: typedef typename boost::adjacency_list::edge_descriptor Edge_handle; protected: - typedef std::multimap BlockerMap; - typedef typename std::multimap::value_type BlockerPair; - typedef typename std::multimap::iterator BlockerMapIterator; - typedef typename std::multimap::const_iterator BlockerMapConstIterator; + typedef std::multimap BlockerMap; + typedef typename std::multimap::value_type BlockerPair; + typedef typename std::multimap::iterator BlockerMapIterator; + typedef typename std::multimap::const_iterator BlockerMapConstIterator; protected: int num_vertices_; @@ -174,7 +174,7 @@ class Skeleton_blocker_complex { private: // typedef Trie> STrie; - typedef Trie STrie; + typedef Trie STrie; public: /** @@ -207,12 +207,12 @@ class Skeleton_blocker_complex { while (num_vertex-- >= 0) add_vertex(); for (const auto& e : edges) - add_edge(e.first, e.second); + add_edge_without_blockers(e.first, e.second); } template void add_blockers(SimpleHandleOutputIterator simplex_begin, SimpleHandleOutputIterator simplex_end) { - Tries tries(num_vertices(), simplex_begin, simplex_end); + Tries tries(num_vertices(), simplex_begin, simplex_end); tries.init_next_dimension(); auto simplices(tries.next_dimension_simplices()); @@ -221,7 +221,7 @@ class Skeleton_blocker_complex { for (auto& sigma : simplices) { // common_positive_neighbors is the set of vertices u such that // for all s in sigma, us is an edge and u>s - Simplex_handle common_positive_neighbors(tries.positive_neighbors(sigma.last_vertex())); + Simplex common_positive_neighbors(tries.positive_neighbors(sigma.last_vertex())); for (auto sigma_it = sigma.rbegin(); sigma_it != sigma.rend(); ++sigma_it) if (sigma_it != sigma.rbegin()) common_positive_neighbors.intersection(tries.positive_neighbors(*sigma_it)); @@ -427,7 +427,7 @@ class Skeleton_blocker_complex { * @return true iff the simplicial complex contains all vertices * of simplex sigma */ - bool contains_vertices(const Simplex_handle & sigma) const { + bool contains_vertices(const Simplex & sigma) const { for (auto vertex : sigma) if (!contains_vertex(vertex)) return false; @@ -535,41 +535,68 @@ class Skeleton_blocker_complex { * @details it assumes that the edge is present in the complex */ - Simplex_handle get_vertices(Edge_handle edge_handle) const { + Simplex get_vertices(Edge_handle edge_handle) const { auto edge((*this)[edge_handle]); - return Simplex_handle((*this)[edge.first()], (*this)[edge.second()]); + return Simplex((*this)[edge.first()], (*this)[edge.second()]); } /** - * @brief Adds an edge between vertices a and b and all its cofaces. + * @brief Adds an edge between vertices a and b. + * @details For instance, the complex contains edge 01 and 12, then calling + * add_edge with vertex 0 and 2 will create a complex containing + * the edges 01, 12, 20 but not the triangle 012 (and hence this complex + * will contains a blocker 012). */ - Edge_handle add_edge(Vertex_handle a, Vertex_handle b) { + Edge_handle add_edge(Vertex_handle a, Vertex_handle b) { + //if the edge is already there we musnt go further + //as we may add blockers that should not be here + if(contains_edge(a,b)) + return *((*this)[std::make_pair(a,b)]); + auto res = add_edge_without_blockers(a,b); + add_blockers_after_simplex_insertion(Simplex(a,b)); + return res; + } + + /** + * @brief Adds all edges of s in the complex. + */ + void add_edge(const Simplex& s) { + for(auto i = s.begin(); i != s.end(); ++i) + for(auto j = i; ++j != s.end(); /**/) + add_edge(*i,*j); + } + + /** + * @brief Adds an edge between vertices a and b without blockers. + * @details For instance, the complex contains edge 01 and 12, then calling + * add_edge with vertex 0 and 2 will create a complex containing + * the triangle 012. + */ + Edge_handle add_edge_without_blockers(Vertex_handle a, Vertex_handle b) { assert(contains_vertex(a) && contains_vertex(b)); assert(a != b); auto edge_handle((*this)[std::make_pair(a, b)]); - // std::pair pair_descr_bool = (*this)[std::make_pair(a,b)]; - // Edge_handle edge_descr; - // bool edge_present = pair_descr_bool.second; if (!edge_handle) { edge_handle = boost::add_edge(a.vertex, b.vertex, skeleton).first; (*this)[*edge_handle].setId(get_id(a), get_id(b)); degree_[a.vertex]++; degree_[b.vertex]++; if (visitor) - visitor->on_add_edge(a, b); + visitor->on_add_edge_without_blockers(a, b); } return *edge_handle; } + /** - * @brief Adds all edges and their cofaces of a simplex to the simplicial complex. + * @brief Adds all edges of s in the complex without adding blockers. */ - void add_edges(const Simplex_handle & sigma) { - Simplex_handle_iterator i, j; - for (i = sigma.begin(); i != sigma.end(); ++i) - for (j = i, j++; j != sigma.end(); ++j) - add_edge(*i, *j); + void add_edge_without_blockers(Simplex s) { + for(auto i = s.begin(); i != s.end(); ++i){ + for(auto j = i; ++j != s.end(); /**/) + add_edge_without_blockers(*i,*j); + } } /** @@ -627,7 +654,7 @@ class Skeleton_blocker_complex { * @return true iff the simplicial complex contains all vertices * and all edges of simplex sigma */ - bool contains_edges(const Simplex_handle & sigma) const { + bool contains_edges(const Simplex & sigma) const { for (auto i = sigma.begin(); i != sigma.end(); ++i) { if (!contains_vertex(*i)) return false; @@ -649,15 +676,14 @@ class Skeleton_blocker_complex { * @brief Adds the simplex to the set of blockers and * returns a Blocker_handle toward it if was not present before and 0 otherwise. */ - Blocker_handle add_blocker(const Simplex_handle& blocker) { + Blocker_handle add_blocker(const Simplex& blocker) { assert(blocker.dimension() > 1); if (contains_blocker(blocker)) { - // std::cerr << "ATTEMPT TO ADD A BLOCKER ALREADY THERE ---> BLOCKER IGNORED" << endl; return 0; } else { if (visitor) visitor->on_add_blocker(blocker); - Blocker_handle blocker_pt = new Simplex_handle(blocker); + Blocker_handle blocker_pt = new Simplex(blocker); num_blockers_++; auto vertex = blocker_pt->begin(); while (vertex != blocker_pt->end()) { @@ -739,7 +765,7 @@ class Skeleton_blocker_complex { * * @remark contrarily to delete_blockers does not call the destructor */ - void remove_blocker(const Simplex_handle& sigma) { + void remove_blocker(const Simplex& sigma) { assert(contains_blocker(sigma)); for (auto vertex : sigma) remove_blocker(sigma, vertex); @@ -777,7 +803,7 @@ class Skeleton_blocker_complex { /** * @return true iff s is a blocker of the simplicial complex */ - bool contains_blocker(const Simplex_handle & s) const { + bool contains_blocker(const Simplex & s) const { if (s.dimension() < 2) return false; @@ -795,7 +821,7 @@ class Skeleton_blocker_complex { * @return true iff a blocker of the simplicial complex * is a face of sigma. */ - bool blocks(const Simplex_handle & sigma) const { + bool blocks(const Simplex & sigma) const { for (auto s : sigma) for (auto blocker : const_blocker_range(s)) if (sigma.contains(*blocker)) @@ -810,7 +836,7 @@ class Skeleton_blocker_complex { * @details Adds to simplex the neighbours of v e.g. \f$ n \leftarrow n \cup N(v) \f$. * If keep_only_superior is true then only vertices that are greater than v are added. */ - virtual void add_neighbours(Vertex_handle v, Simplex_handle & n, + virtual void add_neighbours(Vertex_handle v, Simplex & n, bool keep_only_superior = false) const { boost_adjacency_iterator ai, ai_end; for (tie(ai, ai_end) = adjacent_vertices(v.vertex, skeleton); ai != ai_end; @@ -833,7 +859,7 @@ class Skeleton_blocker_complex { * todo revoir * */ - virtual void add_neighbours(const Simplex_handle &alpha, Simplex_handle & res, + virtual void add_neighbours(const Simplex &alpha, Simplex & res, bool keep_only_superior = false) const { res.clear(); auto alpha_vertex = alpha.begin(); @@ -848,9 +874,9 @@ class Skeleton_blocker_complex { * not neighbours of v e.g. \f$ res \leftarrow res \cap N(v) \f$. * If 'keep_only_superior' is true then only vertices that are greater than v are keeped. */ - virtual void keep_neighbours(Vertex_handle v, Simplex_handle& res, + virtual void keep_neighbours(Vertex_handle v, Simplex& res, bool keep_only_superior = false) const { - Simplex_handle nv; + Simplex nv; add_neighbours(v, nv, keep_only_superior); res.intersection(nv); } @@ -860,9 +886,9 @@ class Skeleton_blocker_complex { * neighbours of v eg \f$ res \leftarrow res \setminus N(v) \f$. * If 'keep_only_superior' is true then only vertices that are greater than v are added. */ - virtual void remove_neighbours(Vertex_handle v, Simplex_handle & res, + virtual void remove_neighbours(Vertex_handle v, Simplex & res, bool keep_only_superior = false) const { - Simplex_handle nv; + Simplex nv; add_neighbours(v, nv, keep_only_superior); res.difference(nv); } @@ -874,7 +900,7 @@ class Skeleton_blocker_complex { * Constructs the link of 'simplex' with points coordinates. */ Link_complex link(Vertex_handle v) const { - return Link_complex(*this, Simplex_handle(v)); + return Link_complex(*this, Simplex(v)); } /** @@ -887,7 +913,7 @@ class Skeleton_blocker_complex { /** * Constructs the link of 'simplex' with points coordinates. */ - Link_complex link(const Simplex_handle& simplex) const { + Link_complex link(const Simplex& simplex) const { return Link_complex(*this, simplex); } @@ -899,11 +925,11 @@ class Skeleton_blocker_complex { */ // xxx rename get_address et place un using dans sub_complex - boost::optional get_simplex_address( + boost::optional get_simplex_address( const Root_simplex_handle& s) const { - boost::optional res; + boost::optional res; - Simplex_handle s_address; + Simplex s_address; // Root_simplex_const_iterator i; for (auto i = s.begin(); i != s.end(); ++i) { boost::optional address = get_address(*i); @@ -920,7 +946,7 @@ class Skeleton_blocker_complex { * @brief returns a simplex with vertices which are the id of vertices of the * argument. */ - Root_simplex_handle get_id(const Simplex_handle& local_simplex) const { + Root_simplex_handle get_id(const Simplex& local_simplex) const { Root_simplex_handle global_simplex; for (auto x = local_simplex.begin(); x != local_simplex.end(); ++x) { global_simplex.add_vertex(get_id(*x)); @@ -932,7 +958,7 @@ class Skeleton_blocker_complex { * @brief returns true iff the simplex s belongs to the simplicial * complex. */ - virtual bool contains(const Simplex_handle & s) const { + virtual bool contains(const Simplex & s) const { if (s.dimension() == -1) { return false; } else if (s.dimension() == 0) { @@ -1061,7 +1087,7 @@ class Skeleton_blocker_complex { * Furthermore, all simplices tau of the form sigma \setminus simplex_to_be_removed must be added * whenever the dimension of tau is at least 2. */ - void update_blockers_after_remove_star_of_vertex_or_edge(const Simplex_handle& simplex_to_be_removed); + void update_blockers_after_remove_star_of_vertex_or_edge(const Simplex& simplex_to_be_removed); public: /** @@ -1078,31 +1104,36 @@ class Skeleton_blocker_complex { /** * Remove the star of the simplex 'sigma' which needs to belong to the complex */ - void remove_star(const Simplex_handle& sigma); + void remove_star(const Simplex& sigma); /** - * @brief add a maximal simplex plus all its cofaces. - * @details the simplex must have dimension greater than one (otherwise use add_vertex or add_edge). + * @brief add a simplex. + * @details the simplex must have dimension greater than one (otherwise use add_vertex or add_edge_without_blockers). + * and all vertices lower than the higher vertex of sigma must already be in the complex. + * if some edges of sigma are not in the complex, then insert_edges_of_sigma flag must be + * set to true. */ - void add_simplex(const Simplex_handle& sigma); + void add_simplex(const Simplex& sigma, bool insert_edges_of_sigma = false); private: + void add_blockers_after_simplex_insertion(Simplex s); + /** * remove all blockers that contains sigma */ - void remove_blocker_containing_simplex(const Simplex_handle& sigma); + void remove_blocker_containing_simplex(const Simplex& sigma); /** * remove all blockers that contains sigma */ - void remove_blocker_include_in_simplex(const Simplex_handle& sigma); + void remove_blocker_include_in_simplex(const Simplex& sigma); public: enum simplifiable_status { NOT_HOMOTOPY_EQ, MAYBE_HOMOTOPY_EQ, HOMOTOPY_EQ }; - simplifiable_status is_remove_star_homotopy_preserving(const Simplex_handle& simplex) { + simplifiable_status is_remove_star_homotopy_preserving(const Simplex& simplex) { // todo write a virtual method 'link' in Skeleton_blocker_complex which will be overloaded by the current one of // Skeleton_blocker_geometric_complex // then call it there to build the link and return the value of link.is_contractible() @@ -1174,7 +1205,7 @@ class Skeleton_blocker_complex { * that may be used to construct a new blocker after contracting ab. * It requires that the link condition is satisfied. */ - void tip_blockers(Vertex_handle a, Vertex_handle b, std::vector & buffer) const; + void tip_blockers(Vertex_handle a, Vertex_handle b, std::vector & buffer) const; private: /** @@ -1217,7 +1248,7 @@ class Skeleton_blocker_complex { private: void get_blockers_to_be_added_after_contraction(Vertex_handle a, Vertex_handle b, - std::set& blockers_to_add); + std::set& blockers_to_add); /** * delete all blockers that passes through a or b */ @@ -1358,12 +1389,28 @@ class Skeleton_blocker_complex { /** * @brief Returns a Complex_simplex_around_vertex_range over all the simplices around a vertex of the complex */ - Complex_simplex_around_vertex_range simplex_range(Vertex_handle v) const { + Complex_simplex_around_vertex_range star_simplex_range(Vertex_handle v) const { assert(contains_vertex(v)); return Complex_simplex_around_vertex_range( Complex_simplex_around_vertex_iterator(this, v), Complex_simplex_around_vertex_iterator(this, v, true)); } + typedef Simplex_coboundary_iterator Complex_simplex_coboundary_iterator; + + /** + * @brief Range over the simplices of the coboundary of a simplex. + * Methods .begin() and .end() return a Complex_simplex_coboundary_iterator. + */ + typedef boost::iterator_range < Complex_simplex_coboundary_iterator > Complex_coboundary_range; + + /** + * @brief Returns a Complex_simplex_coboundary_iterator over the simplices of the coboundary of a simplex. + */ + Complex_coboundary_range coboundary_range(const Simplex& s) const { + assert(contains(s)); + return Complex_coboundary_range(Complex_simplex_coboundary_iterator(this, s), + Complex_simplex_coboundary_iterator(this, s, true)); + } // typedef Simplex_iterator Complex_simplex_iterator; typedef Simplex_iterator Complex_simplex_iterator; @@ -1373,7 +1420,7 @@ class Skeleton_blocker_complex { /** * @brief Returns a Complex_simplex_range over all the simplices of the complex */ - Complex_simplex_range simplex_range() const { + Complex_simplex_range complex_simplex_range() const { Complex_simplex_iterator end(this, true); if (empty()) { return Complex_simplex_range(end, end); @@ -1393,7 +1440,7 @@ class Skeleton_blocker_complex { * @brief Iterator over the blockers adjacent to a vertex */ typedef Blocker_iterator_around_vertex_internal< - typename std::multimap::iterator, + typename std::multimap::iterator, Blocker_handle> Complex_blocker_around_vertex_iterator; @@ -1401,7 +1448,7 @@ class Skeleton_blocker_complex { * @brief Iterator over (constant) blockers adjacent to a vertex */ typedef Blocker_iterator_around_vertex_internal< - typename std::multimap::const_iterator, + typename std::multimap::const_iterator, const Blocker_handle> Const_complex_blocker_around_vertex_iterator; @@ -1433,7 +1480,7 @@ class Skeleton_blocker_complex { * @brief Iterator over the blockers. */ typedef Blocker_iterator_internal< - typename std::multimap::iterator, + typename std::multimap::iterator, Blocker_handle> Complex_blocker_iterator; @@ -1441,7 +1488,7 @@ class Skeleton_blocker_complex { * @brief Iterator over the (constant) blockers. */ typedef Blocker_iterator_internal< - typename std::multimap::const_iterator, + typename std::multimap::const_iterator, const Blocker_handle> Const_complex_blocker_iterator; @@ -1517,8 +1564,9 @@ class Skeleton_blocker_complex { template Complex make_complex_from_top_faces(SimplexHandleIterator simplex_begin, SimplexHandleIterator simplex_end, bool is_flag_complex = false) { - typedef typename Complex::Simplex_handle Simplex_handle; - std::vector simplices; + //todo use add_simplex instead! should be more efficient and more elegant :) + typedef typename Complex::Simplex Simplex; + std::vector simplices; for (auto top_face = simplex_begin; top_face != simplex_end; ++top_face) { auto subfaces_topface = subfaces(*top_face); simplices.insert(simplices.end(), subfaces_topface.begin(), subfaces_topface.end()); -- cgit v1.2.3 From 20cb0d7a919005ba20d0a76cca38a73d3a119480 Mon Sep 17 00:00:00 2001 From: salinasd Date: Sun, 18 Oct 2015 10:44:55 +0000 Subject: GH: dim3 restriction, skbl: num_simplices methods git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/skb_simplex_insertion_merge@865 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: e7f9d48c4e6af222b6f158e906a3a592027d39b8 --- src/Contraction/example/Garland_heckbert.cpp | 23 ++++++++++------ .../include/gudhi/Skeleton_blocker_complex.h | 31 ++++++++++++++++++---- .../gudhi/Skeleton_blocker_simplifiable_complex.h | 4 +-- .../test/TestSkeletonBlockerComplex.cpp | 22 +++++++++++++-- 4 files changed, 62 insertions(+), 18 deletions(-) (limited to 'src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h') diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp index 70f29b6a..681426e0 100644 --- a/src/Contraction/example/Garland_heckbert.cpp +++ b/src/Contraction/example/Garland_heckbert.cpp @@ -145,13 +145,13 @@ class GH_visitor : public Gudhi::contraction::Contraction_visitor { int main(int argc, char *argv[]) { if (argc != 4) { - std::cerr << "Usage " << argv[0] << " input.off output.off N to load the file input.off, contract N edges and save " - << "the result to output.off.\n"; + std::cerr << "Usage " << argv[0] << " input.off output.off N to load the file input.off, contract N edges and save the result to output.off.\n"; return EXIT_FAILURE; } Complex complex; - + typedef typename Complex::Vertex_handle Vertex_handle; + // load the points Skeleton_blocker_off_reader off_reader(argv[1], complex); if (!off_reader.is_valid()) { @@ -159,8 +159,12 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; + if(!complex.empty() && !complex.point(Vertex_handle(0)).dimension()==3) { + std::cerr << "Only points of dimension 3 are supported." << std::endl; + return EXIT_FAILURE; + } + std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; int num_contractions = atoi(argv[3]); @@ -171,22 +175,25 @@ int main(int argc, char *argv[]) { new GH_cost(complex), new GH_placement(complex), contraction::make_link_valid_contraction(), - new GH_visitor(complex)); + new GH_visitor(complex) + ); std::cout << "Contract " << num_contractions << " edges" << std::endl; contractor.contract_edges(num_contractions); std::cout << "Final complex has " << complex.num_vertices() << " vertices, " << - complex.num_edges() << " edges and" << + complex.num_edges() << " edges and " << complex.num_triangles() << " triangles." << std::endl; - // write simplified complex + //write simplified complex Skeleton_blocker_off_writer off_writer(argv[2], complex); return EXIT_SUCCESS; } +#endif // GARLAND_HECKBERT_H_ + + -#endif // GARLAND_HECKBERT_H_ diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h index 78384abf..b1995783 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h @@ -134,8 +134,8 @@ class Skeleton_blocker_complex { typedef typename std::multimap::const_iterator BlockerMapConstIterator; protected: - int num_vertices_; - int num_blockers_; + size_t num_vertices_; + size_t num_blockers_; typedef Skeleton_blocker_complex_visitor Visitor; // typedef Visitor* Visitor_ptr; @@ -164,10 +164,10 @@ class Skeleton_blocker_complex { /** *@brief constructs a simplicial complex with a given number of vertices and a visitor. */ - explicit Skeleton_blocker_complex(int num_vertices_ = 0, Visitor* visitor_ = NULL) + explicit Skeleton_blocker_complex(size_t num_vertices_ = 0, Visitor* visitor_ = NULL) : visitor(visitor_) { clear(); - for (int i = 0; i < num_vertices_; ++i) { + for (size_t i = 0; i < num_vertices_; ++i) { add_vertex(); } } @@ -998,10 +998,31 @@ class Skeleton_blocker_complex { return std::distance(triangles.begin(), triangles.end()); } + + /* + * @brief returns the number of simplices of a given dimension in the complex. + */ + size_t num_simplices() const { + auto simplices = complex_simplex_range(); + return std::distance(simplices.begin(), simplices.end()); + } + + /* + * @brief returns the number of simplices of a given dimension in the complex. + */ + size_t num_simplices(unsigned dimension) const { + //todo iterator on k-simplices + size_t res = 0; + for(const auto& s: complex_simplex_range()) + if(s.dimension() == dimension) + ++res; + return res; + } + /* * @brief returns the number of blockers in the complex. */ - int num_blockers() const { + size_t num_blockers() const { return num_blockers_; } diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h index 49a1ea8b..79a7ed79 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h @@ -45,9 +45,7 @@ bool Skeleton_blocker_complex::is_popable_blocker(Blocker_han assert(this->contains_blocker(*sigma)); Skeleton_blocker_link_complex link_blocker_sigma; build_link_of_blocker(*this, *sigma, link_blocker_sigma); - - bool res = link_blocker_sigma.is_contractible() == CONTRACTIBLE; - return res; + return link_blocker_sigma.is_contractible() == CONTRACTIBLE; } /** diff --git a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp index 418638e8..69abd279 100644 --- a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp +++ b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp @@ -104,6 +104,23 @@ bool test_simplex() { return simplex.dimension() == 3; } +bool test_num_simplices() { + int n = 4; + Complex complex; + build_complete(n, complex); + size_t sum = 0; + for (int i = 0; i < n; i++) { + PRINT(complex.num_simplices(i)); + sum += complex.num_simplices(i); + } + return + complex.num_vertices() == n && + complex.num_edges() == 6 && + sum == 15 && + complex.num_simplices() == 15; +} + + bool test_iterator_vertices1() { int n = 10; Complex complex(10); @@ -118,7 +135,7 @@ bool test_iterator_vertices1() { bool test_iterator_vertices2() { int n = 10; - Complex complex(10); + Complex complex; build_complete(10, complex); cerr << "complex.num_vertices():" << complex.num_vertices() << endl; cerr << "complex.num_edges():" << complex.num_edges() << endl; @@ -348,7 +365,7 @@ bool test_iterator_simplices4() { } bool test_iterator_coboundary() { - Complex c(4); + Complex c; build_complete(4, c); c.remove_edge(Vertex_handle(0), Vertex_handle(2)); PRINT(c.to_string()); @@ -892,6 +909,7 @@ bool test_constructor8() { int main(int argc, char *argv[]) { Tests tests_complex; tests_complex.add("test simplex", test_simplex); + tests_complex.add("test_num_simplices", test_num_simplices); tests_complex.add("test_link0", test_link0); tests_complex.add("test_link1", test_link1); tests_complex.add("test_link2", test_link2); -- cgit v1.2.3 From 0e156a914ecfa1e8d71a8bee49400ed66a191637 Mon Sep 17 00:00:00 2001 From: salinasd Date: Sat, 14 Nov 2015 15:21:34 +0000 Subject: skbl: correct typo in test and small renamings git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/skb_simplex_insertion_merge@918 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 543ae94051051e1a79f95192db24fcd411dbea28 --- .../example/Skeleton_blocker_link.cpp | 7 ++- .../Skeleton_blocker/Skeleton_blocker_simplex.h | 4 +- .../include/gudhi/Skeleton_blocker_complex.h | 58 +++++++++++----------- .../gudhi/Skeleton_blocker_simplifiable_complex.h | 15 ++++-- src/Skeleton_blocker/test/TestSimplifiable.cpp | 2 +- .../test/TestSkeletonBlockerComplex.cpp | 2 +- 6 files changed, 48 insertions(+), 40 deletions(-) (limited to 'src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h') diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp index 5c717938..5e429728 100644 --- a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp +++ b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp @@ -39,9 +39,12 @@ typedef Complex::Simplex Simplex; int main(int argc, char *argv[]) { // build a full complex with 4 vertices and 2^4-1 simplices - // Initial vertices are (0,1,2,3,4) - Simplex tetrahedron(Vertex_handle(0), Vertex_handle(1), Vertex_handle(2), Vertex_handle(3)); + + // Create a complex with four vertices (0,1,2,3) Complex complex; + + // Add a tetrahedron to this complex + Simplex tetrahedron(Vertex_handle(0), Vertex_handle(1), Vertex_handle(2), Vertex_handle(3)); complex.add_simplex(tetrahedron); cout << "complex:" << complex.to_string() << endl; diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h index 0d838d50..714bf23c 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h @@ -218,7 +218,7 @@ class Skeleton_blocker_simplex { } /** - * Returns the first vertex of the (oriented) simplex. + * Returns the first and smallest vertex of the simplex. * * Be careful : assumes the simplex is non-empty. */ @@ -228,7 +228,7 @@ class Skeleton_blocker_simplex { } /** - * Returns the last vertex of the (oriented) simplex. + * Returns the last and greatest vertex of the simplex. * * Be careful : assumes the simplex is non-empty. */ diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h index b1995783..cf156a58 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h @@ -23,16 +23,26 @@ #ifndef SKELETON_BLOCKER_COMPLEX_H_ #define SKELETON_BLOCKER_COMPLEX_H_ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include #include #include - #include #include #include - #include #include @@ -40,18 +50,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace Gudhi { namespace skbl { @@ -182,25 +180,28 @@ class Skeleton_blocker_complex { * @details is_flag_complex indicates if the complex is a flag complex or not (to know if blockers have to be computed or not). */ template - Skeleton_blocker_complex(SimpleHandleOutputIterator simplex_begin, SimpleHandleOutputIterator simplex_end, + Skeleton_blocker_complex(SimpleHandleOutputIterator simplices_begin, SimpleHandleOutputIterator simplices_end, bool is_flag_complex = false, Visitor* visitor_ = NULL) : num_vertices_(0), num_blockers_(0), visitor(visitor_) { - add_vertex_and_edges(simplex_begin, simplex_end); + add_vertices_and_edges(simplices_begin, simplices_end); if (!is_flag_complex) // need to compute blockers - add_blockers(simplex_begin, simplex_end); + add_blockers(simplices_begin, simplices_end); } private: + /** + * Add vertices and edges of a simplex in one pass + */ template - void add_vertex_and_edges(SimpleHandleOutputIterator simplex_begin, SimpleHandleOutputIterator simplex_end) { + void add_vertices_and_edges(SimpleHandleOutputIterator simplices_begin, SimpleHandleOutputIterator simplices_end) { std::vector> edges; // first pass to add vertices and edges int num_vertex = -1; - for (auto s_it = simplex_begin; s_it != simplex_end; ++s_it) { + for (auto s_it = simplices_begin; s_it != simplices_end; ++s_it) { if (s_it->dimension() == 0) num_vertex = (std::max)(num_vertex, s_it->first_vertex().vertex); if (s_it->dimension() == 1) edges.emplace_back(s_it->first_vertex(), s_it->last_vertex()); } @@ -210,9 +211,10 @@ class Skeleton_blocker_complex { add_edge_without_blockers(e.first, e.second); } + template - void add_blockers(SimpleHandleOutputIterator simplex_begin, SimpleHandleOutputIterator simplex_end) { - Tries tries(num_vertices(), simplex_begin, simplex_end); + void add_blockers(SimpleHandleOutputIterator simplices_begin, SimpleHandleOutputIterator simplices_end) { + Tries tries(num_vertices(), simplices_begin, simplices_end); tries.init_next_dimension(); auto simplices(tries.next_dimension_simplices()); @@ -378,6 +380,7 @@ class Skeleton_blocker_complex { /** * @brief Adds a vertex to the simplicial complex and returns its Vertex_handle. + * @remark Vertex representation is contiguous. */ Vertex_handle add_vertex() { Vertex_handle address(boost::add_vertex(skeleton)); @@ -1128,13 +1131,10 @@ class Skeleton_blocker_complex { void remove_star(const Simplex& sigma); /** - * @brief add a simplex. - * @details the simplex must have dimension greater than one (otherwise use add_vertex or add_edge_without_blockers). - * and all vertices lower than the higher vertex of sigma must already be in the complex. - * if some edges of sigma are not in the complex, then insert_edges_of_sigma flag must be - * set to true. + * @brief add a simplex and all its faces. + * @details the simplex must have dimension greater than one (otherwise use add_vertex or add_edge_without_blockers). */ - void add_simplex(const Simplex& sigma, bool insert_edges_of_sigma = false); + void add_simplex(const Simplex& sigma); private: void add_blockers_after_simplex_insertion(Simplex s); @@ -1583,12 +1583,12 @@ class Skeleton_blocker_complex { * return the total number of simplices */ template -Complex make_complex_from_top_faces(SimplexHandleIterator simplex_begin, SimplexHandleIterator simplex_end, +Complex make_complex_from_top_faces(SimplexHandleIterator simplices_begin, SimplexHandleIterator simplices_end, bool is_flag_complex = false) { //todo use add_simplex instead! should be more efficient and more elegant :) typedef typename Complex::Simplex Simplex; std::vector simplices; - for (auto top_face = simplex_begin; top_face != simplex_end; ++top_face) { + for (auto top_face = simplices_begin; top_face != simplices_end; ++top_face) { auto subfaces_topface = subfaces(*top_face); simplices.insert(simplices.end(), subfaces_topface.begin(), subfaces_topface.end()); } diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h index 79a7ed79..1b7d58ff 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h @@ -206,21 +206,26 @@ void Skeleton_blocker_complex::remove_star(const Simplex& sig } template -void Skeleton_blocker_complex::add_simplex(const Simplex& sigma, bool insert_edges_of_sigma) { +void Skeleton_blocker_complex::add_simplex(const Simplex& sigma) { // to add a simplex s, all blockers included in s are first removed // and then all simplex in the coboundary of s are added as blockers assert(!this->contains(sigma)); assert(sigma.dimension() > 1); + if (!contains_vertices(sigma)) { + std::cerr << "add_simplex: Some vertices were not present in the complex, adding them" << std::endl; + size_t num_vertices_to_add = sigma.last_vertex() - this->num_vertices() + 1; + for (size_t i = 0; i < num_vertices_to_add; ++i) + this->add_vertex(); + } assert(contains_vertices(sigma)); - - if(insert_edges_of_sigma) + if(!contains_edges(sigma)) add_edge(sigma); - else - assert(contains_edges(sigma)); remove_blocker_include_in_simplex(sigma); add_blockers_after_simplex_insertion(sigma); } + + template void Skeleton_blocker_complex::add_blockers_after_simplex_insertion(Simplex sigma){ if(sigma.dimension() < 1) return; diff --git a/src/Skeleton_blocker/test/TestSimplifiable.cpp b/src/Skeleton_blocker/test/TestSimplifiable.cpp index 76d5ba89..b0855ce9 100644 --- a/src/Skeleton_blocker/test/TestSimplifiable.cpp +++ b/src/Skeleton_blocker/test/TestSimplifiable.cpp @@ -310,7 +310,7 @@ bool test_add_simplex4() { for (int k = 0; k < n; k++) s.add_vertex(Vertex_handle(k)); s.remove_vertex(Vertex_handle(i)); - complex.add_simplex(s, true); + complex.add_simplex(s); //at step i there is only blocker 0..i if (i < 2 && complex.num_blockers() > 0) diff --git a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp index 69abd279..42482e23 100644 --- a/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp +++ b/src/Skeleton_blocker/test/TestSkeletonBlockerComplex.cpp @@ -367,7 +367,7 @@ bool test_iterator_simplices4() { bool test_iterator_coboundary() { Complex c; build_complete(4, c); - c.remove_edge(Vertex_handle(0), Vertex_handle(2)); + c.remove_edge(Vertex_handle(1), Vertex_handle(3)); PRINT(c.to_string()); Simplex s02(Vertex_handle(0), Vertex_handle(2)); int n = 0; -- cgit v1.2.3 From c6c91153dde643af2c5b9c78a1b1b9b65349c292 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 16 Nov 2015 10:09:38 +0000 Subject: cpplint fixes before merge git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/skb_simplex_insertion_merge@923 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: de9fc0770d273730de876a6ed54646847362bc7d --- src/Contraction/example/Garland_heckbert.cpp | 14 +++--- .../example/Skeleton_blocker_link.cpp | 5 +- .../include/gudhi/Skeleton_blocker_complex.h | 58 +++++++++++----------- .../gudhi/Skeleton_blocker_simplifiable_complex.h | 29 ++++++----- 4 files changed, 53 insertions(+), 53 deletions(-) (limited to 'src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h') diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp index 681426e0..3ba9501b 100644 --- a/src/Contraction/example/Garland_heckbert.cpp +++ b/src/Contraction/example/Garland_heckbert.cpp @@ -145,13 +145,14 @@ class GH_visitor : public Gudhi::contraction::Contraction_visitor { int main(int argc, char *argv[]) { if (argc != 4) { - std::cerr << "Usage " << argv[0] << " input.off output.off N to load the file input.off, contract N edges and save the result to output.off.\n"; + std::cerr << "Usage " << argv[0] << + " input.off output.off N to load the file input.off, contract N edges and save the result to output.off.\n"; return EXIT_FAILURE; } Complex complex; typedef typename Complex::Vertex_handle Vertex_handle; - + // load the points Skeleton_blocker_off_reader off_reader(argv[1], complex); if (!off_reader.is_valid()) { @@ -159,9 +160,9 @@ int main(int argc, char *argv[]) { return EXIT_FAILURE; } - if(!complex.empty() && !complex.point(Vertex_handle(0)).dimension()==3) { + if (!complex.empty() && !(complex.point(Vertex_handle(0)).dimension() == 3)) { std::cerr << "Only points of dimension 3 are supported." << std::endl; - return EXIT_FAILURE; + return EXIT_FAILURE; } std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; @@ -175,8 +176,7 @@ int main(int argc, char *argv[]) { new GH_cost(complex), new GH_placement(complex), contraction::make_link_valid_contraction(), - new GH_visitor(complex) - ); + new GH_visitor(complex)); std::cout << "Contract " << num_contractions << " edges" << std::endl; contractor.contract_edges(num_contractions); @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) { complex.num_edges() << " edges and " << complex.num_triangles() << " triangles." << std::endl; - //write simplified complex + // write simplified complex Skeleton_blocker_off_writer off_writer(argv[2], complex); return EXIT_SUCCESS; diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp index 5e429728..698a8106 100644 --- a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp +++ b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp @@ -39,7 +39,7 @@ typedef Complex::Simplex Simplex; int main(int argc, char *argv[]) { // build a full complex with 4 vertices and 2^4-1 simplices - + // Create a complex with four vertices (0,1,2,3) Complex complex; @@ -64,7 +64,8 @@ int main(int argc, char *argv[]) { // To access to the initial vertices eg (0,1,2,3,4), Root_vertex_handle must be used. // For instance, to test if the link contains the vertex that was labeled i: for (int i = 0; i < 5; ++i) - cout << "link.contains_vertex(Root_vertex_handle(" << i << ")):" << link.contains_vertex(Root_vertex_handle(i)) << endl; + cout << "link.contains_vertex(Root_vertex_handle(" << i << ")):" << + link.contains_vertex(Root_vertex_handle(i)) << endl; return EXIT_SUCCESS; } diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h index cf156a58..6612722e 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h @@ -23,18 +23,6 @@ #ifndef SKELETON_BLOCKER_COMPLEX_H_ #define SKELETON_BLOCKER_COMPLEX_H_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include #include @@ -50,6 +38,18 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace Gudhi { namespace skbl { @@ -550,13 +550,13 @@ class Skeleton_blocker_complex { * the edges 01, 12, 20 but not the triangle 012 (and hence this complex * will contains a blocker 012). */ - Edge_handle add_edge(Vertex_handle a, Vertex_handle b) { - //if the edge is already there we musnt go further - //as we may add blockers that should not be here - if(contains_edge(a,b)) - return *((*this)[std::make_pair(a,b)]); - auto res = add_edge_without_blockers(a,b); - add_blockers_after_simplex_insertion(Simplex(a,b)); + Edge_handle add_edge(Vertex_handle a, Vertex_handle b) { + // if the edge is already there we musnt go further + // as we may add blockers that should not be here + if (contains_edge(a, b)) + return *((*this)[std::make_pair(a, b)]); + auto res = add_edge_without_blockers(a, b); + add_blockers_after_simplex_insertion(Simplex(a, b)); return res; } @@ -564,9 +564,9 @@ class Skeleton_blocker_complex { * @brief Adds all edges of s in the complex. */ void add_edge(const Simplex& s) { - for(auto i = s.begin(); i != s.end(); ++i) - for(auto j = i; ++j != s.end(); /**/) - add_edge(*i,*j); + for (auto i = s.begin(); i != s.end(); ++i) + for (auto j = i; ++j != s.end(); /**/) + add_edge(*i, *j); } /** @@ -596,9 +596,9 @@ class Skeleton_blocker_complex { * @brief Adds all edges of s in the complex without adding blockers. */ void add_edge_without_blockers(Simplex s) { - for(auto i = s.begin(); i != s.end(); ++i){ - for(auto j = i; ++j != s.end(); /**/) - add_edge_without_blockers(*i,*j); + for (auto i = s.begin(); i != s.end(); ++i) { + for (auto j = i; ++j != s.end(); /**/) + add_edge_without_blockers(*i, *j); } } @@ -1014,10 +1014,10 @@ class Skeleton_blocker_complex { * @brief returns the number of simplices of a given dimension in the complex. */ size_t num_simplices(unsigned dimension) const { - //todo iterator on k-simplices + // TODO(DS): iterator on k-simplices size_t res = 0; - for(const auto& s: complex_simplex_range()) - if(s.dimension() == dimension) + for (const auto& s : complex_simplex_range()) + if (s.dimension() == dimension) ++res; return res; } @@ -1585,7 +1585,7 @@ class Skeleton_blocker_complex { template Complex make_complex_from_top_faces(SimplexHandleIterator simplices_begin, SimplexHandleIterator simplices_end, bool is_flag_complex = false) { - //todo use add_simplex instead! should be more efficient and more elegant :) + // TODO(DS): use add_simplex instead! should be more efficient and more elegant :) typedef typename Complex::Simplex Simplex; std::vector simplices; for (auto top_face = simplices_begin; top_face != simplices_end; ++top_face) { diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h index 1b7d58ff..94a125c1 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h @@ -218,7 +218,7 @@ void Skeleton_blocker_complex::add_simplex(const Simplex& sig this->add_vertex(); } assert(contains_vertices(sigma)); - if(!contains_edges(sigma)) + if (!contains_edges(sigma)) add_edge(sigma); remove_blocker_include_in_simplex(sigma); add_blockers_after_simplex_insertion(sigma); @@ -227,10 +227,10 @@ void Skeleton_blocker_complex::add_simplex(const Simplex& sig template -void Skeleton_blocker_complex::add_blockers_after_simplex_insertion(Simplex sigma){ - if(sigma.dimension() < 1) return; +void Skeleton_blocker_complex::add_blockers_after_simplex_insertion(Simplex sigma) { + if (sigma.dimension() < 1) return; - for(auto s : coboundary_range(sigma)) { + for (auto s : coboundary_range(sigma)) { this->add_blocker(s); } } @@ -254,10 +254,10 @@ void Skeleton_blocker_complex::remove_blocker_containing_simp */ template void Skeleton_blocker_complex::remove_blocker_include_in_simplex(const Simplex& sigma) { - //todo write efficiently by using only superior blockers - //eg for all s, check blockers whose vertices are all greater than s + // TODO(DS): write efficiently by using only superior blockers + // eg for all s, check blockers whose vertices are all greater than s std::set blockers_to_remove; - for(auto s : sigma) { + for (auto s : sigma) { for (auto blocker : this->blocker_range(s)) { if (sigma.contains(*blocker)) blockers_to_remove.insert(blocker); @@ -266,11 +266,11 @@ void Skeleton_blocker_complex::remove_blocker_include_in_simp for (auto blocker_to_update : blockers_to_remove) { auto s = *blocker_to_update; this->delete_blocker(blocker_to_update); - //now if there is a vertex v in the link of s - //and v is not included in sigma then v.s is a blocker - //(all faces of v.s are there since v belongs to the link of s) - for(const auto& b : coboundary_range(s)) - if(!sigma.contains(b)) + // now if there is a vertex v in the link of s + // and v is not included in sigma then v.s is a blocker + // (all faces of v.s are there since v belongs to the link of s) + for (const auto& b : coboundary_range(s)) + if (!sigma.contains(b)) this->add_blocker(b); } } @@ -384,9 +384,8 @@ Skeleton_blocker_complex::contract_edge(Vertex_handle a, Vert } template -void -Skeleton_blocker_complex::get_blockers_to_be_added_after_contraction(Vertex_handle a, Vertex_handle b, - std::set& blockers_to_add) { +void Skeleton_blocker_complex::get_blockers_to_be_added_after_contraction(Vertex_handle a, + Vertex_handle b, std::set& blockers_to_add) { blockers_to_add.clear(); typedef Skeleton_blocker_link_complex > LinkComplexType; -- cgit v1.2.3