summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
diff options
context:
space:
mode:
authorcjamin <cjamin@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-02 16:06:41 +0000
committercjamin <cjamin@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-02 16:06:41 +0000
commit9bd1ad1f36ceb729240cac67f4889645859a1b18 (patch)
tree594ff2ba22144e5affde45f7843b151e6f0a29a4 /src/Bottleneck_distance/include/gudhi/Persistence_graph.h
parent5a4eae551b60427a7a27111bf8c43f04bc550d36 (diff)
Use parallel_sort to sort distances
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/botteleneck-parallel-sort@2134 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b3a43683ab1d452845138605488a845a4b694432
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Persistence_graph.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
index c7695112..44f4b827 100644
--- a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
+++ b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
@@ -25,6 +25,10 @@
#include <gudhi/Internal_point.h>
+#ifdef GUDHI_USE_TBB
+#include <tbb/parallel_sort.h>
+#endif
+
#include <vector>
#include <algorithm>
#include <limits> // for numeric_limits
@@ -144,7 +148,11 @@ inline std::vector<double> Persistence_graph::sorted_distances() const {
for (int v_point_index = 0; v_point_index < size(); ++v_point_index)
distances.push_back(distance(u_point_index, v_point_index));
}
+#ifdef GUDHI_USE_TBB
+ tbb::parallel_sort(distances.begin(), distances.end());
+#else
std::sort(distances.begin(), distances.end());
+#endif
return distances;
}