summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoranmoreau <anmoreau@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-07-06 15:22:36 +0000
committeranmoreau <anmoreau@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-07-06 15:22:36 +0000
commit51192ba9c5991a4d232417dd49ce15a14b400599 (patch)
tree78e4c66d60bb0aa61a10e8b6fba174cc4a17999c /src
parent6930f8cebfbea8678603bc55e4eea293d2e3e902 (diff)
Fix
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/coface@683 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: c15bed57474202a9bf05aabc7eb33ac1b3c32a41
Diffstat (limited to 'src')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index cb189d76..f2b726f9 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -611,49 +611,49 @@ private:
/** Recursive search of cofaces
* This function uses DFS
*\param vertices contains a list of vertices, which represent the vertices of the simplex not found yet.
- *\param curr_res represents the number of vertices of the simplex found.
+ *\param curr_nbVertices represents the number of vertices of the simplex found.
*\param cofaces contains a list of Simplex_handle, representing all the cofaces asked.
*\param length number of vertices in the Simplex_handle of which we search the cofaces.
*\param nbVertices number of vertices of the cofaces we search
* Prefix actions : When the bottom vertex matches with the current vertex in the tree, we remove the bottom vertex from vertices.
* Infix actions : Then we call or not the recursion.
- * Postfix actions : Finally, we add back the removed vertex into vertices, and remove this vertex from curr_res so that we didn't change the parameters.
- * If the vertices list is empty, we need to check if curr_res matches with the dimension of the cofaces asked.
+ * Postfix actions : Finally, we add back the removed vertex into vertices, and remove this vertex from curr_nbVertices so that we didn't change the parameters.
+ * If the vertices list is empty, we need to check if curr_nbVertices matches with the dimension of the cofaces asked.
*/
- void rec_coface(std::vector<Vertex_handle> &vertices, Siblings *curr_sib, int curr_res, std::vector<Simplex_handle>& cofaces, int length, int nbVertices)
+ void rec_coface(std::vector<Vertex_handle> &vertices, Siblings *curr_sib, int curr_nbVertices, std::vector<Simplex_handle>& cofaces, int length, int nbVertices)
{
bool star = nbVertices == length;
- if (!(star || curr_res <= nbVertices)) // dimension of actual simplex <= nbVertices
+ if (!(star || curr_nbVertices <= nbVertices)) // dimension of actual simplex <= nbVertices
return;
- curr_res++;
+ curr_nbVertices++;
for (Simplex_handle simplex = curr_sib->members().begin(); simplex != curr_sib->members().end(); ++simplex)
{
if (vertices.empty())
{
// If we reached the end of the vertices, and the simplex has more vertices than the given simplex, we found a coface
- bool addCoface = (star || curr_res == nbVertices); // dimension of actual simplex == nbVertices
+ bool addCoface = (star || curr_nbVertices == nbVertices); // dimension of actual simplex == nbVertices
if (addCoface)
cofaces.push_back(simplex);
if ((!addCoface || star) && has_children(simplex)) // Rec call
- rec_coface(vertices, simplex->second.children(), curr_res, cofaces, length, nbVertices);
- curr_res--;
+ rec_coface(vertices, simplex->second.children(), curr_nbVertices, cofaces, length, nbVertices);
+ curr_nbVertices--;
}
else
{
if (simplex->first == vertices.back()) // If curr_sib matches with the top vertex
{
- bool equalDim = (star || curr_res == nbVertices); // dimension of actual simplex == nbVertices
- bool addCoface = vertices.size() == 1 && curr_res > length && equalDim;
+ bool equalDim = (star || curr_nbVertices == nbVertices); // dimension of actual simplex == nbVertices
+ bool addCoface = vertices.size() == 1 && curr_nbVertices > length && equalDim;
if (addCoface)
cofaces.push_back(simplex);
if ((!addCoface || star) && has_children(simplex))
{ // Rec call
Vertex_handle tmp = vertices.back();
vertices.pop_back();
- rec_coface(vertices, simplex->second.children(), curr_res, cofaces, length, nbVertices);
+ rec_coface(vertices, simplex->second.children(), curr_nbVertices, cofaces, length, nbVertices);
vertices.push_back(tmp);
}
- curr_res--;
+ curr_nbVertices--;
}
else if (simplex->first > vertices.back())
return;
@@ -661,8 +661,8 @@ private:
{
if (has_children(simplex))
{
- rec_coface(vertices, simplex->second.children(), curr_res, cofaces, length, nbVertices);
- curr_res--;
+ rec_coface(vertices, simplex->second.children(), curr_nbVertices, cofaces, length, nbVertices);
+ curr_nbVertices--;
}
}
}