summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-14 11:19:12 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-14 11:19:12 +0000
commitd0938e30da46a8ef0ad2e58ca57ab8df64454831 (patch)
treecc1c4e6b56908148abee5c2476f5fb5351133720
parent6fd64ffb734f09eeb40aade1efa2e03666eb65b9 (diff)
Update old comment about stable_sort.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@856 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 20773a87a3a40113ad8a051be7972289144cd1d7
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index 6e51d107..4c6a95e8 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -771,12 +771,6 @@ class Simplex_tree {
* assigned a Simplex_key corresponding to its order in the filtration (from 0 to m-1 for a
* simplicial complex with m simplices).
*
- * The use of a depth-first traversal of the simplex tree, provided by
- * complex_simplex_range(), combined with
- * a stable sort is meant to optimize the order of simplices with same
- * filtration value. The heuristic consists in inserting the cofaces of a
- * simplex as soon as possible.
- *
* Will be automatically called when calling filtration_simplex_range()
* if the filtration has never been initialized yet. */
void initialize_filtration() {
@@ -785,7 +779,15 @@ class Simplex_tree {
for (Simplex_handle sh : complex_simplex_range())
filtration_vect_.push_back(sh);
- // the stable sort ensures the ordering heuristic
+ /* We use stable_sort here because with libstdc++ it is faster than sort.
+ * is_before_in_filtration is now a total order, but we used to call
+ * stable_sort for the following heuristic:
+ * The use of a depth-first traversal of the simplex tree, provided by
+ * complex_simplex_range(), combined with a stable sort is meant to
+ * optimize the order of simplices with same filtration value. The
+ * heuristic consists in inserting the cofaces of a simplex as soon as
+ * possible.
+ */
std::stable_sort(filtration_vect_.begin(), filtration_vect_.end(),
is_before_in_filtration(this));
}