summaryrefslogtreecommitdiff
path: root/src/Bitmap_cubical_complex
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-31 13:03:58 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-31 13:03:58 +0000
commitd29bdae1281bb2b9b9778365c5dc3d44cffa4de4 (patch)
treec4353f07c7aacf4e90bd544f3a951014f074d3af /src/Bitmap_cubical_complex
parent001f501ffa371fc810d4f24812d26845bd61f349 (diff)
Fix TBB issue in CMake
Add TBB in Doxygen git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/Doxygen_for_GUDHI_1.3.0@1086 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: e3d3251431193d21ebf9344c230d12df624cd905
Diffstat (limited to 'src/Bitmap_cubical_complex')
-rw-r--r--src/Bitmap_cubical_complex/example/CMakeLists.txt15
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h3
-rw-r--r--src/Bitmap_cubical_complex/test/CMakeLists.txt3
3 files changed, 17 insertions, 4 deletions
diff --git a/src/Bitmap_cubical_complex/example/CMakeLists.txt b/src/Bitmap_cubical_complex/example/CMakeLists.txt
index 8f9cfa80..ad86b763 100644
--- a/src/Bitmap_cubical_complex/example/CMakeLists.txt
+++ b/src/Bitmap_cubical_complex/example/CMakeLists.txt
@@ -2,16 +2,25 @@ cmake_minimum_required(VERSION 2.6)
project(GUDHIBitmap)
add_executable ( Bitmap_cubical_complex Bitmap_cubical_complex.cpp )
-target_link_libraries(Bitmap_cubical_complex ${Boost_SYSTEM_LIBRARY})
+target_link_libraries(Bitmap_cubical_complex ${Boost_SYSTEM_LIBRARY})
+if (TBB_FOUND)
+ target_link_libraries(Bitmap_cubical_complex ${TBB_RELEASE_LIBRARY})
+endif()
add_test(Bitmap_cubical_complex_one_sphere ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex ${CMAKE_SOURCE_DIR}/data/bitmap/CubicalOneSphere.txt)
add_test(Bitmap_cubical_complex_two_sphere ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex ${CMAKE_SOURCE_DIR}/data/bitmap/CubicalTwoSphere.txt)
add_executable ( Random_bitmap_cubical_complex Random_bitmap_cubical_complex.cpp )
-target_link_libraries(Random_bitmap_cubical_complex ${Boost_SYSTEM_LIBRARY})
+target_link_libraries(Random_bitmap_cubical_complex ${Boost_SYSTEM_LIBRARY})
+if (TBB_FOUND)
+ target_link_libraries(Random_bitmap_cubical_complex ${TBB_RELEASE_LIBRARY})
+endif()
add_test(Random_bitmap_cubical_complex ${CMAKE_CURRENT_BINARY_DIR}/Random_bitmap_cubical_complex 2 100 100)
add_executable ( Bitmap_cubical_complex_periodic_boundary_conditions Bitmap_cubical_complex_periodic_boundary_conditions.cpp )
-target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${Boost_SYSTEM_LIBRARY})
+target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${Boost_SYSTEM_LIBRARY})
+if (TBB_FOUND)
+ target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${TBB_RELEASE_LIBRARY})
+endif()
add_test(Bitmap_cubical_complex_periodic_2d_torus ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex_periodic_boundary_conditions ${CMAKE_SOURCE_DIR}/data/bitmap/2d_torus.txt)
add_test(Bitmap_cubical_complex_periodic_3d_torus ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex_periodic_boundary_conditions ${CMAKE_SOURCE_DIR}/data/bitmap/3d_torus.txt)
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h
index 54ae47d0..a6ba60d3 100644
--- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h
+++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h
@@ -546,7 +546,8 @@ void Bitmap_cubical_complex<T>::initialize_simplex_associated_to_key() {
this->simplex_associated_to_key = std::vector<size_t>(this->data.size());
std::iota(std::begin(simplex_associated_to_key), std::end(simplex_associated_to_key), 0);
#ifdef GUDHI_USE_TBB
- tbb::parallel_sort(simplex_associated_to_key, is_before_in_filtration<T>(this));
+ tbb::parallel_sort(simplex_associated_to_key.begin(), simplex_associated_to_key.end(),
+ is_before_in_filtration<T>(this));
#else
std::sort(simplex_associated_to_key.begin(), simplex_associated_to_key.end(), is_before_in_filtration<T>(this));
#endif
diff --git a/src/Bitmap_cubical_complex/test/CMakeLists.txt b/src/Bitmap_cubical_complex/test/CMakeLists.txt
index 97c374e6..96a41c62 100644
--- a/src/Bitmap_cubical_complex/test/CMakeLists.txt
+++ b/src/Bitmap_cubical_complex/test/CMakeLists.txt
@@ -16,6 +16,9 @@ endif()
add_executable ( BitmapCCUT Bitmap_test.cpp )
target_link_libraries(BitmapCCUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+if (TBB_FOUND)
+ target_link_libraries(BitmapCCUT ${TBB_RELEASE_LIBRARY})
+endif()
# Unitary tests
add_test(NAME BitmapCCUT