diff options
-rw-r--r-- | src/Contraction/example/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/Persistent_cohomology/example/CMakeLists.txt | 41 | ||||
-rw-r--r-- | src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h | 16 | ||||
-rw-r--r-- | src/Persistent_cohomology/test/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/cmake/modules/FindTBB.cmake | 12 | ||||
-rw-r--r-- | src/common/doc/main_page.h | 8 |
6 files changed, 48 insertions, 51 deletions
diff --git a/src/Contraction/example/CMakeLists.txt b/src/Contraction/example/CMakeLists.txt index b8384cb3..4c09a0a7 100644 --- a/src/Contraction/example/CMakeLists.txt +++ b/src/Contraction/example/CMakeLists.txt @@ -9,5 +9,7 @@ target_link_libraries(RipsContraction ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBR target_link_libraries(GarlandHeckbert ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBRARY}) -add_test(RipsContraction.sphere.0.2 ${CMAKE_CURRENT_BINARY_DIR}/RipsContraction ${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off 0.2) -add_test(RipsContraction.S0310000 ${CMAKE_CURRENT_BINARY_DIR}/RipsContraction ${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off 0.3) +add_test(RipsContraction.tore3D.0.2 ${CMAKE_CURRENT_BINARY_DIR}/RipsContraction ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 0.2) +# TODO(DS) : These tests are too long under Windows +#add_test(RipsContraction.sphere.0.2 ${CMAKE_CURRENT_BINARY_DIR}/RipsContraction ${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off 0.2) +#add_test(RipsContraction.S0310000 ${CMAKE_CURRENT_BINARY_DIR}/RipsContraction ${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off 0.3) diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index a0af11c1..5fb4ba12 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -35,28 +35,34 @@ add_test(rips_persistence_via_boundary_matrix_3 ${CMAKE_CURRENT_BINARY_DIR}/rips add_test(persistence_from_file_3_2_0 ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_file ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.st -p 2 -m 0) add_test(persistence_from_file_3_3_100 ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_file ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.st -p 3 -m 100) -if(GMPXX_FOUND AND GMP_FOUND) - message("GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") +if(GMP_FOUND) message("GMP_LIBRARIES = ${GMP_LIBRARIES}") - add_executable(rips_multifield_persistence rips_multifield_persistence.cpp ) - target_link_libraries(rips_multifield_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) - add_executable ( performance_rips_persistence performance_rips_persistence.cpp ) - target_link_libraries(performance_rips_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) - if (TBB_FOUND) - target_link_libraries(rips_multifield_persistence ${TBB_LIBRARIES}) - target_link_libraries(performance_rips_persistence ${TBB_LIBRARIES}) - endif() + if(GMPXX_FOUND) + message("GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") + + add_executable(rips_multifield_persistence rips_multifield_persistence.cpp ) + target_link_libraries(rips_multifield_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) + add_executable ( performance_rips_persistence performance_rips_persistence.cpp ) + target_link_libraries(performance_rips_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) + if (TBB_FOUND) + target_link_libraries(rips_multifield_persistence ${TBB_LIBRARIES}) + target_link_libraries(performance_rips_persistence ${TBB_LIBRARIES}) + endif(TBB_FOUND) add_test(rips_multifield_persistence_2_71 ${CMAKE_CURRENT_BINARY_DIR}/rips_multifield_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.2 -d 3 -p 2 -q 71 -m 100) + endif(GMPXX_FOUND) +else() + # message(WARNING "GMP not found.") +endif(GMP_FOUND) if(CGAL_FOUND) add_executable(alpha_complex_3d_persistence alpha_complex_3d_persistence.cpp) - target_link_libraries(alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) + target_link_libraries(alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) if (TBB_FOUND) target_link_libraries(alpha_complex_3d_persistence ${TBB_LIBRARIES}) - endif() + endif(TBB_FOUND) add_test(alpha_complex_3d_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off 2 0.45) @@ -72,28 +78,27 @@ if(GMPXX_FOUND AND GMP_FOUND) target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp) - target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) + target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) add_executable(custom_persistence_sort custom_persistence_sort.cpp) - target_link_libraries(custom_persistence_sort ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) + target_link_libraries(custom_persistence_sort ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) if (TBB_FOUND) target_link_libraries(alpha_complex_persistence ${TBB_LIBRARIES}) target_link_libraries(periodic_alpha_complex_3d_persistence ${TBB_LIBRARIES}) target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES}) - endif() + endif(TBB_FOUND) add_test(alpha_complex_persistence_2_0_45 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -m 0.45 -p 2) add_test(periodic_alpha_complex_3d_persistence_2_0 ${CMAKE_CURRENT_BINARY_DIR}/periodic_alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/grid_10_10_10_in_0_1.off ${CMAKE_SOURCE_DIR}/data/points/iso_cuboid_3_in_0_1.txt 2 0) add_test(custom_persistence_sort ${CMAKE_CURRENT_BINARY_DIR}/custom_persistence_sort) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") - endif() + endif(EIGEN3_FOUND) else() message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.") endif () else() # message(WARNING "CGAL not found.") - endif() + endif(CGAL_FOUND) -endif() diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h index efa9a367..a7d1e463 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h @@ -594,7 +594,7 @@ class Persistent_cohomology { } /** @brief Returns Betti numbers. - * @return A vector of persistent Betti numbers. + * @return A vector of Betti numbers. */ std::vector<int> betti_numbers() const { // Init Betti numbers vector with zeros until Simplicial complex dimension @@ -632,7 +632,7 @@ class Persistent_cohomology { /** @brief Returns the persistent Betti numbers. * @param[in] from The persistence birth limit to be added in the number \f$(persistent birth \leq from)\f$. - * @param[in] to The persistence death limit to be added in the number \f$(persistent death > from)\f$. + * @param[in] to The persistence death limit to be added in the number \f$(persistent death > to)\f$. * @return A vector of persistent Betti numbers. */ std::vector<int> persistent_betti_numbers(Filtration_value from, Filtration_value to) const { @@ -641,7 +641,10 @@ class Persistent_cohomology { for (auto pair : persistent_pairs_) { // Count persistence intervals that covers the given interval - if (cpx_->filtration(get<0>(pair)) <= from && cpx_->filtration(get<1>(pair)) > to) { + // null_simplex test : if the function is called with to=+infinity, we still get something useful. And it will + // still work if we change the complex filtration function to reject null simplices. + if (cpx_->filtration(get<0>(pair)) <= from && + (get<1>(pair) == cpx_->null_simplex() || cpx_->filtration(get<1>(pair)) > to)) { // Increment corresponding betti number betti_numbers[cpx_->dimension(get<0>(pair))] += 1; } @@ -652,7 +655,7 @@ class Persistent_cohomology { /** @brief Returns the persistent Betti number of the dimension passed by parameter. * @param[in] dimension The Betti number dimension to get. * @param[in] from The persistence birth limit to be added in the number \f$(persistent birth \leq from)\f$. - * @param[in] to The persistence death limit to be added in the number \f$(persistent death > from)\f$. + * @param[in] to The persistence death limit to be added in the number \f$(persistent death > to)\f$. * @return Persistent Betti number of the given dimension */ int persistent_betti_number(int dimension, Filtration_value from, Filtration_value to) const { @@ -660,7 +663,10 @@ class Persistent_cohomology { for (auto pair : persistent_pairs_) { // Count persistence intervals that covers the given interval - if (cpx_->filtration(get<0>(pair)) <= from && cpx_->filtration(get<1>(pair)) > to) { + // null_simplex test : if the function is called with to=+infinity, we still get something useful. And it will + // still work if we change the complex filtration function to reject null simplices. + if (cpx_->filtration(get<0>(pair)) <= from && + (get<1>(pair) == cpx_->null_simplex() || cpx_->filtration(get<1>(pair)) > to)) { if (cpx_->dimension(get<0>(pair)) == dimension) { // Increment betti number found ++betti_number; diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt index 31a86a2d..a21f39c4 100644 --- a/src/Persistent_cohomology/test/CMakeLists.txt +++ b/src/Persistent_cohomology/test/CMakeLists.txt @@ -4,11 +4,11 @@ project(Persistent_cohomology_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") -endif() +endif(GCOVR_PATH) if (GPROF_PATH) # for gprof to make coverage reports - Jenkins set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +endif(GPROF_PATH) add_executable ( PersistentCohomologyUT persistent_cohomology_unit_test.cpp ) target_link_libraries(PersistentCohomologyUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) @@ -17,7 +17,7 @@ target_link_libraries(BettiNumbersUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_F if (TBB_FOUND) target_link_libraries(PersistentCohomologyUT ${TBB_LIBRARIES}) target_link_libraries(BettiNumbersUT ${TBB_LIBRARIES}) -endif() +endif(TBB_FOUND) # Unitary tests add_test(NAME PersistentCohomologyUT @@ -33,10 +33,10 @@ add_test(NAME BettiNumbersUT if(GMPXX_FOUND AND GMP_FOUND) add_executable ( PersistentCohomologyMultiFieldUT persistent_cohomology_unit_test_multi_field.cpp ) -target_link_libraries(PersistentCohomologyMultiFieldUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) -if (TBB_FOUND) - target_link_libraries(PersistentCohomologyMultiFieldUT ${TBB_LIBRARIES}) -endif() + target_link_libraries(PersistentCohomologyMultiFieldUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) + if (TBB_FOUND) + target_link_libraries(PersistentCohomologyMultiFieldUT ${TBB_LIBRARIES}) + endif(TBB_FOUND) # Unitary tests add_test(NAME PersistentCohomologyMultiFieldUT @@ -45,5 +45,5 @@ endif() # XML format for Jenkins xUnit plugin --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/PersistentCohomologyMultiFieldUT.xml --log_level=test_suite --report_level=no) -endif() +endif(GMPXX_FOUND AND GMP_FOUND) diff --git a/src/cmake/modules/FindTBB.cmake b/src/cmake/modules/FindTBB.cmake index a29c6d9c..13f4d929 100644 --- a/src/cmake/modules/FindTBB.cmake +++ b/src/cmake/modules/FindTBB.cmake @@ -107,11 +107,7 @@ if (WIN32) endif(MSVC12) #note there was no MSVC13 if(MSVC14) - if(RUNNING_CGAL_AUTO_TEST) - set (TBB_FOUND "NO") - return()#binaries for TBB not publicly available when CGAL-4.7 is published - endif(RUNNING_CGAL_AUTO_TEST) - message(STATUS "[Warning] FindTBB.cmake: TBB 4.4 (latest available when CGAL-4.7 is published) does not provide support for MSVC 2015.") + set(_TBB_COMPILER "vc14") endif(MSVC14) # Todo: add other Windows compilers such as ICL. set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) @@ -218,11 +214,7 @@ macro(TBB_CORRECT_LIB_DIR var_name) string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) # endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t") string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) - string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) - string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) - string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) - string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) - string(REPLACE vc11 "${_TBB_COMPILER}" ${var_name} ${${var_name}}) + string(REGEX REPLACE "vc[0-9]+(\.[0-9]+)?" "${_TBB_COMPILER}" ${var_name} ${${var_name}}) endmacro(TBB_CORRECT_LIB_DIR var_content) diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 20ffbc2a..2391e147 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -168,14 +168,10 @@ * * The following example requires the <a target="_blank" href="http://gmplib.org/">GNU Multiple Precision Arithmetic * Library</a> (GMP) and will not be built if GMP is not installed: - * \li <a href="_persistent_cohomology_2alpha_shapes_persistence_8cpp-example.html"> - * Persistent_cohomology/alpha_shapes_persistence.cpp</a> * \li <a href="_persistent_cohomology_2performance_rips_persistence_8cpp-example.html"> * Persistent_cohomology/performance_rips_persistence.cpp</a> * \li <a href="_persistent_cohomology_2rips_multifield_persistence_8cpp-example.html"> * Persistent_cohomology/rips_multifield_persistence.cpp</a> - * \li <a href="_simplex_tree_2simplex_tree_from_alpha_shapes_3_8cpp-example.html"> - * Simplex_tree/simplex_tree_from_alpha_shapes_3.cpp</a> * * Having GMP version 4.2 or higher installed is recommended. * @@ -191,10 +187,6 @@ * Persistent_cohomology/alpha_complex_3d_persistence.cpp</a> * \li <a href="_simplex_tree_2simplex_tree_from_alpha_shapes_3_8cpp-example.html"> * Simplex_tree/simplex_tree_from_alpha_shapes_3.cpp</a> - * \li <a href="_alpha_complex_2_alpha_complex_from_off_8cpp-example.html"> - * Alpha_complex/Alpha_complex_from_off.cpp</a> - * \li <a href="_alpha_complex_2_alpha_complex_from_points_8cpp-example.html"> - * Alpha_complex/Alpha_complex_from_points.cpp</a> * * The following example requires CGAL version ≥ 4.6: * \li <a href="_witness_complex_2witness_complex_sphere_8cpp-example.html"> |