From 7a8800cd5b94201cba53458897cad23856e3d3ee Mon Sep 17 00:00:00 2001 From: anmoreau Date: Thu, 18 Jun 2015 08:33:57 +0000 Subject: Fix : name of parameters and functions git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/coface@622 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 15c8419159a268dcb5b8bbfa63fb01adc8851905 --- src/Simplex_tree/include/gudhi/Simplex_tree.h | 18 +++++++++--------- src/Simplex_tree/test/simplex_tree_unit_test.cpp | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/Simplex_tree') diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index 26a8eba6..eb423082 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -627,7 +627,7 @@ private: curr_res->push_back(sib->first); bool egalDim = (codimension == length || curr_res->size() == codimension); // dimension of actual simplex == codimension if (egalDim) - cofaces.push_back(find(*curr_res)); + cofaces.push_back(curr_sib->members().find(sib->first)); if (has_children(sib)) rec_coface(vertices, sib->second.children(), curr_res, cofaces, length, codimension); curr_res->pop_back(); @@ -640,7 +640,7 @@ private: curr_res->push_back(sib->first); bool egalDim = (codimension == length || curr_res->size() == codimension); // dimension of actual simplex == codimension if (vertices.size() == 1 && curr_res->size() > length && egalDim) - cofaces.push_back(find(*curr_res)); + cofaces.push_back(curr_sib->members().find(sib->first)); if (has_children(sib)) { // Rec call Vertex_handle tmp = vertices[vertices.size()-1]; @@ -665,33 +665,33 @@ private: public: /** \brief Compute the star of a n simplex - * \param vertices handles the simplex of which we search the star + * \param simplex handles the simplex of which we search the star * \return Vector of Simplex_handle, empty vector if no cofaces found. */ - std::vector star(const Simplex_handle &vertices) { - return coface(vertices, 0); + std::vector star_simplex_range(const Simplex_handle simplex) { + return cofaces_simplex_range(simplex, 0); } /** \brief Compute the cofaces of a n simplex - * \param vertices handles the n-simplex of which we search the n+codimension cofaces + * \param simplex handles the n-simplex of which we search the n+codimension cofaces * \param codimension The function returns the n+codimension-cofaces of the n-simplex. If codimension = 0, return all cofaces (equivalent of star function) * \return Vector of Simplex_handle, empty vector if no cofaces found. * \warning n+codimension must be lower than Simplex_tree dimension, otherwise an an empty vector is returned. */ - std::vector coface(const Simplex_handle &vertices, int codimension) { + std::vector cofaces_simplex_range(const Simplex_handle simplex, int codimension) { std::vector cofaces; if (dimension_ == -1) // Empty simplex tree return cofaces; - if (vertices == null_simplex()) // Empty simplex + if (simplex == null_simplex()) // Empty simplex return cofaces; if (codimension < 0) // codimension must be positive or null integer return cofaces; std::vector copy; - Simplex_vertex_range rg = simplex_vertex_range(vertices); + Simplex_vertex_range rg = simplex_vertex_range(simplex); for (auto it = rg.begin(); it != rg.end(); ++it) copy.push_back(*it); if (codimension + copy.size() > (unsigned long)(dimension_ + 1) || (codimension == 0 && copy.size() > (unsigned long)dimension_) ) // n+codimension greater than dimension_ diff --git a/src/Simplex_tree/test/simplex_tree_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_unit_test.cpp index eaae4149..f8de1c24 100644 --- a/src/Simplex_tree/test/simplex_tree_unit_test.cpp +++ b/src/Simplex_tree/test/simplex_tree_unit_test.cpp @@ -178,9 +178,9 @@ void test_cofaces(typeST& st, std::vector v, int dim, std::vector { std::vector cofaces; if (dim == 0) - cofaces = st.star(st.find(v)); + cofaces = st.star_simplex_range(st.find(v)); else - cofaces = st.coface(st.find(v), dim); + cofaces = st.cofaces_simplex_range(st.find(v), dim); std::vector currentVertices; for (unsigned long i = 0; i < cofaces.size(); ++i) { -- cgit v1.2.3