From 0cbf41493cee2b9bd598557b97df9b1211da2b9d Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 30 Jan 2020 18:04:20 +0100 Subject: Use mutex from stl instead of tbb one that is deprecated --- src/Nerve_GIC/include/gudhi/GIC.h | 8 ++++---- src/Tangential_complex/include/gudhi/Tangential_complex.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index a47d6889..2a6d4788 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -14,7 +14,7 @@ #ifdef GUDHI_USE_TBB #include -#include +#include #endif #include @@ -459,7 +459,7 @@ class Cover_complex { // This cannot be parallelized if thread_local is not defined // thread_local is not defined for XCode < v.8 #if defined(GUDHI_USE_TBB) && defined(GUDHI_CAN_USE_CXX11_THREAD_LOCAL) - tbb::mutex deltamutex; + std::mutex deltamutex; tbb::parallel_for(0, N, [&](int i){ std::vector samples(m); SampleWithoutReplacement(n, m, samples); @@ -765,7 +765,7 @@ class Cover_complex { #ifdef GUDHI_USE_TBB if (verbose) std::cout << "Computing connected components (parallelized)..." << std::endl; - tbb::mutex covermutex, idmutex; + std::mutex covermutex, idmutex; tbb::parallel_for(0, res, [&](int i){ // Compute connected components Graph G = one_skeleton.create_subgraph(); @@ -895,7 +895,7 @@ class Cover_complex { // Compute the geodesic distances to subsamples with Dijkstra #ifdef GUDHI_USE_TBB if (verbose) std::cout << "Computing geodesic distances (parallelized)..." << std::endl; - tbb::mutex coverMutex; tbb::mutex mindistMutex; + std::mutex coverMutex; std::mutex mindistMutex; tbb::parallel_for(0, m, [&](int i){ int seed = voronoi_subsamples[i]; std::vector dmap(n); diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index f058fa9f..f007bdd5 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -60,7 +60,7 @@ #ifdef GUDHI_USE_TBB #include #include -#include +#include #endif // #define GUDHI_TC_EXPORT_NORMALS // Only for 3D surfaces (k=2, d=3) @@ -147,7 +147,7 @@ class Tangential_complex { typedef typename Tr_traits::Vector_d Tr_vector; #if defined(GUDHI_USE_TBB) - typedef tbb::mutex Mutex_for_perturb; + typedef std::mutex Mutex_for_perturb; typedef Vector Translation_for_perturb; typedef std::vector > Weights; #else -- cgit v1.2.3 From 59116c450bf912a4b446b02e55278f3ec55a90ee Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Mon, 3 Feb 2020 18:48:36 +0100 Subject: Contradictory requirements for CGAL --- src/python/doc/alpha_complex_sum.inc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/python/doc/alpha_complex_sum.inc b/src/python/doc/alpha_complex_sum.inc index a1184663..b5af0d27 100644 --- a/src/python/doc/alpha_complex_sum.inc +++ b/src/python/doc/alpha_complex_sum.inc @@ -5,16 +5,13 @@ | .. figure:: | Alpha complex is a simplicial complex constructed from the finite | :Author: Vincent Rouvreau | | ../../doc/Alpha_complex/alpha_complex_representation.png | cells of a Delaunay Triangulation. | | | :alt: Alpha complex representation | | :Introduced in: GUDHI 2.0.0 | - | :figclass: align-center | The filtration value of each simplex is computed as the square of the | | - | | circumradius of the simplex if the circumsphere is empty (the simplex | :Copyright: MIT (`GPL v3 `_) | - | | is then said to be Gabriel), and as the minimum of the filtration | | - | | values of the codimension 1 cofaces that make it not Gabriel | :Requires: `Eigen `__ :math:`\geq` 3.1.0 and `CGAL `__ :math:`\geq` 4.11.0 | - | | otherwise. All simplices that have a filtration value | | - | | :math:`> \alpha^2` are removed from the Delaunay complex | | - | | when creating the simplicial complex if it is specified. | | + | :figclass: align-center | The filtration value of each simplex is computed as the **square** of | | + | | the circumradius of the simplex if the circumsphere is empty (the | :Copyright: MIT (`GPL v3 `_) | + | | simplex is then said to be Gabriel), and as the minimum of the | | + | | filtration values of the codimension 1 cofaces that make it not | :Requires: `Eigen `__ :math:`\geq` 3.1.0 and `CGAL `__ :math:`\geq` 4.11.0 | + | | Gabriel otherwise. | | | | | | - | | This package requires having CGAL version 4.7 or higher (4.8.1 is | | - | | advised for better performance). | | + | | For performances reasons, it is advised to use CGAL ≥ 5.0.0. | | +----------------------------------------------------------------+------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ | * :doc:`alpha_complex_user` | * :doc:`alpha_complex_ref` | +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -- cgit v1.2.3 From 08596f907e5b4fb99a5c9d51799f54f1b0535071 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Tue, 4 Feb 2020 18:05:42 +0100 Subject: Fix #186 - Link with TBB for all simplex tree user --- src/Simplex_tree/example/CMakeLists.txt | 3 +++ src/Witness_complex/example/CMakeLists.txt | 10 +++++++++- src/common/doc/installation.h | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt index f99b164c..8a8cac58 100644 --- a/src/Simplex_tree/example/CMakeLists.txt +++ b/src/Simplex_tree/example/CMakeLists.txt @@ -16,6 +16,9 @@ endif() add_test(NAME Simplex_tree_example_simple_simplex_tree COMMAND $) add_executable ( Simplex_tree_example_mini_simplex_tree mini_simplex_tree.cpp ) +if (TBB_FOUND) + target_link_libraries(Simplex_tree_example_mini_simplex_tree ${TBB_LIBRARIES}) +endif() add_test(NAME Simplex_tree_example_mini_simplex_tree COMMAND $) # An example with Simplex-tree using CGAL alpha_shapes_3 diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index 5860f3a3..2659798e 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -12,10 +12,18 @@ install(TARGETS Witness_complex_example_nearest_landmark_table DESTINATION bin) # CGAL and Eigen3 are required for Euclidean version of Witness if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0) add_executable( Witness_complex_example_off example_witness_complex_off.cpp ) + if (TBB_FOUND) + target_link_libraries(Witness_complex_example_off ${TBB_LIBRARIES}) + endif() add_executable ( Witness_complex_example_sphere example_witness_complex_sphere.cpp ) + if (TBB_FOUND) + target_link_libraries(Witness_complex_example_sphere ${TBB_LIBRARIES}) + endif() add_executable( Witness_complex_example_strong_off example_strong_witness_complex_off.cpp ) - target_link_libraries(Witness_complex_example_strong_off) + if (TBB_FOUND) + target_link_libraries(Witness_complex_example_strong_off ${TBB_LIBRARIES}) + endif() add_test(NAME Witness_complex_example_off_test_torus COMMAND $ diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h index ce2c5448..c2da1ba0 100644 --- a/src/common/doc/installation.h +++ b/src/common/doc/installation.h @@ -204,6 +204,8 @@ make doxygen * Nerve_GIC/Nerve.cpp * \li * Nerve_GIC/VoronoiGIC.cpp + * \li + * Simplex_tree/mini_simplex_tree.cpp * \li * Simplex_tree/simple_simplex_tree.cpp * \li @@ -244,6 +246,12 @@ make doxygen * Witness_complex/weak_witness_persistence.cpp * \li * Witness_complex/example_nearest_landmark_table.cpp + * \li + * Witness_complex/example_strong_witness_complex_off.cpp + * \li + * Witness_complex/example_witness_complex_off.cpp + * \li + * Witness_complex/example_witness_complex_sphere.cpp * * \section Contributions Bug reports and contributions * Please help us improving the quality of the GUDHI library. You may report bugs or suggestions to: -- cgit v1.2.3 From fd6db1cb3c60199b0c7c0eafd4d10e527a505ac3 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Tue, 4 Feb 2020 21:58:52 +0100 Subject: Code review: Rollback installation as these examples are not optimized with TBB --- src/common/doc/installation.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h index c2da1ba0..ce2c5448 100644 --- a/src/common/doc/installation.h +++ b/src/common/doc/installation.h @@ -204,8 +204,6 @@ make doxygen * Nerve_GIC/Nerve.cpp * \li * Nerve_GIC/VoronoiGIC.cpp - * \li - * Simplex_tree/mini_simplex_tree.cpp * \li * Simplex_tree/simple_simplex_tree.cpp * \li @@ -246,12 +244,6 @@ make doxygen * Witness_complex/weak_witness_persistence.cpp * \li * Witness_complex/example_nearest_landmark_table.cpp - * \li - * Witness_complex/example_strong_witness_complex_off.cpp - * \li - * Witness_complex/example_witness_complex_off.cpp - * \li - * Witness_complex/example_witness_complex_sphere.cpp * * \section Contributions Bug reports and contributions * Please help us improving the quality of the GUDHI library. You may report bugs or suggestions to: -- cgit v1.2.3