summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-07 22:14:35 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-07 22:14:35 +0000
commit9cb13407792cfaea1e19779be2938bf2494351f1 (patch)
treeb82d85eb0bfaaae72797dcc322af6caa3ce58a93 /src/Bottleneck_distance
parentfd510e6380ec12f3c909ccff5ee78dd7d13b8855 (diff)
parent877c7f1580b2a84dd89b9fb2d5920a21af014b20 (diff)
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/gudhi_doc_2.0.0@2175 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b9b7b4ead23265e8d94ff2fdbae1df2a0d675c92
Diffstat (limited to 'src/Bottleneck_distance')
-rw-r--r--src/Bottleneck_distance/benchmark/CMakeLists.txt3
-rw-r--r--src/Bottleneck_distance/example/CMakeLists.txt2
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h8
-rw-r--r--src/Bottleneck_distance/test/CMakeLists.txt3
4 files changed, 16 insertions, 0 deletions
diff --git a/src/Bottleneck_distance/benchmark/CMakeLists.txt b/src/Bottleneck_distance/benchmark/CMakeLists.txt
index 355e8d31..c99e0373 100644
--- a/src/Bottleneck_distance/benchmark/CMakeLists.txt
+++ b/src/Bottleneck_distance/benchmark/CMakeLists.txt
@@ -7,5 +7,8 @@ project(Bottleneck_distance_benchmark)
if(CGAL_FOUND)
if (NOT CGAL_VERSION VERSION_LESS 4.8.0)
add_executable ( bottleneck_chrono bottleneck_chrono.cpp )
+ if (TBB_FOUND)
+ target_link_libraries(bottleneck_chrono ${TBB_LIBRARIES})
+ endif(TBB_FOUND)
endif ()
endif()
diff --git a/src/Bottleneck_distance/example/CMakeLists.txt b/src/Bottleneck_distance/example/CMakeLists.txt
index b36d0f34..55f22c01 100644
--- a/src/Bottleneck_distance/example/CMakeLists.txt
+++ b/src/Bottleneck_distance/example/CMakeLists.txt
@@ -13,6 +13,8 @@ if(CGAL_FOUND)
add_executable (alpha_rips_persistence_bottleneck_distance alpha_rips_persistence_bottleneck_distance.cpp)
target_link_libraries(alpha_rips_persistence_bottleneck_distance ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
if (TBB_FOUND)
+ target_link_libraries(bottleneck_read_file_example ${TBB_LIBRARIES})
+ target_link_libraries(bottleneck_basic_example ${TBB_LIBRARIES})
target_link_libraries(alpha_rips_persistence_bottleneck_distance ${TBB_LIBRARIES})
endif(TBB_FOUND)
add_test(alpha_rips_persistence_bottleneck_distance ${CMAKE_CURRENT_BINARY_DIR}/alpha_rips_persistence_bottleneck_distance
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;
}
diff --git a/src/Bottleneck_distance/test/CMakeLists.txt b/src/Bottleneck_distance/test/CMakeLists.txt
index 6c8f112d..3e61f4cf 100644
--- a/src/Bottleneck_distance/test/CMakeLists.txt
+++ b/src/Bottleneck_distance/test/CMakeLists.txt
@@ -17,6 +17,9 @@ if(CGAL_FOUND)
if (NOT CGAL_VERSION VERSION_LESS 4.8.0)
add_executable ( bottleneckUT bottleneck_unit_test.cpp )
target_link_libraries(bottleneckUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ if (TBB_FOUND)
+ target_link_libraries(bottleneckUT ${TBB_LIBRARIES})
+ endif(TBB_FOUND)
# Unitary tests
add_test(NAME bottleneckUT COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bottleneckUT