summaryrefslogtreecommitdiff
path: root/src/Simplex_tree/include/gudhi
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-11-09 11:58:11 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-11-09 11:58:11 +0000
commit97364487c2d4b687865b57a90169d78d803d9710 (patch)
tree6661ca38aa7e5d4f382d44bcc11dd7be0f8614bf /src/Simplex_tree/include/gudhi
parent03b68a5206201bf5bbffb7e4f6a6718907f23b2a (diff)
parent72f647ad4b802d08072925a374324e7ace4b2c4d (diff)
Backmerge from trunk.
Alpha complex code review. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@894 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 702c4d667de4e7191d1050e6d855d2f79117f954
Diffstat (limited to 'src/Simplex_tree/include/gudhi')
-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 1ca43ff9..35d839e2 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -778,12 +778,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() {
@@ -792,7 +786,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));
}