diff options
author | anmoreau <anmoreau@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-24 08:49:50 +0000 |
---|---|---|
committer | anmoreau <anmoreau@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-24 08:49:50 +0000 |
commit | a602092b3437afb3271196f21dea4f4e944436c3 (patch) | |
tree | ec3e85035562ea40a8d68dcfcd0a40b65ea133d1 /src | |
parent | 39dbac0617b4a542f47225a9dcf6f088a12be5be (diff) |
Multiple fix
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/coface@637 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: d44b4ced5406c0b8ab305ec752077f9b5c242d4d
Diffstat (limited to 'src')
-rw-r--r-- | src/Simplex_tree/include/gudhi/Simplex_tree.h | 16 | ||||
-rw-r--r-- | src/Simplex_tree/test/simplex_tree_unit_test.cpp | 2 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index ad9f7dd7..4dee1432 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -157,11 +157,7 @@ class Simplex_tree { /** \brief Range over the vertices of a simplex. */ typedef boost::iterator_range<Simplex_vertex_iterator> Simplex_vertex_range; /** \brief Range over the cofaces of a simplex. */ - /** \brief Iterator over the cofaces of a simplex. - * - * 'value_type' is Vertex_handle. */ - typedef typename std::vector<Simplex_handle>::iterator Coface_simplex_iterator; - typedef boost::iterator_range<Coface_simplex_iterator> Coface_simplex_range; + typedef std::vector<Simplex_handle> Coface_simplex_range; /** \brief Iterator over the simplices of the boundary of a simplex. * * 'value_type' is Simplex_handle. */ @@ -397,7 +393,7 @@ class Simplex_tree { /** \brief Returns true iff the node in the simplex tree pointed by * sh has children.*/ - bool has_children(Dit_value_t sh) { + bool has_children(Dit_value_t & sh) { return (sh.second.children()->parent() == sh.first); } @@ -685,7 +681,7 @@ public: */ Coface_simplex_range star_simplex_range(const Simplex_handle simplex) { - return coface_simplex_range(simplex, 0); + return cofaces_simplex_range(simplex, 0); } @@ -696,8 +692,8 @@ public: * \return Vector of Simplex_handle, empty vector if no cofaces found. */ - Coface_simplex_range coface_simplex_range(const Simplex_handle simplex, int codimension) { - std::vector<Simplex_handle> cofaces; + Coface_simplex_range cofaces_simplex_range(const Simplex_handle simplex, int codimension) { + Coface_simplex_range cofaces; assert (codimension >= 0); // codimension must be positive or null integer Simplex_vertex_range rg = simplex_vertex_range(simplex); std::vector<Vertex_handle> copy(rg.begin(), rg.end()); @@ -706,7 +702,7 @@ public: assert(std::is_sorted(copy.begin(), copy.end(), std::greater<Vertex_handle>())); // must be sorted in decreasing order std::vector<Vertex_handle> res; rec_coface(copy, &root_, res, cofaces, (int)copy.size(), codimension + (int)copy.size()); - return Coface_simplex_range(cofaces.begin(), cofaces.end()); + return cofaces; } diff --git a/src/Simplex_tree/test/simplex_tree_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_unit_test.cpp index 344cb009..968a67b3 100644 --- a/src/Simplex_tree/test/simplex_tree_unit_test.cpp +++ b/src/Simplex_tree/test/simplex_tree_unit_test.cpp @@ -179,7 +179,7 @@ void test_cofaces(typeST& st, std::vector<Vertex_handle> v, int dim, std::vector if (dim == 0) cofaces = st.star_simplex_range(st.find(v)); else - cofaces = st.coface_simplex_range(st.find(v), dim); + cofaces = st.cofaces_simplex_range(st.find(v), dim); for (auto simplex = cofaces.begin(); simplex != cofaces.end(); ++simplex) { typeST::Simplex_vertex_range rg = st.simplex_vertex_range(*simplex); |