From 8d7329f3e5ad843e553c3c5503cecc28ef2eead6 Mon Sep 17 00:00:00 2001 From: Gard Spreemann Date: Thu, 20 Apr 2017 11:10:45 +0200 Subject: GUDHI 2.0.0 as released by upstream in a tarball. --- include/gudhi/Skeleton_blocker_complex.h | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'include/gudhi/Skeleton_blocker_complex.h') diff --git a/include/gudhi/Skeleton_blocker_complex.h b/include/gudhi/Skeleton_blocker_complex.h index 7a6d1d50..4f052ba5 100644 --- a/include/gudhi/Skeleton_blocker_complex.h +++ b/include/gudhi/Skeleton_blocker_complex.h @@ -4,7 +4,7 @@ * * Author(s): David Salinas * - * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France) + * Copyright (C) 2014 INRIA * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -211,7 +211,6 @@ class Skeleton_blocker_complex { add_edge_without_blockers(e.first, e.second); } - template void add_blockers(SimpleHandleOutputIterator simplices_begin, SimpleHandleOutputIterator simplices_end) { Tries tries(num_vertices(), simplices_begin, simplices_end); @@ -414,7 +413,8 @@ class Skeleton_blocker_complex { /** */ bool contains_vertex(Vertex_handle u) const { - if (u.vertex < 0 || u.vertex >= boost::num_vertices(skeleton)) + Vertex_handle num_vertices(boost::num_vertices(skeleton)); + if (u.vertex < 0 || u.vertex >= num_vertices) return false; return (*this)[u].is_active(); } @@ -441,11 +441,11 @@ class Skeleton_blocker_complex { * @brief Given an Id return the address of the vertex having this Id in the complex. * @remark For a simplicial complex, the address is the id but it may not be the case for a SubComplex. */ - virtual boost::optional get_address( - Root_vertex_handle id) const { + virtual boost::optional get_address(Root_vertex_handle id) const { boost::optional res; - if (id.vertex < boost::num_vertices(skeleton)) - res = Vertex_handle(id.vertex); // xxx + int num_vertices = boost::num_vertices(skeleton); + if (id.vertex < num_vertices) + res = Vertex_handle(id.vertex); return res; } @@ -560,7 +560,7 @@ class Skeleton_blocker_complex { return res; } - /** + /** * @brief Adds all edges of s in the complex. */ void add_edge(const Simplex& s) { @@ -591,7 +591,6 @@ class Skeleton_blocker_complex { return *edge_handle; } - /** * @brief Adds all edges of s in the complex without adding blockers. */ @@ -844,12 +843,13 @@ class Skeleton_blocker_complex { boost_adjacency_iterator ai, ai_end; for (tie(ai, ai_end) = adjacent_vertices(v.vertex, skeleton); ai != ai_end; ++ai) { + Vertex_handle value(*ai); if (keep_only_superior) { - if (*ai > v.vertex) { - n.add_vertex(Vertex_handle(*ai)); + if (value > v.vertex) { + n.add_vertex(value); } } else { - n.add_vertex(Vertex_handle(*ai)); + n.add_vertex(value); } } } @@ -929,7 +929,7 @@ class Skeleton_blocker_complex { // xxx rename get_address et place un using dans sub_complex boost::optional get_simplex_address( - const Root_simplex_handle& s) const { + const Root_simplex_handle& s) const { boost::optional res; Simplex s_address; @@ -1001,10 +1001,9 @@ 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()); @@ -1012,8 +1011,8 @@ class Skeleton_blocker_complex { /* * @brief returns the number of simplices of a given dimension in the complex. - */ - size_t num_simplices(unsigned dimension) const { + */ + size_t num_simplices(int dimension) const { // TODO(DS): iterator on k-simplices size_t res = 0; for (const auto& s : complex_simplex_range()) -- cgit v1.2.3