summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-07 22:13:45 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-03-07 22:13:45 +0000
commitfe917a0676a7b819782f5294565951dca8212776 (patch)
tree85ca37449b35565f5737743abdede921f1ad47f9
parentf533530d03ba2ea6232d768c205eba4ccb20e2ad (diff)
parent877c7f1580b2a84dd89b9fb2d5920a21af014b20 (diff)
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2174 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 50c9f69ac71c817ed8b9e61b81be6547bf89a4b0
-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