From 409874ad0812c863a924bd4482d76c718620c0b9 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 21 Sep 2017 06:22:19 +0000 Subject: Add some comments for readability git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_automatic_dimension_set@2697 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 986cc3b862ceca993a6fdd8cdee6da2c1ed4cc14 --- src/Simplex_tree/include/gudhi/Simplex_tree.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index dc684594..5d1885b8 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -1204,6 +1204,7 @@ class Simplex_tree { */ bool auto_dimension_set(int old_dimension) { int new_dimension = -1; + // Browse the tree from te left to the right as higher dimension cells are more likely on the left part of the tree for (Simplex_handle sh : skeleton_simplex_range(old_dimension)) { #ifdef DEBUG_TRACES for (auto vertex : simplex_vertex_range(sh)) { @@ -1214,6 +1215,7 @@ class Simplex_tree { int sh_dimension = dimension(sh); if (sh_dimension >= old_dimension) + // Stop browsing as soon as the dimension is reached, no need to go furter return false; new_dimension = std::max(new_dimension, sh_dimension); } -- cgit v1.2.3