summaryrefslogtreecommitdiff
path: root/src/Simplex_tree/include
diff options
context:
space:
mode:
authorglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-16 15:25:35 +0000
committerglisse <glisse@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-10-16 15:25:35 +0000
commit52dbe195ea62ca333c7e6834d9b92e4d9e5557ea (patch)
treedef7e62c5ed8638312cd1dd36e1c17541fb5caf3 /src/Simplex_tree/include
parent3b207ee6e103da2d46fa212702fefad00fa79d10 (diff)
Sort in parallel in initialize_filtration using TBB.
No build machinery support for now. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tbb@858 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 94071e9da20993dff60743ac75125f26ad62e55e
Diffstat (limited to 'src/Simplex_tree/include')
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index 4c6a95e8..edb1d7c9 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -35,6 +35,10 @@
#include <boost/iterator/transform_iterator.hpp>
#include <boost/graph/adjacency_list.hpp>
+#ifdef GUDHI_USE_TBB
+#include <tbb/parallel_sort.h>
+#endif
+
#include <algorithm>
#include <utility>
#include <vector>
@@ -788,8 +792,12 @@ class Simplex_tree {
* heuristic consists in inserting the cofaces of a simplex as soon as
* possible.
*/
+#ifdef GUDHI_USE_TBB
+ tbb::parallel_sort(filtration_vect_, is_before_in_filtration(this));
+#else
std::stable_sort(filtration_vect_.begin(), filtration_vect_.end(),
is_before_in_filtration(this));
+#endif
}
private: