summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-12-12 17:22:37 +0100
committerROUVREAU Vincent <vincent.rouvreau@inria.fr>2019-12-12 17:22:37 +0100
commitaa93957d37a1f8e0a2d25af27ad87eb6b8eb84c3 (patch)
treedef7b983f30ec5e357744c5e02981fb2e6ce7b94 /src
parent0474f6a62622608b96eac3a553a081e148cbcabc (diff)
parent2607200636eb01e4df5735ec311d3a69db5ed589 (diff)
Merge branch 'master' into exact_alpha_complex_python_version
Diffstat (limited to 'src')
-rw-r--r--src/Alpha_complex/test/CMakeLists.txt22
-rw-r--r--src/Bitmap_cubical_complex/test/CMakeLists.txt5
-rw-r--r--src/Bottleneck_distance/test/CMakeLists.txt5
-rw-r--r--src/Cech_complex/test/CMakeLists.txt5
-rw-r--r--src/Nerve_GIC/test/CMakeLists.txt5
-rw-r--r--src/Persistence_representations/test/CMakeLists.txt33
-rw-r--r--src/Persistent_cohomology/test/CMakeLists.txt13
-rw-r--r--src/Rips_complex/test/CMakeLists.txt5
-rw-r--r--src/Simplex_tree/test/CMakeLists.txt18
-rw-r--r--src/Skeleton_blocker/test/CMakeLists.txt11
-rw-r--r--src/Spatial_searching/test/CMakeLists.txt9
-rw-r--r--src/Subsampling/test/CMakeLists.txt14
-rw-r--r--src/Tangential_complex/test/CMakeLists.txt6
-rw-r--r--src/Toplex_map/test/CMakeLists.txt8
-rw-r--r--src/Witness_complex/test/CMakeLists.txt8
-rw-r--r--src/cmake/modules/GUDHI_boost_test.cmake26
-rw-r--r--src/cmake/modules/GUDHI_compilation_flags.cmake2
-rw-r--r--src/cmake/modules/GUDHI_test_coverage.cmake26
-rw-r--r--src/common/doc/installation.h5
-rw-r--r--src/common/test/CMakeLists.txt13
-rw-r--r--src/python/doc/installation.rst18
-rw-r--r--src/python/doc/representations.rst26
-rw-r--r--src/python/gudhi/representations/vector_methods.py29
23 files changed, 156 insertions, 156 deletions
diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt
index ad5b6314..0476c6d4 100644
--- a/src/Alpha_complex/test/CMakeLists.txt
+++ b/src/Alpha_complex/test/CMakeLists.txt
@@ -1,27 +1,27 @@
project(Alpha_complex_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
add_executable ( Alpha_complex_test_unit Alpha_complex_unit_test.cpp )
- target_link_libraries(Alpha_complex_test_unit ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Alpha_complex_test_unit ${CGAL_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Alpha_complex_test_unit ${TBB_LIBRARIES})
endif()
- gudhi_add_coverage_test(Alpha_complex_test_unit)
+ gudhi_add_boost_test(Alpha_complex_test_unit)
add_executable ( Alpha_complex_3d_test_unit Alpha_complex_3d_unit_test.cpp )
- target_link_libraries(Alpha_complex_3d_test_unit ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Alpha_complex_3d_test_unit ${CGAL_LIBRARY})
add_executable ( Weighted_alpha_complex_3d_test_unit Weighted_alpha_complex_3d_unit_test.cpp )
- target_link_libraries(Weighted_alpha_complex_3d_test_unit ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Weighted_alpha_complex_3d_test_unit ${CGAL_LIBRARY})
add_executable ( Periodic_alpha_complex_3d_test_unit Periodic_alpha_complex_3d_unit_test.cpp )
- target_link_libraries(Periodic_alpha_complex_3d_test_unit ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Periodic_alpha_complex_3d_test_unit ${CGAL_LIBRARY})
add_executable ( Weighted_periodic_alpha_complex_3d_test_unit Weighted_periodic_alpha_complex_3d_unit_test.cpp )
- target_link_libraries(Weighted_periodic_alpha_complex_3d_test_unit ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Weighted_periodic_alpha_complex_3d_test_unit ${CGAL_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Alpha_complex_3d_test_unit ${TBB_LIBRARIES})
target_link_libraries(Weighted_alpha_complex_3d_test_unit ${TBB_LIBRARIES})
@@ -29,9 +29,9 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
target_link_libraries(Weighted_periodic_alpha_complex_3d_test_unit ${TBB_LIBRARIES})
endif()
- gudhi_add_coverage_test(Alpha_complex_3d_test_unit)
- gudhi_add_coverage_test(Weighted_alpha_complex_3d_test_unit)
- gudhi_add_coverage_test(Periodic_alpha_complex_3d_test_unit)
- gudhi_add_coverage_test(Weighted_periodic_alpha_complex_3d_test_unit)
+ gudhi_add_boost_test(Alpha_complex_3d_test_unit)
+ gudhi_add_boost_test(Weighted_alpha_complex_3d_test_unit)
+ gudhi_add_boost_test(Periodic_alpha_complex_3d_test_unit)
+ gudhi_add_boost_test(Weighted_periodic_alpha_complex_3d_test_unit)
endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Bitmap_cubical_complex/test/CMakeLists.txt b/src/Bitmap_cubical_complex/test/CMakeLists.txt
index d2f002a6..eb7eb6b5 100644
--- a/src/Bitmap_cubical_complex/test/CMakeLists.txt
+++ b/src/Bitmap_cubical_complex/test/CMakeLists.txt
@@ -1,14 +1,13 @@
project(Bitmap_cubical_complex_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/sinusoid.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
add_executable ( Bitmap_cubical_complex_test_unit Bitmap_test.cpp )
-target_link_libraries(Bitmap_cubical_complex_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Bitmap_cubical_complex_test_unit ${TBB_LIBRARIES})
endif()
-gudhi_add_coverage_test(Bitmap_cubical_complex_test_unit)
+gudhi_add_boost_test(Bitmap_cubical_complex_test_unit)
diff --git a/src/Bottleneck_distance/test/CMakeLists.txt b/src/Bottleneck_distance/test/CMakeLists.txt
index ec2d045f..3acd3d86 100644
--- a/src/Bottleneck_distance/test/CMakeLists.txt
+++ b/src/Bottleneck_distance/test/CMakeLists.txt
@@ -1,14 +1,13 @@
project(Bottleneck_distance_tests)
if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
- include(GUDHI_test_coverage)
+ include(GUDHI_boost_test)
add_executable ( Bottleneck_distance_test_unit bottleneck_unit_test.cpp )
- target_link_libraries(Bottleneck_distance_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Bottleneck_distance_test_unit ${TBB_LIBRARIES})
endif(TBB_FOUND)
- gudhi_add_coverage_test(Bottleneck_distance_test_unit)
+ gudhi_add_boost_test(Bottleneck_distance_test_unit)
endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Cech_complex/test/CMakeLists.txt b/src/Cech_complex/test/CMakeLists.txt
index 8db51173..db510af3 100644
--- a/src/Cech_complex/test/CMakeLists.txt
+++ b/src/Cech_complex/test/CMakeLists.txt
@@ -1,10 +1,9 @@
cmake_minimum_required(VERSION 2.6)
project(Cech_complex_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable ( Cech_complex_test_unit test_cech_complex.cpp )
-target_link_libraries(Cech_complex_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Cech_complex_test_unit ${TBB_LIBRARIES})
endif()
@@ -12,4 +11,4 @@ endif()
# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-gudhi_add_coverage_test(Cech_complex_test_unit)
+gudhi_add_boost_test(Cech_complex_test_unit)
diff --git a/src/Nerve_GIC/test/CMakeLists.txt b/src/Nerve_GIC/test/CMakeLists.txt
index b89c18a2..567bf43f 100644
--- a/src/Nerve_GIC/test/CMakeLists.txt
+++ b/src/Nerve_GIC/test/CMakeLists.txt
@@ -1,16 +1,15 @@
project(Graph_induced_complex_tests)
if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
- include(GUDHI_test_coverage)
+ include(GUDHI_boost_test)
add_executable ( Nerve_GIC_test_unit test_GIC.cpp )
- target_link_libraries(Nerve_GIC_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Nerve_GIC_test_unit ${TBB_LIBRARIES})
endif()
file(COPY data DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
- gudhi_add_coverage_test(Nerve_GIC_test_unit)
+ gudhi_add_boost_test(Nerve_GIC_test_unit)
endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Persistence_representations/test/CMakeLists.txt b/src/Persistence_representations/test/CMakeLists.txt
index a95880c9..92d68a63 100644
--- a/src/Persistence_representations/test/CMakeLists.txt
+++ b/src/Persistence_representations/test/CMakeLists.txt
@@ -1,51 +1,36 @@
project(Persistence_representations_test)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
# copy data directory for tests purpose.
file(COPY data DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
add_executable ( Persistence_intervals_test_unit persistence_intervals_test.cpp )
-target_link_libraries(Persistence_intervals_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-gudhi_add_coverage_test(Persistence_intervals_test_unit)
+gudhi_add_boost_test(Persistence_intervals_test_unit)
add_executable (Vector_representation_test_unit vector_representation_test.cpp )
-target_link_libraries(Vector_representation_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-gudhi_add_coverage_test(Vector_representation_test_unit)
+gudhi_add_boost_test(Vector_representation_test_unit)
add_executable (Persistence_lanscapes_test_unit persistence_lanscapes_test.cpp )
-target_link_libraries(Persistence_lanscapes_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-gudhi_add_coverage_test(Persistence_lanscapes_test_unit)
+gudhi_add_boost_test(Persistence_lanscapes_test_unit)
add_executable ( Persistence_lanscapes_on_grid_test_unit persistence_lanscapes_on_grid_test.cpp )
-target_link_libraries(Persistence_lanscapes_on_grid_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-gudhi_add_coverage_test(Persistence_lanscapes_on_grid_test_unit)
+gudhi_add_boost_test(Persistence_lanscapes_on_grid_test_unit)
add_executable (Persistence_heat_maps_test_unit persistence_heat_maps_test.cpp )
-target_link_libraries(Persistence_heat_maps_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-gudhi_add_coverage_test(Persistence_heat_maps_test_unit)
+gudhi_add_boost_test(Persistence_heat_maps_test_unit)
add_executable ( Read_persistence_from_file_test_unit read_persistence_from_file_test.cpp )
-target_link_libraries(Read_persistence_from_file_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-gudhi_add_coverage_test(Read_persistence_from_file_test_unit)
+gudhi_add_boost_test(Read_persistence_from_file_test_unit)
add_executable ( kernels_unit kernels.cpp )
-target_link_libraries(kernels_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-gudhi_add_coverage_test(kernels_unit)
+gudhi_add_boost_test(kernels_unit)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable (Persistence_intervals_with_distances_test_unit persistence_intervals_with_distances_test.cpp )
- target_link_libraries(Persistence_intervals_with_distances_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Persistence_intervals_with_distances_test_unit ${TBB_LIBRARIES})
endif(TBB_FOUND)
- gudhi_add_coverage_test(Persistence_intervals_with_distances_test_unit)
+ gudhi_add_boost_test(Persistence_intervals_with_distances_test_unit)
endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt
index f8baf861..64669c4e 100644
--- a/src/Persistent_cohomology/test/CMakeLists.txt
+++ b/src/Persistent_cohomology/test/CMakeLists.txt
@@ -1,11 +1,9 @@
project(Persistent_cohomology_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable ( Persistent_cohomology_test_unit persistent_cohomology_unit_test.cpp )
-target_link_libraries(Persistent_cohomology_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_executable ( Persistent_cohomology_test_betti_numbers betti_numbers_unit_test.cpp )
-target_link_libraries(Persistent_cohomology_test_betti_numbers ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Persistent_cohomology_test_unit ${TBB_LIBRARIES})
target_link_libraries(Persistent_cohomology_test_betti_numbers ${TBB_LIBRARIES})
@@ -16,13 +14,12 @@ file(COPY "${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
# Unitary tests
-gudhi_add_coverage_test(Persistent_cohomology_test_unit)
-gudhi_add_coverage_test(Persistent_cohomology_test_betti_numbers)
+gudhi_add_boost_test(Persistent_cohomology_test_unit)
+gudhi_add_boost_test(Persistent_cohomology_test_betti_numbers)
if(GMPXX_FOUND AND GMP_FOUND)
add_executable ( Persistent_cohomology_test_unit_multi_field persistent_cohomology_unit_test_multi_field.cpp )
- target_link_libraries(Persistent_cohomology_test_unit_multi_field
- ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES})
+ target_link_libraries(Persistent_cohomology_test_unit_multi_field ${GMPXX_LIBRARIES} ${GMP_LIBRARIES})
if (TBB_FOUND)
target_link_libraries(Persistent_cohomology_test_unit_multi_field ${TBB_LIBRARIES})
endif(TBB_FOUND)
@@ -31,7 +28,7 @@ if(GMPXX_FOUND AND GMP_FOUND)
file(COPY "${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt"
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
# Unitary tests
- gudhi_add_coverage_test(Persistent_cohomology_test_unit_multi_field)
+ gudhi_add_boost_test(Persistent_cohomology_test_unit_multi_field)
endif(GMPXX_FOUND AND GMP_FOUND)
diff --git a/src/Rips_complex/test/CMakeLists.txt b/src/Rips_complex/test/CMakeLists.txt
index 745d953c..b359584e 100644
--- a/src/Rips_complex/test/CMakeLists.txt
+++ b/src/Rips_complex/test/CMakeLists.txt
@@ -1,9 +1,8 @@
project(Rips_complex_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable ( Rips_complex_test_unit test_rips_complex.cpp )
-target_link_libraries(Rips_complex_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Rips_complex_test_unit ${TBB_LIBRARIES})
endif()
@@ -12,4 +11,4 @@ endif()
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
file(COPY "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-gudhi_add_coverage_test(Rips_complex_test_unit)
+gudhi_add_boost_test(Rips_complex_test_unit)
diff --git a/src/Simplex_tree/test/CMakeLists.txt b/src/Simplex_tree/test/CMakeLists.txt
index 5bea3938..8b9163f5 100644
--- a/src/Simplex_tree/test/CMakeLists.txt
+++ b/src/Simplex_tree/test/CMakeLists.txt
@@ -1,38 +1,30 @@
project(Simplex_tree_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
# Do not forget to copy test files in current binary dir
file(COPY "simplex_tree_for_unit_test.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
add_executable ( Simplex_tree_test_unit simplex_tree_unit_test.cpp )
-target_link_libraries(Simplex_tree_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Simplex_tree_test_unit ${TBB_LIBRARIES})
endif()
-
-gudhi_add_coverage_test(Simplex_tree_test_unit)
+gudhi_add_boost_test(Simplex_tree_test_unit)
add_executable ( Simplex_tree_remove_test_unit simplex_tree_remove_unit_test.cpp )
-target_link_libraries(Simplex_tree_remove_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Simplex_tree_remove_test_unit ${TBB_LIBRARIES})
endif()
-
-gudhi_add_coverage_test(Simplex_tree_remove_test_unit)
+gudhi_add_boost_test(Simplex_tree_remove_test_unit)
add_executable ( Simplex_tree_iostream_operator_test_unit simplex_tree_iostream_operator_unit_test.cpp )
-target_link_libraries(Simplex_tree_iostream_operator_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Simplex_tree_iostream_operator_test_unit ${TBB_LIBRARIES})
endif()
-
-gudhi_add_coverage_test(Simplex_tree_iostream_operator_test_unit)
+gudhi_add_boost_test(Simplex_tree_iostream_operator_test_unit)
add_executable ( Simplex_tree_ctor_and_move_test_unit simplex_tree_ctor_and_move_unit_test.cpp )
-target_link_libraries(Simplex_tree_ctor_and_move_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Simplex_tree_ctor_and_move_test_unit ${TBB_LIBRARIES})
endif()
-
-gudhi_add_coverage_test(Simplex_tree_ctor_and_move_test_unit)
+gudhi_add_boost_test(Simplex_tree_ctor_and_move_test_unit)
diff --git a/src/Skeleton_blocker/test/CMakeLists.txt b/src/Skeleton_blocker/test/CMakeLists.txt
index 19c65871..24b6c11e 100644
--- a/src/Skeleton_blocker/test/CMakeLists.txt
+++ b/src/Skeleton_blocker/test/CMakeLists.txt
@@ -1,17 +1,14 @@
project(Skeleton_blocker_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable ( Skeleton_blocker_test_unit test_skeleton_blocker_complex.cpp )
-target_link_libraries(Skeleton_blocker_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_executable ( Skeleton_blocker_test_geometric_complex test_skeleton_blocker_geometric_complex.cpp )
-target_link_libraries(Skeleton_blocker_test_geometric_complex ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_executable ( Skeleton_blocker_test_simplifiable test_skeleton_blocker_simplifiable.cpp )
-target_link_libraries(Skeleton_blocker_test_simplifiable ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
# Do not forget to copy test files in current binary dir
file(COPY "test2.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-gudhi_add_coverage_test(Skeleton_blocker_test_unit)
-gudhi_add_coverage_test(Skeleton_blocker_test_geometric_complex)
-gudhi_add_coverage_test(Skeleton_blocker_test_simplifiable)
+gudhi_add_boost_test(Skeleton_blocker_test_unit)
+gudhi_add_boost_test(Skeleton_blocker_test_geometric_complex)
+gudhi_add_boost_test(Skeleton_blocker_test_simplifiable)
diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt
index 18f7c6b8..a6c23951 100644
--- a/src/Spatial_searching/test/CMakeLists.txt
+++ b/src/Spatial_searching/test/CMakeLists.txt
@@ -1,11 +1,8 @@
project(Spatial_searching_tests)
if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- include(GUDHI_test_coverage)
-
+ include(GUDHI_boost_test)
add_executable( Spatial_searching_test_Kd_tree_search test_Kd_tree_search.cpp )
- target_link_libraries(Spatial_searching_test_Kd_tree_search
- ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
- gudhi_add_coverage_test(Spatial_searching_test_Kd_tree_search)
+ target_link_libraries(Spatial_searching_test_Kd_tree_search ${CGAL_LIBRARY})
+ gudhi_add_boost_test(Spatial_searching_test_Kd_tree_search)
endif ()
diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt
index cf54788e..354021c1 100644
--- a/src/Subsampling/test/CMakeLists.txt
+++ b/src/Subsampling/test/CMakeLists.txt
@@ -1,18 +1,18 @@
project(Subsampling_tests)
if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- include(GUDHI_test_coverage)
+ include(GUDHI_boost_test)
add_executable( Subsampling_test_pick_n_random_points test_pick_n_random_points.cpp )
- target_link_libraries(Subsampling_test_pick_n_random_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Subsampling_test_pick_n_random_points ${CGAL_LIBRARY})
add_executable( Subsampling_test_choose_n_farthest_points test_choose_n_farthest_points.cpp )
- target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY})
add_executable(Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp)
- target_link_libraries(Subsampling_test_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Subsampling_test_sparsify_point_set ${CGAL_LIBRARY})
- gudhi_add_coverage_test(Subsampling_test_pick_n_random_points)
- gudhi_add_coverage_test(Subsampling_test_choose_n_farthest_points)
- gudhi_add_coverage_test(Subsampling_test_sparsify_point_set)
+ gudhi_add_boost_test(Subsampling_test_pick_n_random_points)
+ gudhi_add_boost_test(Subsampling_test_choose_n_farthest_points)
+ gudhi_add_boost_test(Subsampling_test_sparsify_point_set)
endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Tangential_complex/test/CMakeLists.txt b/src/Tangential_complex/test/CMakeLists.txt
index ae17a286..2207d67c 100644
--- a/src/Tangential_complex/test/CMakeLists.txt
+++ b/src/Tangential_complex/test/CMakeLists.txt
@@ -1,13 +1,13 @@
project(Tangential_complex_tests)
if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- include(GUDHI_test_coverage)
+ include(GUDHI_boost_test)
add_executable( Tangential_complex_test_TC test_tangential_complex.cpp )
- target_link_libraries(Tangential_complex_test_TC ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ target_link_libraries(Tangential_complex_test_TC ${CGAL_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Tangential_complex_test_TC ${TBB_LIBRARIES})
endif()
- gudhi_add_coverage_test(Tangential_complex_test_TC)
+ gudhi_add_boost_test(Tangential_complex_test_TC)
endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Toplex_map/test/CMakeLists.txt b/src/Toplex_map/test/CMakeLists.txt
index 59517db5..2997584d 100644
--- a/src/Toplex_map/test/CMakeLists.txt
+++ b/src/Toplex_map/test/CMakeLists.txt
@@ -1,11 +1,9 @@
project(Toplex_map_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable( Toplex_map_unit_test toplex_map_unit_test.cpp )
-target_link_libraries(Toplex_map_unit_test ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-gudhi_add_coverage_test(Toplex_map_unit_test)
+gudhi_add_boost_test(Toplex_map_unit_test)
add_executable( Lazy_toplex_map_unit_test lazy_toplex_map_unit_test.cpp )
-target_link_libraries(Lazy_toplex_map_unit_test ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-gudhi_add_coverage_test(Lazy_toplex_map_unit_test)
+gudhi_add_boost_test(Lazy_toplex_map_unit_test)
diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt
index 96188e46..690933aa 100644
--- a/src/Witness_complex/test/CMakeLists.txt
+++ b/src/Witness_complex/test/CMakeLists.txt
@@ -1,22 +1,20 @@
project(Witness_complex_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable ( Witness_complex_test_simple_witness_complex test_simple_witness_complex.cpp )
-target_link_libraries(Witness_complex_test_simple_witness_complex ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Witness_complex_test_simple_witness_complex ${TBB_LIBRARIES})
endif(TBB_FOUND)
-gudhi_add_coverage_test(Witness_complex_test_simple_witness_complex)
+gudhi_add_boost_test(Witness_complex_test_simple_witness_complex)
# 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_test_euclidean_simple_witness_complex test_euclidean_simple_witness_complex.cpp )
- target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${TBB_LIBRARIES})
endif(TBB_FOUND)
- gudhi_add_coverage_test(Witness_complex_test_euclidean_simple_witness_complex)
+ gudhi_add_boost_test(Witness_complex_test_euclidean_simple_witness_complex)
endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/cmake/modules/GUDHI_boost_test.cmake b/src/cmake/modules/GUDHI_boost_test.cmake
new file mode 100644
index 00000000..c3b29883
--- /dev/null
+++ b/src/cmake/modules/GUDHI_boost_test.cmake
@@ -0,0 +1,26 @@
+if (WITH_GUDHI_BOOST_TEST_COVERAGE)
+ # Make CTest output XML coverage report - WITH_GUDHI_BOOST_TEST_COVERAGE must be set - default is OFF
+ if (GCOVR_PATH)
+ # for gcovr to make coverage reports - Corbera Jenkins plugin
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
+ endif()
+ if (GPROF_PATH)
+ # for gprof to make coverage reports - Jenkins
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
+ endif()
+ set(GUDHI_UT_LOG_FORMAT "--log_format=XML")
+ set(GUDHI_UT_LOG_SINK "--log_sink=${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml")
+ set(GUDHI_UT_LOG_LEVEL "--log_level=test_suite")
+ set(GUDHI_UT_REPORT_LEVEL "--report_level=no")
+else (WITH_GUDHI_BOOST_TEST_COVERAGE)
+ # Make CTest more verbose and color output
+ set(GUDHI_UT_LOG_LEVEL "--color_output")
+ set(GUDHI_UT_REPORT_LEVEL "--report_level=detailed")
+endif(WITH_GUDHI_BOOST_TEST_COVERAGE)
+
+function(gudhi_add_boost_test unitary_test)
+ target_link_libraries(${unitary_test} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ add_test(NAME ${unitary_test} COMMAND $<TARGET_FILE:${unitary_test}>
+ ${GUDHI_UT_LOG_FORMAT} ${GUDHI_UT_LOG_SINK}
+ ${GUDHI_UT_LOG_LEVEL} ${GUDHI_UT_REPORT_LEVEL})
+endfunction()
diff --git a/src/cmake/modules/GUDHI_compilation_flags.cmake b/src/cmake/modules/GUDHI_compilation_flags.cmake
index 6cd2614d..34c2e065 100644
--- a/src/cmake/modules/GUDHI_compilation_flags.cmake
+++ b/src/cmake/modules/GUDHI_compilation_flags.cmake
@@ -73,3 +73,5 @@ if(CMAKE_BUILD_TYPE MATCHES Debug)
else()
message("++ Release compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
endif()
+
+option(WITH_GUDHI_BOOST_TEST_COVERAGE "Report xml coverage files on boost tests" OFF)
diff --git a/src/cmake/modules/GUDHI_test_coverage.cmake b/src/cmake/modules/GUDHI_test_coverage.cmake
deleted file mode 100644
index bea5b2d6..00000000
--- a/src/cmake/modules/GUDHI_test_coverage.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-
-if (GCOVR_PATH)
- # for gcovr to make coverage reports - Corbera Jenkins plugin
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
-endif()
-if (GPROF_PATH)
- # for gprof to make coverage reports - Jenkins
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
-endif()
-
-if (DEBUG_TRACES)
- # Make CTest more verbose with DEBUG_TRACES - no XML output
- set(GUDHI_UT_LOG_LEVEL "--log_level=all")
- set(GUDHI_UT_REPORT_LEVEL "--report_level=detailed")
-else()
- set(GUDHI_UT_LOG_FORMAT "--log_format=XML")
- set(GUDHI_UT_LOG_SINK "--log_sink=${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml")
- set(GUDHI_UT_LOG_LEVEL "--log_level=test_suite")
- set(GUDHI_UT_REPORT_LEVEL "--report_level=no")
-endif()
-
-function(gudhi_add_coverage_test unitary_test)
- add_test(NAME ${unitary_test} COMMAND $<TARGET_FILE:${unitary_test}>
- ${GUDHI_UT_LOG_FORMAT} ${GUDHI_UT_LOG_SINK}
- ${GUDHI_UT_LOG_LEVEL} ${GUDHI_UT_REPORT_LEVEL})
-endfunction()
diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h
index c320e7e0..d70a2efa 100644
--- a/src/common/doc/installation.h
+++ b/src/common/doc/installation.h
@@ -32,7 +32,10 @@ make \endverbatim
*
* \subsection testsuites Test suites
* To test your build, run the following command in a terminal:
- * \verbatim make test \endverbatim
+ * \verbatim make test \endverbatim
+ * `make test` is using <a href="https://cmake.org/cmake/help/latest/manual/ctest.1.html">Ctest<\a> (CMake test driver
+ * program). If some of the tests are failing, please send us the result of the following command:
+ * \verbatim ctest --output-on-failure \endverbatim
*
* \subsection documentationgeneration Documentation
* To generate the documentation, <a target="_blank" href="http://www.doxygen.org/">Doxygen</a> is required.
diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt
index 0b49fa1e..34de7398 100644
--- a/src/common/test/CMakeLists.txt
+++ b/src/common/test/CMakeLists.txt
@@ -1,15 +1,10 @@
project(Common_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable ( Common_test_points_off_reader test_points_off_reader.cpp )
-target_link_libraries(Common_test_points_off_reader ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
add_executable ( Common_test_distance_matrix_reader test_distance_matrix_reader.cpp )
-target_link_libraries(Common_test_distance_matrix_reader ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
add_executable ( Common_test_persistence_intervals_reader test_persistence_intervals_reader.cpp )
-target_link_libraries(Common_test_persistence_intervals_reader ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
@@ -19,6 +14,6 @@ file(COPY "${CMAKE_SOURCE_DIR}/src/common/test/persistence_intervals_with_dimens
file(COPY "${CMAKE_SOURCE_DIR}/src/common/test/persistence_intervals_with_field.pers" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
file(COPY "${CMAKE_SOURCE_DIR}/src/common/test/persistence_intervals_without_dimension.pers" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-gudhi_add_coverage_test(Common_test_points_off_reader)
-gudhi_add_coverage_test(Common_test_distance_matrix_reader)
-gudhi_add_coverage_test(Common_test_persistence_intervals_reader)
+gudhi_add_boost_test(Common_test_points_off_reader)
+gudhi_add_boost_test(Common_test_distance_matrix_reader)
+gudhi_add_boost_test(Common_test_persistence_intervals_reader)
diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst
index 54504413..50a697c7 100644
--- a/src/python/doc/installation.rst
+++ b/src/python/doc/installation.rst
@@ -83,20 +83,30 @@ Or install it definitely in your Python packages folder:
.. code-block:: bash
- python setup.py install --prefix /home/gudhi # Install in /home/gudhi directory
+ python setup.py install --prefix /home/gudhi # Install in /home/gudhi directory
Test suites
===========
-To test your build, `py.test <http://doc.pytest.org>`_ is optional. Run the
-following command in a terminal:
+To test your build, `py.test <http://doc.pytest.org>`_ is required. Run the
+following `Ctest <https://cmake.org/cmake/help/latest/manual/ctest.1.html>`_
+(CMake test driver program) command in a terminal:
.. code-block:: bash
cd /path-to-gudhi/build/python
# For windows, you have to set PYTHONPATH environment variable
export PYTHONPATH='$PYTHONPATH:/path-to-gudhi/build/python'
- make test
+ ctest
+
+.. note::
+
+ One can use :code:`ctest` specific options in the python directory:
+
+.. code-block:: bash
+
+ # Launch tests in parallel on 8 cores and set failing tests in verbose mode
+ ctest -j 8 --output-on-failure
Debugging issues
================
diff --git a/src/python/doc/representations.rst b/src/python/doc/representations.rst
index b3131a25..11dcbcf9 100644
--- a/src/python/doc/representations.rst
+++ b/src/python/doc/representations.rst
@@ -8,7 +8,7 @@ Representations manual
.. include:: representations_sum.inc
-This module, originally named sklearn_tda, aims at bridging the gap between persistence diagrams and machine learning tools, in particular scikit-learn. It provides tools, using the scikit-learn standard interface, to compute distances and kernels on diagrams, and to convert diagrams into vectors.
+This module, originally available at https://github.com/MathieuCarriere/sklearn-tda and named sklearn_tda, aims at bridging the gap between persistence diagrams and machine learning, by providing implementations of most of the vector representations for persistence diagrams in the literature, in a scikit-learn format. More specifically, it provides tools, using the scikit-learn standard interface, to compute distances and kernels on persistence diagrams, and to convert these diagrams into vectors in Euclidean space.
A diagram is represented as a numpy array of shape (n,2), as can be obtained from :func:`~gudhi.SimplexTree.persistence_intervals_in_dimension` for instance. Points at infinity are represented as a numpy array of shape (n,1), storing only the birth time.
@@ -46,3 +46,27 @@ Metrics
:members:
:special-members:
:show-inheritance:
+
+Basic example
+-------------
+
+This example computes the first two Landscapes associated to a persistence diagram with four points. The landscapes are evaluated on ten samples, leading to two vectors with ten coordinates each, that are eventually concatenated in order to produce a single vector representation.
+
+.. testcode::
+
+ import numpy as np
+ from gudhi.representations import Landscape
+ # A single diagram with 4 points
+ D = np.array([[0.,4.],[1.,2.],[3.,8.],[6.,8.]])
+ diags = [D]
+ l=Landscape(num_landscapes=2,resolution=10).fit_transform(diags)
+ print(l)
+
+The output is:
+
+.. testoutput::
+
+ [[1.02851895 2.05703791 2.57129739 1.54277843 0.89995409 1.92847304
+ 2.95699199 3.08555686 2.05703791 1.02851895 0. 0.64282435
+ 0. 0. 0.51425948 0. 0. 0.
+ 0.77138922 1.02851895]]
diff --git a/src/python/gudhi/representations/vector_methods.py b/src/python/gudhi/representations/vector_methods.py
index 61c4fb84..fe26dbe2 100644
--- a/src/python/gudhi/representations/vector_methods.py
+++ b/src/python/gudhi/representations/vector_methods.py
@@ -95,6 +95,8 @@ class Landscape(BaseEstimator, TransformerMixin):
sample_range ([double, double]): minimum and maximum of all piecewise-linear function domains, of the form [x_min, x_max] (default [numpy.nan, numpy.nan]). It is the interval on which samples will be drawn evenly. If one of the values is numpy.nan, it can be computed from the persistence diagrams with the fit() method.
"""
self.num_landscapes, self.resolution, self.sample_range = num_landscapes, resolution, sample_range
+ self.nan_in_range = np.isnan(np.array(self.sample_range))
+ self.new_resolution = self.resolution + self.nan_in_range.sum()
def fit(self, X, y=None):
"""
@@ -104,10 +106,10 @@ class Landscape(BaseEstimator, TransformerMixin):
X (list of n x 2 numpy arrays): input persistence diagrams.
y (n x 1 array): persistence diagram labels (unused).
"""
- if np.isnan(np.array(self.sample_range)).any():
+ if self.nan_in_range.any():
pre = DiagramScaler(use=True, scalers=[([0], MinMaxScaler()), ([1], MinMaxScaler())]).fit(X,y)
[mx,my],[Mx,My] = [pre.scalers[0][1].data_min_[0], pre.scalers[1][1].data_min_[0]], [pre.scalers[0][1].data_max_[0], pre.scalers[1][1].data_max_[0]]
- self.sample_range = np.where(np.isnan(np.array(self.sample_range)), np.array([mx, My]), np.array(self.sample_range))
+ self.sample_range = np.where(self.nan_in_range, np.array([mx, My]), np.array(self.sample_range))
return self
def transform(self, X):
@@ -121,26 +123,26 @@ class Landscape(BaseEstimator, TransformerMixin):
numpy array with shape (number of diagrams) x (number of samples = **num_landscapes** x **resolution**): output persistence landscapes.
"""
num_diag, Xfit = len(X), []
- x_values = np.linspace(self.sample_range[0], self.sample_range[1], self.resolution)
+ x_values = np.linspace(self.sample_range[0], self.sample_range[1], self.new_resolution)
step_x = x_values[1] - x_values[0]
for i in range(num_diag):
diagram, num_pts_in_diag = X[i], X[i].shape[0]
- ls = np.zeros([self.num_landscapes, self.resolution])
+ ls = np.zeros([self.num_landscapes, self.new_resolution])
events = []
- for j in range(self.resolution):
+ for j in range(self.new_resolution):
events.append([])
for j in range(num_pts_in_diag):
[px,py] = diagram[j,:2]
- min_idx = np.clip(np.ceil((px - self.sample_range[0]) / step_x).astype(int), 0, self.resolution)
- mid_idx = np.clip(np.ceil((0.5*(py+px) - self.sample_range[0]) / step_x).astype(int), 0, self.resolution)
- max_idx = np.clip(np.ceil((py - self.sample_range[0]) / step_x).astype(int), 0, self.resolution)
+ min_idx = np.clip(np.ceil((px - self.sample_range[0]) / step_x).astype(int), 0, self.new_resolution)
+ mid_idx = np.clip(np.ceil((0.5*(py+px) - self.sample_range[0]) / step_x).astype(int), 0, self.new_resolution)
+ max_idx = np.clip(np.ceil((py - self.sample_range[0]) / step_x).astype(int), 0, self.new_resolution)
- if min_idx < self.resolution and max_idx > 0:
+ if min_idx < self.new_resolution and max_idx > 0:
landscape_value = self.sample_range[0] + min_idx * step_x - px
for k in range(min_idx, mid_idx):
@@ -152,12 +154,17 @@ class Landscape(BaseEstimator, TransformerMixin):
events[k].append(landscape_value)
landscape_value -= step_x
- for j in range(self.resolution):
+ for j in range(self.new_resolution):
events[j].sort(reverse=True)
for k in range( min(self.num_landscapes, len(events[j])) ):
ls[k,j] = events[j][k]
- Xfit.append(np.sqrt(2)*np.reshape(ls,[1,-1]))
+ if self.nan_in_range[0]:
+ ls = ls[:,1:]
+ if self.nan_in_range[1]:
+ ls = ls[:,:-1]
+ ls = np.sqrt(2)*np.reshape(ls,[1,-1])
+ Xfit.append(ls)
Xfit = np.concatenate(Xfit,0)