From cb7937f8000fb509486432f66f319e33a9d85400 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 14 Apr 2017 06:54:47 +0000 Subject: Try of a fix for Windows cython find mechanism git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2347 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 4c93e7042d79bfea7c758e726f6393b97334c798 --- src/cmake/modules/FindCython.cmake | 44 +++++++++++++++++++++++ src/cmake/modules/GUDHI_third_party_libraries.txt | 19 +++------- src/cython/CMakeLists.txt | 6 ++-- 3 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 src/cmake/modules/FindCython.cmake diff --git a/src/cmake/modules/FindCython.cmake b/src/cmake/modules/FindCython.cmake new file mode 100644 index 00000000..04aed1f8 --- /dev/null +++ b/src/cmake/modules/FindCython.cmake @@ -0,0 +1,44 @@ +# Find the Cython compiler. +# +# This code sets the following variables: +# +# CYTHON_EXECUTABLE +# +# See also UseCython.cmake + +#============================================================================= +# Copyright 2011 Kitware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +# Use the Cython executable that lives next to the Python executable +# if it is a local installation. +find_package( PythonInterp ) +if( PYTHONINTERP_FOUND ) + get_filename_component( _python_path ${PYTHON_EXECUTABLE} PATH ) + find_program( CYTHON_EXECUTABLE + NAMES cython cython.bat cython3 + HINTS ${_python_path} + ) +else() + find_program( CYTHON_EXECUTABLE + NAMES cython cython.bat cython3 + ) +endif() + + +include( FindPackageHandleStandardArgs ) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE ) + +mark_as_advanced( CYTHON_EXECUTABLE ) diff --git a/src/cmake/modules/GUDHI_third_party_libraries.txt b/src/cmake/modules/GUDHI_third_party_libraries.txt index 2ddc9f1f..5f84c602 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.txt +++ b/src/cmake/modules/GUDHI_third_party_libraries.txt @@ -121,33 +121,24 @@ endmacro( find_the_lib ) # Find the correct Python interpreter. # Can be set with -DPYTHON_EXECUTABLE=/usr/bin/python3 or -DPython_ADDITIONAL_VERSIONS=3 for instance. -if(PYTHON_EXECUTABLE) - if(NOT EXISTS "${PYTHON_EXECUTABLE}") - message(FATAL_ERROR "ERROR: ${PYTHON_EXECUTABLE} does not exist.") - endif(NOT EXISTS "${PYTHON_EXECUTABLE}") -endif(PYTHON_EXECUTABLE) -find_package(PythonInterp) +find_package(Cython) if(NOT GUDHI_CYTHON_PATH) message(FATAL_ERROR "ERROR: GUDHI_CYTHON_PATH is not valid.") endif(NOT GUDHI_CYTHON_PATH) -if(PYTHONINTERP_FOUND) +if(PYTHONINTERP_FOUND AND CYTHON_FOUND) + # Unitary tests are available through py.test + find_program( PYTEST_PATH py.test ) # Default found version 2 if(PYTHON_VERSION_MAJOR EQUAL 2) - FIND_PROGRAM(CYTHON_PATH cython) - # Unitary tests are available through py.test - find_program( PYTEST_PATH py.test ) # Documentation generation is available through sphinx find_program( SPHINX_PATH sphinx-build ) elseif(PYTHON_VERSION_MAJOR EQUAL 3) - FIND_PROGRAM(CYTHON_PATH cython3) - # Unitary tests are available through py.test - find_program( PYTEST_PATH py.test ) # Documentation generation is available through sphinx set(SPHINX_PATH "${CMAKE_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build") else() message(FATAL_ERROR "ERROR: Try to compile the Cython interface. Python version ${PYTHON_VERSION_STRING} is not valid.") endif(PYTHON_VERSION_MAJOR EQUAL 2) -endif(PYTHONINTERP_FOUND) +endif(PYTHONINTERP_FOUND AND CYTHON_FOUND) diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt index 51c208aa..96c2acb3 100644 --- a/src/cython/CMakeLists.txt +++ b/src/cython/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 2.8) project(Cython) -if(CYTHON_PATH) - message("${PYTHON_EXECUTABLE} v.${PYTHON_VERSION_STRING} - Cython is ${CYTHON_PATH} - py.test is ${PYTEST_PATH} - Sphinx is ${SPHINX_PATH}") +if(CYTHON_FOUND) + message("++ ${PYTHON_EXECUTABLE} v.${PYTHON_VERSION_STRING} - Cython is ${CYTHON_EXECUTABLE} - py.test is ${PYTEST_PATH} - Sphinx is ${SPHINX_PATH}") set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DBOOST_RESULT_OF_USE_DECLTYPE', ") set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DBOOST_ALL_NO_LIB', ") @@ -281,4 +281,4 @@ if(CYTHON_PATH) COMMAND make.bat html doctest) endif (UNIX) endif(SPHINX_PATH) -endif(CYTHON_PATH) +endif(CYTHON_FOUND) -- cgit v1.2.3 From 3cfc598df6a152559f10ba840a8856587e1b1888 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 14 Apr 2017 13:30:04 +0000 Subject: Fix Sphinx and unitary tests issues git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2354 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 7852df8e3fcea5b0b7f37f79f2b8b34cfd1db62c --- src/cython/doc/alpha_complex_user.rst | 102 +++++++++--------- src/cython/doc/bottleneck_distance_user.rst | 6 +- src/cython/doc/installation.rst | 4 +- src/cython/doc/rips_complex_user.rst | 156 ++++++++++++++-------------- src/cython/doc/tangential_complex_user.rst | 32 +++--- 5 files changed, 153 insertions(+), 147 deletions(-) diff --git a/src/cython/doc/alpha_complex_user.rst b/src/cython/doc/alpha_complex_user.rst index 2356944d..9aa6b13b 100644 --- a/src/cython/doc/alpha_complex_user.rst +++ b/src/cython/doc/alpha_complex_user.rst @@ -30,39 +30,40 @@ This example builds the Delaunay triangulation from the given points, and initia repr(simplex_tree.num_simplices()) + ' simplices - ' + \ repr(simplex_tree.num_vertices()) + ' vertices.' print(result_str) + fmt = '%s -> %.2f' for filtered_value in simplex_tree.get_filtration(): - print(filtered_value) + print(fmt % tuple(filtered_value)) The output is: .. testoutput:: Alpha complex is of dimension 2 - 25 simplices - 7 vertices. - ([0], 0.0) - ([1], 0.0) - ([2], 0.0) - ([3], 0.0) - ([4], 0.0) - ([5], 0.0) - ([6], 0.0) - ([2, 3], 6.25) - ([4, 5], 7.25) - ([0, 2], 8.5) - ([0, 1], 9.25) - ([1, 3], 10.0) - ([1, 2], 11.25) - ([1, 2, 3], 12.5) - ([0, 1, 2], 12.995867768595042) - ([5, 6], 13.25) - ([2, 4], 20.0) - ([4, 6], 22.736686390532547) - ([4, 5, 6], 22.736686390532547) - ([3, 6], 30.25) - ([2, 6], 36.5) - ([2, 3, 6], 36.5) - ([2, 4, 6], 37.24489795918368) - ([0, 4], 59.710743801652896) - ([0, 2, 4], 59.710743801652896) + [0] -> 0.00 + [1] -> 0.00 + [2] -> 0.00 + [3] -> 0.00 + [4] -> 0.00 + [5] -> 0.00 + [6] -> 0.00 + [2, 3] -> 6.25 + [4, 5] -> 7.25 + [0, 2] -> 8.50 + [0, 1] -> 9.25 + [1, 3] -> 10.00 + [1, 2] -> 11.25 + [1, 2, 3] -> 12.50 + [0, 1, 2] -> 13.00 + [5, 6] -> 13.25 + [2, 4] -> 20.00 + [4, 6] -> 22.74 + [4, 5, 6] -> 22.74 + [3, 6] -> 30.25 + [2, 6] -> 36.50 + [2, 3, 6] -> 36.50 + [2, 4, 6] -> 37.24 + [0, 4] -> 59.71 + [0, 2, 4] -> 59.71 Algorithm @@ -164,37 +165,38 @@ Then, it is asked to display information about the alpha complex: repr(simplex_tree.num_simplices()) + ' simplices - ' + \ repr(simplex_tree.num_vertices()) + ' vertices.' print(result_str) + fmt = '%s -> %.2f' for filtered_value in simplex_tree.get_filtration(): - print(filtered_value) + print(fmt % tuple(filtered_value)) the program output is: .. testoutput:: Alpha complex is of dimension 2 - 23 simplices - 7 vertices. - ([0], 0.0) - ([1], 0.0) - ([2], 0.0) - ([3], 0.0) - ([4], 0.0) - ([5], 0.0) - ([6], 0.0) - ([2, 3], 6.25) - ([4, 5], 7.25) - ([0, 2], 8.5) - ([0, 1], 9.25) - ([1, 3], 10.0) - ([1, 2], 11.25) - ([1, 2, 3], 12.5) - ([0, 1, 2], 12.995867768595042) - ([5, 6], 13.25) - ([2, 4], 20.0) - ([4, 6], 22.736686390532547) - ([4, 5, 6], 22.736686390532547) - ([3, 6], 30.25) - ([2, 6], 36.5) - ([2, 3, 6], 36.5) - ([2, 4, 6], 37.24489795918368) + [0] -> 0.00 + [1] -> 0.00 + [2] -> 0.00 + [3] -> 0.00 + [4] -> 0.00 + [5] -> 0.00 + [6] -> 0.00 + [2, 3] -> 6.25 + [4, 5] -> 7.25 + [0, 2] -> 8.50 + [0, 1] -> 9.25 + [1, 3] -> 10.00 + [1, 2] -> 11.25 + [1, 2, 3] -> 12.50 + [0, 1, 2] -> 13.00 + [5, 6] -> 13.25 + [2, 4] -> 20.00 + [4, 6] -> 22.74 + [4, 5, 6] -> 22.74 + [3, 6] -> 30.25 + [2, 6] -> 36.50 + [2, 3, 6] -> 36.50 + [2, 4, 6] -> 37.24 ============== CGAL citations diff --git a/src/cython/doc/bottleneck_distance_user.rst b/src/cython/doc/bottleneck_distance_user.rst index 8c29d069..546a15bb 100644 --- a/src/cython/doc/bottleneck_distance_user.rst +++ b/src/cython/doc/bottleneck_distance_user.rst @@ -23,15 +23,15 @@ This example computes the bottleneck distance from 2 persistence diagrams: diag1 = [[2.7, 3.7],[9.6, 14.],[34.2, 34.974], [3.,float('Inf')]] diag2 = [[2.8, 4.45],[9.5, 14.1],[3.2,float('Inf')]] - message = "Bottleneck distance approximation=" + repr(gudhi.bottleneck_distance(diag1, diag2, 0.1)) + message = "Bottleneck distance approximation=" + '%.2f' % gudhi.bottleneck_distance(diag1, diag2, 0.1) print(message) - message = "Bottleneck distance exact value=" + repr(gudhi.bottleneck_distance(diag1, diag2, 0)) + message = "Bottleneck distance exact value=" + '%.2f' % gudhi.bottleneck_distance(diag1, diag2, 0) print(message) The output is: .. testoutput:: - Bottleneck distance approximation=0.8081763781405569 + Bottleneck distance approximation=0.81 Bottleneck distance exact value=0.75 diff --git a/src/cython/doc/installation.rst b/src/cython/doc/installation.rst index 373e0717..f98a5039 100644 --- a/src/cython/doc/installation.rst +++ b/src/cython/doc/installation.rst @@ -33,7 +33,7 @@ To build the GUDHI cython module, run the following commands in a terminal: Test suites =========== -To test your build, `py.test `_ is required. Run the +To test your build, `py.test `_ is optional. Run the following command in a terminal: .. code-block:: bash @@ -41,7 +41,7 @@ following command in a terminal: cd /path-to-gudhi/build/cython # For windows, you have to set PYTHONPATH environment variable export PYTHONPATH='$PYTHONPATH:/path-to-gudhi/build/cython' - py.test + ctest -R py_test Documentation ============= diff --git a/src/cython/doc/rips_complex_user.rst b/src/cython/doc/rips_complex_user.rst index c89409a0..65d10304 100644 --- a/src/cython/doc/rips_complex_user.rst +++ b/src/cython/doc/rips_complex_user.rst @@ -60,8 +60,9 @@ Finally, it is asked to display information about the simplicial complex. repr(simplex_tree.num_simplices()) + ' simplices - ' + \ repr(simplex_tree.num_vertices()) + ' vertices.' print(result_str) + fmt = '%s -> %.2f' for filtered_value in simplex_tree.get_filtration(): - print(filtered_value) + print(fmt % tuple(filtered_value)) When launching (Rips maximal distance between 2 points is 12.0, is expanded until dimension 1 - one skeleton graph in other words), the output is: @@ -69,24 +70,24 @@ until dimension 1 - one skeleton graph in other words), the output is: .. testoutput:: Rips complex is of dimension 1 - 18 simplices - 7 vertices. - ([0], 0.0) - ([1], 0.0) - ([2], 0.0) - ([3], 0.0) - ([4], 0.0) - ([5], 0.0) - ([6], 0.0) - ([2, 3], 5.0) - ([4, 5], 5.385164807134504) - ([0, 2], 5.830951894845301) - ([0, 1], 6.082762530298219) - ([1, 3], 6.324555320336759) - ([1, 2], 6.708203932499369) - ([5, 6], 7.280109889280518) - ([2, 4], 8.94427190999916) - ([0, 3], 9.433981132056603) - ([4, 6], 9.486832980505138) - ([3, 6], 11.0) + [0] -> 0.00 + [1] -> 0.00 + [2] -> 0.00 + [3] -> 0.00 + [4] -> 0.00 + [5] -> 0.00 + [6] -> 0.00 + [2, 3] -> 5.00 + [4, 5] -> 5.39 + [0, 2] -> 5.83 + [0, 1] -> 6.08 + [1, 3] -> 6.32 + [1, 2] -> 6.71 + [5, 6] -> 7.28 + [2, 4] -> 8.94 + [0, 3] -> 9.43 + [4, 6] -> 9.49 + [3, 6] -> 11.00 Example from OFF file ^^^^^^^^^^^^^^^^^^^^^ @@ -107,32 +108,33 @@ Finally, it is asked to display information about the Rips complex. repr(simplex_tree.num_simplices()) + ' simplices - ' + \ repr(simplex_tree.num_vertices()) + ' vertices.' print(result_str) + fmt = '%s -> %.2f' for filtered_value in simplex_tree.get_filtration(): - print(filtered_value) + print(fmt % tuple(filtered_value)) the program output is: .. testoutput:: Rips complex is of dimension 1 - 18 simplices - 7 vertices. - ([0], 0.0) - ([1], 0.0) - ([2], 0.0) - ([3], 0.0) - ([4], 0.0) - ([5], 0.0) - ([6], 0.0) - ([2, 3], 5.0) - ([4, 5], 5.385164807134504) - ([0, 2], 5.830951894845301) - ([0, 1], 6.082762530298219) - ([1, 3], 6.324555320336759) - ([1, 2], 6.708203932499369) - ([5, 6], 7.280109889280518) - ([2, 4], 8.94427190999916) - ([0, 3], 9.433981132056603) - ([4, 6], 9.486832980505138) - ([3, 6], 11.0) + [0] -> 0.00 + [1] -> 0.00 + [2] -> 0.00 + [3] -> 0.00 + [4] -> 0.00 + [5] -> 0.00 + [6] -> 0.00 + [2, 3] -> 5.00 + [4, 5] -> 5.39 + [0, 2] -> 5.83 + [0, 1] -> 6.08 + [1, 3] -> 6.32 + [1, 2] -> 6.71 + [5, 6] -> 7.28 + [2, 4] -> 8.94 + [0, 3] -> 9.43 + [4, 6] -> 9.49 + [3, 6] -> 11.00 Distance matrix --------------- @@ -162,8 +164,9 @@ Finally, it is asked to display information about the simplicial complex. repr(simplex_tree.num_simplices()) + ' simplices - ' + \ repr(simplex_tree.num_vertices()) + ' vertices.' print(result_str) + fmt = '%s -> %.2f' for filtered_value in simplex_tree.get_filtration(): - print(filtered_value) + print(fmt % tuple(filtered_value)) When launching (Rips maximal distance between 2 points is 12.0, is expanded until dimension 1 - one skeleton graph in other words), the output is: @@ -171,24 +174,24 @@ until dimension 1 - one skeleton graph in other words), the output is: .. testoutput:: Rips complex is of dimension 1 - 18 simplices - 7 vertices. - ([0], 0.0) - ([1], 0.0) - ([2], 0.0) - ([3], 0.0) - ([4], 0.0) - ([5], 0.0) - ([6], 0.0) - ([2, 3], 5.0) - ([4, 5], 5.3851648071) - ([0, 2], 5.8309518948) - ([0, 1], 6.0827625303) - ([1, 3], 6.3245553203) - ([1, 2], 6.7082039325) - ([5, 6], 7.2801098893) - ([2, 4], 8.94427191) - ([0, 3], 9.4339811321) - ([4, 6], 9.4868329805) - ([3, 6], 11.0) + [0] -> 0.00 + [1] -> 0.00 + [2] -> 0.00 + [3] -> 0.00 + [4] -> 0.00 + [5] -> 0.00 + [6] -> 0.00 + [2, 3] -> 5.00 + [4, 5] -> 5.39 + [0, 2] -> 5.83 + [0, 1] -> 6.08 + [1, 3] -> 6.32 + [1, 2] -> 6.71 + [5, 6] -> 7.28 + [2, 4] -> 8.94 + [0, 3] -> 9.43 + [4, 6] -> 9.49 + [3, 6] -> 11.00 Example from csv file ^^^^^^^^^^^^^^^^^^^^^ @@ -209,29 +212,30 @@ Finally, it is asked to display information about the Rips complex. repr(simplex_tree.num_simplices()) + ' simplices - ' + \ repr(simplex_tree.num_vertices()) + ' vertices.' print(result_str) + fmt = '%s -> %.2f' for filtered_value in simplex_tree.get_filtration(): - print(filtered_value) + print(fmt % tuple(filtered_value)) the program output is: .. testoutput:: Rips complex is of dimension 1 - 18 simplices - 7 vertices. - ([0], 0.0) - ([1], 0.0) - ([2], 0.0) - ([3], 0.0) - ([4], 0.0) - ([5], 0.0) - ([6], 0.0) - ([2, 3], 5.0) - ([4, 5], 5.3851648071) - ([0, 2], 5.8309518948) - ([0, 1], 6.0827625303) - ([1, 3], 6.3245553203) - ([1, 2], 6.7082039325) - ([5, 6], 7.2801098893) - ([2, 4], 8.94427191) - ([0, 3], 9.4339811321) - ([4, 6], 9.4868329805) - ([3, 6], 11.0) + [0] -> 0.00 + [1] -> 0.00 + [2] -> 0.00 + [3] -> 0.00 + [4] -> 0.00 + [5] -> 0.00 + [6] -> 0.00 + [2, 3] -> 5.00 + [4, 5] -> 5.39 + [0, 2] -> 5.83 + [0, 1] -> 6.08 + [1, 3] -> 6.32 + [1, 2] -> 6.71 + [5, 6] -> 7.28 + [2, 4] -> 8.94 + [0, 3] -> 9.43 + [4, 6] -> 9.49 + [3, 6] -> 11.00 diff --git a/src/cython/doc/tangential_complex_user.rst b/src/cython/doc/tangential_complex_user.rst index 24f68f85..b2f40cce 100644 --- a/src/cython/doc/tangential_complex_user.rst +++ b/src/cython/doc/tangential_complex_user.rst @@ -134,7 +134,7 @@ This example builds the Tangential complex of point set read in an OFF file. repr(st.num_vertices()) + ' vertices.' print(result_str) for filtered_value in st.get_filtration(): - print(filtered_value) + print(filtered_value[0]) The output is: @@ -142,21 +142,21 @@ The output is: Tangential contains 12 simplices - 7 vertices. Simplex tree is of dimension 1 - 15 simplices - 7 vertices. - ([0], 0.0) - ([1], 0.0) - ([0, 1], 0.0) - ([2], 0.0) - ([0, 2], 0.0) - ([1, 2], 0.0) - ([3], 0.0) - ([1, 3], 0.0) - ([4], 0.0) - ([2, 4], 0.0) - ([5], 0.0) - ([4, 5], 0.0) - ([6], 0.0) - ([3, 6], 0.0) - ([5, 6], 0.0) + [0] + [1] + [0, 1] + [2] + [0, 2] + [1, 2] + [3] + [1, 3] + [4] + [2, 4] + [5] + [4, 5] + [6] + [3, 6] + [5, 6] Example with perturbation -- cgit v1.2.3 From d6a1577f46f84f606370662bd2629876ca113c81 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 14 Apr 2017 14:39:44 +0000 Subject: Fix Title level inconsistencies git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2356 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 755e450afddf28f87164a8f1f22c1f58faf9658a --- src/cython/doc/alpha_complex_user.rst | 2 -- src/cython/doc/bottleneck_distance_user.rst | 1 - src/cython/doc/cubical_complex_user.rst | 3 +-- src/cython/doc/persistence_graphical_tools_user.rst | 1 - src/cython/doc/persistent_cohomology_user.rst | 3 +-- src/cython/doc/rips_complex_user.rst | 1 - src/cython/doc/tangential_complex_user.rst | 3 +-- src/cython/doc/witness_complex_user.rst | 6 +----- 8 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/cython/doc/alpha_complex_user.rst b/src/cython/doc/alpha_complex_user.rst index 9aa6b13b..e8268ef1 100644 --- a/src/cython/doc/alpha_complex_user.rst +++ b/src/cython/doc/alpha_complex_user.rst @@ -1,4 +1,3 @@ -========================= Alpha complex user manual ========================= Definition @@ -198,7 +197,6 @@ the program output is: [2, 3, 6] -> 36.50 [2, 4, 6] -> 37.24 -============== CGAL citations ============== diff --git a/src/cython/doc/bottleneck_distance_user.rst b/src/cython/doc/bottleneck_distance_user.rst index 546a15bb..0066992f 100644 --- a/src/cython/doc/bottleneck_distance_user.rst +++ b/src/cython/doc/bottleneck_distance_user.rst @@ -1,4 +1,3 @@ -=============================== Bottleneck distance user manual =============================== Definition diff --git a/src/cython/doc/cubical_complex_user.rst b/src/cython/doc/cubical_complex_user.rst index 692acdd9..344b9554 100644 --- a/src/cython/doc/cubical_complex_user.rst +++ b/src/cython/doc/cubical_complex_user.rst @@ -1,4 +1,3 @@ -=========================== Cubical complex user manual =========================== Definition @@ -154,7 +153,7 @@ Examples. End user programs are available in cython/example/ folder. Bibliography -************ +============ .. bibliography:: bibliography.bib :filter: docnames diff --git a/src/cython/doc/persistence_graphical_tools_user.rst b/src/cython/doc/persistence_graphical_tools_user.rst index f713e971..cae18323 100644 --- a/src/cython/doc/persistence_graphical_tools_user.rst +++ b/src/cython/doc/persistence_graphical_tools_user.rst @@ -1,4 +1,3 @@ -======================================= Persistence graphical tools user manual ======================================= Definition diff --git a/src/cython/doc/persistent_cohomology_user.rst b/src/cython/doc/persistent_cohomology_user.rst index 69be3b86..72f1a7f7 100644 --- a/src/cython/doc/persistent_cohomology_user.rst +++ b/src/cython/doc/persistent_cohomology_user.rst @@ -1,4 +1,3 @@ -================================= Persistent cohomology user manual ================================= Definition @@ -108,7 +107,7 @@ We provide several example files: run these examples with -h for details on thei * :download:`tangential_complex_plain_homology_from_off_file_example.py <../example/tangential_complex_plain_homology_from_off_file_example.py>` Bibliography -************ +============ .. bibliography:: bibliography.bib :filter: docnames diff --git a/src/cython/doc/rips_complex_user.rst b/src/cython/doc/rips_complex_user.rst index 65d10304..f9760976 100644 --- a/src/cython/doc/rips_complex_user.rst +++ b/src/cython/doc/rips_complex_user.rst @@ -1,4 +1,3 @@ -========================= Rips complex user manual ========================= Definition diff --git a/src/cython/doc/tangential_complex_user.rst b/src/cython/doc/tangential_complex_user.rst index b2f40cce..10fc37ed 100644 --- a/src/cython/doc/tangential_complex_user.rst +++ b/src/cython/doc/tangential_complex_user.rst @@ -1,4 +1,3 @@ -============================== Tangential complex user manual ============================== .. include:: tangential_complex_sum.rst @@ -188,7 +187,7 @@ The output is: Inconsistencies has been fixed. Bibliography -************ +============ .. bibliography:: bibliography.bib :filter: docnames diff --git a/src/cython/doc/witness_complex_user.rst b/src/cython/doc/witness_complex_user.rst index 07945361..aa9cbb2c 100644 --- a/src/cython/doc/witness_complex_user.rst +++ b/src/cython/doc/witness_complex_user.rst @@ -1,12 +1,8 @@ -=========================== Witness complex user manual =========================== -Definition ----------- .. include:: witness_complex_sum.rst - Definitions ----------- @@ -128,7 +124,7 @@ Here is an example of constructing a strong witness complex filtration and compu * :download:`euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py <../example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py>` Bibliography -************ +============ .. bibliography:: bibliography.bib :filter: docnames -- cgit v1.2.3 From 8eb632a06e27efef31f890db9e4132aa2a6e82b1 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 14 Apr 2017 15:18:48 +0000 Subject: Fix doc level inconsistencies git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST_cythonize@2357 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 2da8fae99b18cf215de376980266f1281ac95172 --- src/cython/doc/simplex_tree_user.rst | 1 - src/cython/doc/tangential_complex_user.rst | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cython/doc/simplex_tree_user.rst b/src/cython/doc/simplex_tree_user.rst index b2efca8b..4b1dde19 100644 --- a/src/cython/doc/simplex_tree_user.rst +++ b/src/cython/doc/simplex_tree_user.rst @@ -1,4 +1,3 @@ -======================== Simplex tree user manual ======================== Definition diff --git a/src/cython/doc/tangential_complex_user.rst b/src/cython/doc/tangential_complex_user.rst index 10fc37ed..03f9fea6 100644 --- a/src/cython/doc/tangential_complex_user.rst +++ b/src/cython/doc/tangential_complex_user.rst @@ -186,6 +186,7 @@ The output is: Tangential contains 4 vertices. Inconsistencies has been fixed. + Bibliography ============ -- cgit v1.2.3 From 64f04c1f15d9ccc4311d162d988c35a3d4130ace Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 14 Apr 2017 16:00:00 +0000 Subject: Remove scripts/generate_version.sh, use make user_version Remove GUDHIVersion.cmake.in (was for scripts/generate_version.sh) and CMakeLists.txt mechanism Modify src/Bitmap_cubical_complex/example/CMakeLists.txt to generate files in build directory git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2358 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 32c73be6aa9a0a6fcfde09ebf21ff38d48abf5e0 --- CMakeLists.txt | 2 - GUDHIVersion.cmake.in | 1 - scripts/generate_version.sh | 124 ---------------------- src/Bitmap_cubical_complex/example/CMakeLists.txt | 27 ++++- src/CMakeLists.txt | 2 - src/cmake/modules/GUDHI_user_version_target.txt | 2 - 6 files changed, 23 insertions(+), 135 deletions(-) delete mode 100644 GUDHIVersion.cmake.in delete mode 100755 scripts/generate_version.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index aef771d0..35604652 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(GUDHIdev) include(CMakeGUDHIVersion.txt) -# Generate GUDHI official version file -configure_file(GUDHIVersion.cmake.in "${CMAKE_SOURCE_DIR}/GUDHIVersion.cmake" @ONLY) set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/src/cmake/modules/") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/cmake/modules/") diff --git a/GUDHIVersion.cmake.in b/GUDHIVersion.cmake.in deleted file mode 100644 index 2f433c1c..00000000 --- a/GUDHIVersion.cmake.in +++ /dev/null @@ -1 +0,0 @@ -@GUDHI_VERSION@ diff --git a/scripts/generate_version.sh b/scripts/generate_version.sh deleted file mode 100755 index f999c6c4..00000000 --- a/scripts/generate_version.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -#usage bash generate_version.sh : dont generate if svn st non empty -#usage bash generate_version.sh -f : generate even if svn is empty -#usage bash generate_version.sh -f DIR : generate even if svn is empty and save library in dir -# -# 23/06/2015 - Remove source, add biblio, and doc -# 06/10/2015 - Replace static Version.txt with generated GUDHIVersion.cmake file -# VERSION CHECK -ROOT_DIR=.. -VERSION_FILE="$ROOT_DIR/GUDHIVersion.cmake" - -if [ ! -f $VERSION_FILE ]; then - echo "File not found! : $VERSION_FILE - Please launch cmake first to generate file" - exit 1 -fi - -# SVN STATUS CHECK OR IF FORCED BY USER -if [ "$1" != "-f" ] -then - SVN_STATUS=`svn status $ROOT_DIR | grep -v $VERSION_FILE` - echo $SVN_STATUS -fi - - -TARGET_DIR="" -if [ "$2" != "-f" ] -then - TARGET_DIR=$2 - echo "Install folder : $TARGET_DIR" -fi - -if [ "$SVN_STATUS" != "" ] -then - echo "Svn status must be empty to create a version!" - exit 1 -fi - -# TEMPORARY FOLDER CREATION -VERSION_DATE=`date +"%Y-%m-%d-%H-%M-%S"` -GUDHI="_GUDHI_" -VERSION_REVISION=`cat $VERSION_FILE` -VERSION_DIR="$VERSION_DATE$GUDHI$VERSION_REVISION" -echo $VERSION_DIR -mkdir "$VERSION_DIR" - -# TOP LEVEL FILE COPY -cp $ROOT_DIR/README $VERSION_DIR -cp $ROOT_DIR/Conventions.txt $VERSION_DIR -cp $ROOT_DIR/COPYING $VERSION_DIR -cp -R $ROOT_DIR/data $VERSION_DIR -cp $ROOT_DIR/src/CMakeLists.txt $VERSION_DIR -cp $ROOT_DIR/src/Doxyfile $VERSION_DIR -cp -R $ROOT_DIR/biblio $VERSION_DIR -cp $ROOT_DIR/src/GUDHIConfigVersion.cmake.in $VERSION_DIR -cp $ROOT_DIR/src/GUDHIConfig.cmake.in $VERSION_DIR -cp $ROOT_DIR/CMakeGUDHIVersion.txt $VERSION_DIR -cp $ROOT_DIR/GUDHIVersion.cmake.in $VERSION_DIR - -# PACKAGE LEVEL COPY -PACKAGE_INC_DIR="/include" -PACKAGE_EX_DIR="/example" -PACKAGE_CONCEPT_DIR="/concept" -PACKAGE_DOC_DIR="/doc" -for package in `ls $ROOT_DIR/src/` -do - if [ -d "$ROOT_DIR/src/$package" ] && [ $package != "Bottleneck" ] - then - echo $package - if [ "$package" == "cmake" ] - then - # SPECIFIC FOR CMAKE MODULES - cp -R $ROOT_DIR/src/$package $VERSION_DIR - elif [ "$package" == "GudhUI" ] - then - # SPECIFIC FOR GUDHI USER INTERFACE - cp -R $ROOT_DIR/src/$package $VERSION_DIR - elif [ "$package" == "cython" ] - then - # SPECIFIC FOR CYTHON INTERFACE - cp -R $ROOT_DIR/src/$package $VERSION_DIR - else - # PACKAGE COPY - if [ -d "$ROOT_DIR/src/$package$PACKAGE_INC_DIR" ] - then - if [ ! -d "$VERSION_DIR$PACKAGE_INC_DIR" ] - then - # MUST CREATE DIRECTORY ON FIRST LOOP - mkdir $VERSION_DIR$PACKAGE_INC_DIR - fi - cp -R $ROOT_DIR/src/$package$PACKAGE_INC_DIR/* $VERSION_DIR$PACKAGE_INC_DIR/ - fi - if [ -d "$ROOT_DIR/src/$package$PACKAGE_EX_DIR" ] - then - mkdir -p $VERSION_DIR$PACKAGE_EX_DIR/$package - cp -R $ROOT_DIR/src/$package$PACKAGE_EX_DIR/* $VERSION_DIR$PACKAGE_EX_DIR/$package - fi - if [ -d "$ROOT_DIR/src/$package$PACKAGE_CONCEPT_DIR" ] - then - mkdir -p $VERSION_DIR$PACKAGE_CONCEPT_DIR/$package - cp -R $ROOT_DIR/src/$package$PACKAGE_CONCEPT_DIR/* $VERSION_DIR$PACKAGE_CONCEPT_DIR/$package - fi - if [ -d "$ROOT_DIR/src/$package$PACKAGE_DOC_DIR" ] - then - mkdir -p $VERSION_DIR$PACKAGE_DOC_DIR/$package - cp -R $ROOT_DIR/src/$package$PACKAGE_DOC_DIR/* $VERSION_DIR$PACKAGE_DOC_DIR/$package - fi - fi - fi -done - - -#INSTALL to some directory -if [ "$TARGET_DIR" != "" ]; then - echo "Install in dir $TARGET_DIR" - mv "$VERSION_DIR" "$TARGET_DIR" -else - # ZIP DIR AND REMOVE IT - tar -zcf "$VERSION_DIR.tar.gz" "$VERSION_DIR" - rm -rf "$VERSION_DIR" -fi - - - - diff --git a/src/Bitmap_cubical_complex/example/CMakeLists.txt b/src/Bitmap_cubical_complex/example/CMakeLists.txt index 2fddc514..97a45190 100644 --- a/src/Bitmap_cubical_complex/example/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/example/CMakeLists.txt @@ -6,8 +6,18 @@ target_link_libraries(Bitmap_cubical_complex ${Boost_SYSTEM_LIBRARY}) if (TBB_FOUND) target_link_libraries(Bitmap_cubical_complex ${TBB_LIBRARIES}) 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) + +# Do not forget to copy test files in current binary dir +file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/CubicalOneSphere.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) +file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/CubicalTwoSphere.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) + +add_test(Bitmap_cubical_complex_one_sphere + ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex + ${CMAKE_CURRENT_BINARY_DIR}/CubicalOneSphere.txt) + +add_test(Bitmap_cubical_complex_two_sphere + ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex + ${CMAKE_CURRENT_BINARY_DIR}/CubicalTwoSphere.txt) add_executable ( Random_bitmap_cubical_complex Random_bitmap_cubical_complex.cpp ) target_link_libraries(Random_bitmap_cubical_complex ${Boost_SYSTEM_LIBRARY}) @@ -21,6 +31,15 @@ target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${Boos if (TBB_FOUND) target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${TBB_LIBRARIES}) 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) + +# Do not forget to copy test files in current binary dir +file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/2d_torus.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) +file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/3d_torus.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) + +add_test(Bitmap_cubical_complex_periodic_2d_torus + ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex_periodic_boundary_conditions + ${CMAKE_CURRENT_BINARY_DIR}/2d_torus.txt) +add_test(Bitmap_cubical_complex_periodic_3d_torus + ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex_periodic_boundary_conditions + ${CMAKE_CURRENT_BINARY_DIR}/3d_torus.txt) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0c16c9cc..708f3649 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(GUDHI) include("CMakeGUDHIVersion.txt") -# Generate GUDHI official version file -configure_file(GUDHIVersion.cmake.in "${CMAKE_SOURCE_DIR}/GUDHIVersion.cmake" @ONLY) enable_testing() diff --git a/src/cmake/modules/GUDHI_user_version_target.txt b/src/cmake/modules/GUDHI_user_version_target.txt index 13fccd32..ca6bcd34 100644 --- a/src/cmake/modules/GUDHI_user_version_target.txt +++ b/src/cmake/modules/GUDHI_user_version_target.txt @@ -35,8 +35,6 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.11) copy ${CMAKE_SOURCE_DIR}/src/GUDHIConfig.cmake.in ${GUDHI_USER_VERSION_DIR}/GUDHIConfig.cmake.in) add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/CMakeGUDHIVersion.txt ${GUDHI_USER_VERSION_DIR}/CMakeGUDHIVersion.txt) - add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E - copy ${CMAKE_SOURCE_DIR}/GUDHIVersion.cmake.in ${GUDHI_USER_VERSION_DIR}/GUDHIVersion.cmake.in) add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/biblio ${GUDHI_USER_VERSION_DIR}/biblio) -- cgit v1.2.3 -- cgit v1.2.3 From 2f63617adf4ea8b2fe07c6125d7f582b978cb922 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 18 Apr 2017 13:24:54 +0000 Subject: Rename CMake tests Add specific GUDHI test coverage function Rename cmake/modules/GUDHI_*.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/add_test_windows@2362 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 071b1eda7d11b1781a9601a013b88a0b2a9b7bf7 --- CMakeLists.txt | 4 +- data/points/generator/CMakeLists.txt | 19 +-- data/points/generator/README | 8 +- src/Alpha_complex/example/CMakeLists.txt | 28 ++-- src/Alpha_complex/test/CMakeLists.txt | 19 +-- src/CMakeLists.txt | 4 +- src/cmake/modules/GUDHI_doxygen_target.cmake | 11 ++ src/cmake/modules/GUDHI_doxygen_target.txt | 11 -- src/cmake/modules/GUDHI_test_coverage.cmake | 15 +++ .../modules/GUDHI_third_party_libraries.cmake | 144 +++++++++++++++++++++ src/cmake/modules/GUDHI_third_party_libraries.txt | 144 --------------------- 11 files changed, 209 insertions(+), 198 deletions(-) create mode 100644 src/cmake/modules/GUDHI_doxygen_target.cmake delete mode 100644 src/cmake/modules/GUDHI_doxygen_target.txt create mode 100644 src/cmake/modules/GUDHI_test_coverage.cmake create mode 100644 src/cmake/modules/GUDHI_third_party_libraries.cmake delete mode 100644 src/cmake/modules/GUDHI_third_party_libraries.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 35604652..324f8648 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,11 +13,11 @@ enable_testing() # For "make user_version" include("${CMAKE_MODULE_PATH}/GUDHI_user_version_target.txt") # For "make doxygen" -include("${CMAKE_MODULE_PATH}/GUDHI_doxygen_target.txt") +include(GUDHI_doxygen_target) # This variable is used by Cython CMakeLists.txt to know its path set(GUDHI_CYTHON_PATH "src/cython") # For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH -include("${CMAKE_MODULE_PATH}/GUDHI_third_party_libraries.txt") +include(GUDHI_third_party_libraries) if(MSVC) # Turn off some VC++ warnings diff --git a/data/points/generator/CMakeLists.txt b/data/points/generator/CMakeLists.txt index 9a7f7bce..88d377a7 100644 --- a/data/points/generator/CMakeLists.txt +++ b/data/points/generator/CMakeLists.txt @@ -1,14 +1,15 @@ cmake_minimum_required(VERSION 2.6) -project(Data_points_generator) +project(data_points_generator) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) - add_executable ( hypergenerator hypergenerator.cpp ) - target_link_libraries(hypergenerator ${Boost_SYSTEM_LIBRARY}) - add_test(hypergenerator_on_sphere_3000_10_5.0 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator on sphere onSphere.off 3000 10 5.0) - add_test(hypergenerator_on_sphere_10000_3 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator on sphere onSphere.off 10000 3) - add_test(hypergenerator_in_sphere_7000_12_10.8 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in sphere inSphere.off 7000 12 10.8) - add_test(hypergenerator_in_sphere_50000_2 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in sphere inSphere.off 50000 2) + add_executable ( data_points_generator hypergenerator.cpp ) + target_link_libraries(data_points_generator ${Boost_SYSTEM_LIBRARY}) + add_test(NAME data_points_generator_on_sphere_1000_3_15.2 COMMAND $ + "on" "sphere" "onSphere.off" "1000" "3" "15.2") + add_test(NAME data_points_generator_in_sphere_100_2 COMMAND $ + "in" "sphere" "inSphere.off" "100" "2") + # on cube is not available in CGAL - add_test(hypergenerator_in_cube_7000_12_10.8 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in cube inCube.off 7000 12 10.8) - add_test(hypergenerator_in_cube_50000_2 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in cube inCube.off 50000 3) + add_test(NAME data_points_generator_in_cube_10000_3_5.8 COMMAND $ + "in" "cube" "inCube.off" "10000" "3" "5.8") endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) diff --git a/data/points/generator/README b/data/points/generator/README index 41cb9165..951bcfe1 100644 --- a/data/points/generator/README +++ b/data/points/generator/README @@ -7,21 +7,21 @@ cmake . cd /path-to-data-generator/ make -=========================== hypergenerator ===================================== +======================= data_points_generator ================================== Example of use : *** Hyper sphere|cube generator -./hypergenerator on sphere onSphere.off 1000 3 15.2 +./data_points_generator on sphere onSphere.off 1000 3 15.2 => generates a onSphere.off file with 1000 points randomized on a sphere of dimension 3 and radius 15.2 -./hypergenerator in sphere inSphere.off 100 2 +./data_points_generator in sphere inSphere.off 100 2 => generates a inSphere.off file with 100 points randomized in a sphere of dimension 2 (circle) and radius 1.0 (default) -./hypergenerator in cube inCube.off 10000 3 5.8 +./data_points_generator in cube inCube.off 10000 3 5.8 => generates a inCube.off file with 10000 points randomized in a cube of dimension 3 and side 5.8 diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index b9bcdb55..ab09fe91 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -4,26 +4,30 @@ project(Alpha_complex_examples) # need CGAL 4.7 # cmake -DCGAL_DIR=~/workspace/CGAL-4.7 .. if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) - add_executable ( alphapoints Alpha_complex_from_points.cpp ) - target_link_libraries(alphapoints ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) - add_executable ( alphaoffreader Alpha_complex_from_off.cpp ) - target_link_libraries(alphaoffreader ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) + add_executable ( Alpha_complex_example_from_points Alpha_complex_from_points.cpp ) + target_link_libraries(Alpha_complex_example_from_points ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) + add_executable ( Alpha_complex_example_from_off Alpha_complex_from_off.cpp ) + target_link_libraries(Alpha_complex_example_from_off ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) if (TBB_FOUND) - target_link_libraries(alphapoints ${TBB_LIBRARIES}) - target_link_libraries(alphaoffreader ${TBB_LIBRARIES}) + target_link_libraries(Alpha_complex_example_from_points ${TBB_LIBRARIES}) + target_link_libraries(Alpha_complex_example_from_off ${TBB_LIBRARIES}) endif() - add_test(alphapoints ${CMAKE_CURRENT_BINARY_DIR}/alphapoints) + add_test(NAME Alpha_complex_example_from_points COMMAND $) + # 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_test(alphaoffreader_doc_60 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader alphacomplexdoc.off 60.0 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt) - add_test(alphaoffreader_doc_32 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader alphacomplexdoc.off 32.0 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt) + add_test(NAME Alpha_complex_example_from_off_60 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "60.0" "${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt") + add_test(NAME Alpha_complex_example_from_off_32 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "32.0" "${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt") if (DIFF_PATH) # Do not forget to copy test results files in current binary dir file(COPY "alphaoffreader_for_doc_32.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) file(COPY "alphaoffreader_for_doc_60.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - add_test(alphaoffreader_doc_60_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_60.txt) - add_test(alphaoffreader_doc_32_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt) + add_test(Alpha_complex_example_from_off_60_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_60.txt) + add_test(Alpha_complex_example_from_off_32_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt) endif() endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt index 32091196..59f86c5b 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -1,28 +1,19 @@ cmake_minimum_required(VERSION 2.6) project(Alpha_complex_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) - add_executable ( AlphaComplexUT Alpha_complex_unit_test.cpp ) - target_link_libraries(AlphaComplexUT ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable ( Alpha_complex_unit_test Alpha_complex_unit_test.cpp ) + target_link_libraries(Alpha_complex_unit_test ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(AlphaComplexUT ${TBB_LIBRARIES}) + target_link_libraries(Alpha_complex_unit_test ${TBB_LIBRARIES}) 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}/) - add_test(AlphaComplexUT ${CMAKE_CURRENT_BINARY_DIR}/AlphaComplexUT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/AlphaComplexUT.xml --log_level=test_suite --report_level=no) + gudhi_add_coverage_test(Alpha_complex_unit_test) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 708f3649..ebcb6888 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,12 +9,12 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") # For "make doxygen" set(GUDHI_USER_VERSION_DIR ${CMAKE_SOURCE_DIR}) -include(${CMAKE_MODULE_PATH}/GUDHI_doxygen_target.txt) +include(GUDHI_doxygen_target) # This variable is used by Cython CMakeLists.txt to know its path set(GUDHI_CYTHON_PATH "cython") # For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH -include("${CMAKE_MODULE_PATH}/GUDHI_third_party_libraries.txt") +include(GUDHI_third_party_libraries) if(MSVC) # Turn off some VC++ warnings diff --git a/src/cmake/modules/GUDHI_doxygen_target.cmake b/src/cmake/modules/GUDHI_doxygen_target.cmake new file mode 100644 index 00000000..d2cb952d --- /dev/null +++ b/src/cmake/modules/GUDHI_doxygen_target.cmake @@ -0,0 +1,11 @@ +# add a target to generate API documentation with Doxygen +find_package(Doxygen) +if(DOXYGEN_FOUND) + # configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + + add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${GUDHI_USER_VERSION_DIR}/Doxyfile + WORKING_DIRECTORY ${GUDHI_USER_VERSION_DIR} + DEPENDS ${GUDHI_USER_VERSION_DIR}/Doxyfile ${GUDHI_DOXYGEN_DEPENDENCY} + COMMENT "Generating API documentation with Doxygen in ${GUDHI_USER_VERSION_DIR}/doc/html/" VERBATIM) + +endif(DOXYGEN_FOUND) diff --git a/src/cmake/modules/GUDHI_doxygen_target.txt b/src/cmake/modules/GUDHI_doxygen_target.txt deleted file mode 100644 index d2cb952d..00000000 --- a/src/cmake/modules/GUDHI_doxygen_target.txt +++ /dev/null @@ -1,11 +0,0 @@ -# add a target to generate API documentation with Doxygen -find_package(Doxygen) -if(DOXYGEN_FOUND) - # configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) - - add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${GUDHI_USER_VERSION_DIR}/Doxyfile - WORKING_DIRECTORY ${GUDHI_USER_VERSION_DIR} - DEPENDS ${GUDHI_USER_VERSION_DIR}/Doxyfile ${GUDHI_DOXYGEN_DEPENDENCY} - COMMENT "Generating API documentation with Doxygen in ${GUDHI_USER_VERSION_DIR}/doc/html/" VERBATIM) - -endif(DOXYGEN_FOUND) diff --git a/src/cmake/modules/GUDHI_test_coverage.cmake b/src/cmake/modules/GUDHI_test_coverage.cmake new file mode 100644 index 00000000..bf7ad7e4 --- /dev/null +++ b/src/cmake/modules/GUDHI_test_coverage.cmake @@ -0,0 +1,15 @@ + +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() + +function(gudhi_add_coverage_test unitary_test) + message("++ ${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml") + add_test(NAME ${unitary_test} COMMAND $ + "--log_format=XML" "--log_sink=${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml" "--log_level=test_suite" "--report_level=no") +endfunction() diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake new file mode 100644 index 00000000..5f84c602 --- /dev/null +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -0,0 +1,144 @@ +# This files manage third party libraries required by GUDHI + +find_package(Boost REQUIRED COMPONENTS system filesystem unit_test_framework chrono timer date_time program_options thread) + +if(NOT Boost_FOUND) + message(FATAL_ERROR "NOTICE: This program requires Boost and will not be compiled.") +endif(NOT Boost_FOUND) + +find_package(GMP) +if(GMP_FOUND) + message(STATUS "GMP_LIBRARIES = ${GMP_LIBRARIES}") + INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR}) + find_package(GMPXX) + if(GMPXX_FOUND) + message(STATUS "GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") + INCLUDE_DIRECTORIES(${GMPXX_INCLUDE_DIR}) + endif() +endif() + +# In CMakeLists.txt, when include(${CGAL_USE_FILE}), CMAKE_CXX_FLAGS are overwritten. +# cf. http://doc.cgal.org/latest/Manual/installation.html#title40 +# A workaround is to include(${CGAL_USE_FILE}) before adding "-std=c++11". +# A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html +# or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html +# but it implies to use cmake version 3.1 at least. +find_package(CGAL) + +# Only CGAL versions > 4.4 supports what Gudhi uses from CGAL +if (CGAL_VERSION VERSION_LESS 4.4.0) + message("CGAL version ${CGAL_VERSION} is considered too old to be used by Gudhi.") + unset(CGAL_FOUND) +endif() +if(CGAL_FOUND) + message(STATUS "CGAL version: ${CGAL_VERSION}.") + include( ${CGAL_USE_FILE} ) + + if (NOT CGAL_VERSION VERSION_LESS 4.8.0) + # HACK to detect CGAL version 4.8.0 + # CGAL version 4.8, 4.8.1 and 4.8.2 are identified as version 4.8.1000) + # cf. https://github.com/CGAL/cgal/issues/1559 + # Limit the HACK between CGAL versions 4.8 and 4.9 because of file read + if (NOT CGAL_VERSION VERSION_GREATER 4.9.0) + foreach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) + if (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") + FILE(READ "${CGAL_INCLUDE_DIR}/CGAL/version.h" contents) + STRING(REGEX REPLACE "\n" ";" contents "${contents}") + foreach(Line ${contents}) + if("${Line}" STREQUAL "#define CGAL_VERSION 4.8") + set(CGAL_VERSION 4.8.0) + message (">>>>> HACK CGAL version to ${CGAL_VERSION}") + endif("${Line}" STREQUAL "#define CGAL_VERSION 4.8") + endforeach(Line ${contents}) + endif (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") + endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) + endif(NOT CGAL_VERSION VERSION_GREATER 4.9.0) + + # For dev version + include_directories(BEFORE "src/common/include/gudhi_patches") + # For user version + include_directories(BEFORE "include/gudhi_patches") + endif() +endif() + +# Find TBB package for parallel sort - not mandatory, just optional. +set(TBB_FIND_QUIETLY ON) +find_package(TBB) +if (TBB_FOUND) + include(${TBB_USE_FILE}) + message("TBB found in ${TBB_LIBRARY_DIRS}") + add_definitions(-DGUDHI_USE_TBB) +endif() + +set(CGAL_WITH_EIGEN3_VERSION 0.0.0) +find_package(Eigen3 3.1.0) +if (EIGEN3_FOUND) + message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") + include( ${EIGEN3_USE_FILE} ) + set(CGAL_WITH_EIGEN3_VERSION ${CGAL_VERSION}) +endif (EIGEN3_FOUND) + +# Required programs for unitary tests purpose +FIND_PROGRAM( GCOVR_PATH gcovr ) +if (GCOVR_PATH) + message("gcovr found in ${GCOVR_PATH}") +endif() +# Required programs for unitary tests purpose +FIND_PROGRAM( GPROF_PATH gprof ) +if (GPROF_PATH) + message("gprof found in ${GPROF_PATH}") +endif() +FIND_PROGRAM( DIFF_PATH diff ) +if (DIFF_PATH) + message("diff found in ${DIFF_PATH}") +endif() + +# BOOST ISSUE result_of vs C++11 +add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) +# BOOST ISSUE with Libraries name resolution under Windows +add_definitions(-DBOOST_ALL_NO_LIB) +# problem with Visual Studio link on Boost program_options +add_definitions( -DBOOST_ALL_DYN_LINK ) + +INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + +message(STATUS "boost include dirs:" ${Boost_INCLUDE_DIRS}) +message(STATUS "boost library dirs:" ${Boost_LIBRARY_DIRS}) + +macro( find_the_lib placeholder THE_LIBS ) + set (THE_LIB_WE_FOUND "NO") + foreach(THE_LIB ${THE_LIBS}) + if(EXISTS ${THE_LIB}) + get_filename_component(THE_LIB_WE ${THE_LIB} NAME_WE) + if (NOT THE_LIB_WE_FOUND) + set (THE_LIB_WE_FOUND "YES") + set(returnValue "${THE_LIB_WE}") + endif(NOT THE_LIB_WE_FOUND) + endif(EXISTS ${THE_LIB}) + endforeach(THE_LIB ${THE_LIBS}) +endmacro( find_the_lib ) + +# Find the correct Python interpreter. +# Can be set with -DPYTHON_EXECUTABLE=/usr/bin/python3 or -DPython_ADDITIONAL_VERSIONS=3 for instance. +find_package(Cython) + +if(NOT GUDHI_CYTHON_PATH) + message(FATAL_ERROR "ERROR: GUDHI_CYTHON_PATH is not valid.") +endif(NOT GUDHI_CYTHON_PATH) + +if(PYTHONINTERP_FOUND AND CYTHON_FOUND) + # Unitary tests are available through py.test + find_program( PYTEST_PATH py.test ) + # Default found version 2 + if(PYTHON_VERSION_MAJOR EQUAL 2) + # Documentation generation is available through sphinx + find_program( SPHINX_PATH sphinx-build ) + elseif(PYTHON_VERSION_MAJOR EQUAL 3) + # Documentation generation is available through sphinx + set(SPHINX_PATH "${CMAKE_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build") + else() + message(FATAL_ERROR "ERROR: Try to compile the Cython interface. Python version ${PYTHON_VERSION_STRING} is not valid.") + endif(PYTHON_VERSION_MAJOR EQUAL 2) +endif(PYTHONINTERP_FOUND AND CYTHON_FOUND) + diff --git a/src/cmake/modules/GUDHI_third_party_libraries.txt b/src/cmake/modules/GUDHI_third_party_libraries.txt deleted file mode 100644 index 5f84c602..00000000 --- a/src/cmake/modules/GUDHI_third_party_libraries.txt +++ /dev/null @@ -1,144 +0,0 @@ -# This files manage third party libraries required by GUDHI - -find_package(Boost REQUIRED COMPONENTS system filesystem unit_test_framework chrono timer date_time program_options thread) - -if(NOT Boost_FOUND) - message(FATAL_ERROR "NOTICE: This program requires Boost and will not be compiled.") -endif(NOT Boost_FOUND) - -find_package(GMP) -if(GMP_FOUND) - message(STATUS "GMP_LIBRARIES = ${GMP_LIBRARIES}") - INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR}) - find_package(GMPXX) - if(GMPXX_FOUND) - message(STATUS "GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") - INCLUDE_DIRECTORIES(${GMPXX_INCLUDE_DIR}) - endif() -endif() - -# In CMakeLists.txt, when include(${CGAL_USE_FILE}), CMAKE_CXX_FLAGS are overwritten. -# cf. http://doc.cgal.org/latest/Manual/installation.html#title40 -# A workaround is to include(${CGAL_USE_FILE}) before adding "-std=c++11". -# A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html -# or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html -# but it implies to use cmake version 3.1 at least. -find_package(CGAL) - -# Only CGAL versions > 4.4 supports what Gudhi uses from CGAL -if (CGAL_VERSION VERSION_LESS 4.4.0) - message("CGAL version ${CGAL_VERSION} is considered too old to be used by Gudhi.") - unset(CGAL_FOUND) -endif() -if(CGAL_FOUND) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - include( ${CGAL_USE_FILE} ) - - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - # HACK to detect CGAL version 4.8.0 - # CGAL version 4.8, 4.8.1 and 4.8.2 are identified as version 4.8.1000) - # cf. https://github.com/CGAL/cgal/issues/1559 - # Limit the HACK between CGAL versions 4.8 and 4.9 because of file read - if (NOT CGAL_VERSION VERSION_GREATER 4.9.0) - foreach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) - if (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") - FILE(READ "${CGAL_INCLUDE_DIR}/CGAL/version.h" contents) - STRING(REGEX REPLACE "\n" ";" contents "${contents}") - foreach(Line ${contents}) - if("${Line}" STREQUAL "#define CGAL_VERSION 4.8") - set(CGAL_VERSION 4.8.0) - message (">>>>> HACK CGAL version to ${CGAL_VERSION}") - endif("${Line}" STREQUAL "#define CGAL_VERSION 4.8") - endforeach(Line ${contents}) - endif (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") - endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) - endif(NOT CGAL_VERSION VERSION_GREATER 4.9.0) - - # For dev version - include_directories(BEFORE "src/common/include/gudhi_patches") - # For user version - include_directories(BEFORE "include/gudhi_patches") - endif() -endif() - -# Find TBB package for parallel sort - not mandatory, just optional. -set(TBB_FIND_QUIETLY ON) -find_package(TBB) -if (TBB_FOUND) - include(${TBB_USE_FILE}) - message("TBB found in ${TBB_LIBRARY_DIRS}") - add_definitions(-DGUDHI_USE_TBB) -endif() - -set(CGAL_WITH_EIGEN3_VERSION 0.0.0) -find_package(Eigen3 3.1.0) -if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - set(CGAL_WITH_EIGEN3_VERSION ${CGAL_VERSION}) -endif (EIGEN3_FOUND) - -# Required programs for unitary tests purpose -FIND_PROGRAM( GCOVR_PATH gcovr ) -if (GCOVR_PATH) - message("gcovr found in ${GCOVR_PATH}") -endif() -# Required programs for unitary tests purpose -FIND_PROGRAM( GPROF_PATH gprof ) -if (GPROF_PATH) - message("gprof found in ${GPROF_PATH}") -endif() -FIND_PROGRAM( DIFF_PATH diff ) -if (DIFF_PATH) - message("diff found in ${DIFF_PATH}") -endif() - -# BOOST ISSUE result_of vs C++11 -add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) -# BOOST ISSUE with Libraries name resolution under Windows -add_definitions(-DBOOST_ALL_NO_LIB) -# problem with Visual Studio link on Boost program_options -add_definitions( -DBOOST_ALL_DYN_LINK ) - -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) - -message(STATUS "boost include dirs:" ${Boost_INCLUDE_DIRS}) -message(STATUS "boost library dirs:" ${Boost_LIBRARY_DIRS}) - -macro( find_the_lib placeholder THE_LIBS ) - set (THE_LIB_WE_FOUND "NO") - foreach(THE_LIB ${THE_LIBS}) - if(EXISTS ${THE_LIB}) - get_filename_component(THE_LIB_WE ${THE_LIB} NAME_WE) - if (NOT THE_LIB_WE_FOUND) - set (THE_LIB_WE_FOUND "YES") - set(returnValue "${THE_LIB_WE}") - endif(NOT THE_LIB_WE_FOUND) - endif(EXISTS ${THE_LIB}) - endforeach(THE_LIB ${THE_LIBS}) -endmacro( find_the_lib ) - -# Find the correct Python interpreter. -# Can be set with -DPYTHON_EXECUTABLE=/usr/bin/python3 or -DPython_ADDITIONAL_VERSIONS=3 for instance. -find_package(Cython) - -if(NOT GUDHI_CYTHON_PATH) - message(FATAL_ERROR "ERROR: GUDHI_CYTHON_PATH is not valid.") -endif(NOT GUDHI_CYTHON_PATH) - -if(PYTHONINTERP_FOUND AND CYTHON_FOUND) - # Unitary tests are available through py.test - find_program( PYTEST_PATH py.test ) - # Default found version 2 - if(PYTHON_VERSION_MAJOR EQUAL 2) - # Documentation generation is available through sphinx - find_program( SPHINX_PATH sphinx-build ) - elseif(PYTHON_VERSION_MAJOR EQUAL 3) - # Documentation generation is available through sphinx - set(SPHINX_PATH "${CMAKE_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build") - else() - message(FATAL_ERROR "ERROR: Try to compile the Cython interface. Python version ${PYTHON_VERSION_STRING} is not valid.") - endif(PYTHON_VERSION_MAJOR EQUAL 2) -endif(PYTHONINTERP_FOUND AND CYTHON_FOUND) - -- cgit v1.2.3 From 2ce2ed92a4400ecaaa6aac813e206d08b0b1f029 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 19 Apr 2017 08:49:23 +0000 Subject: Rename tests and examples to be consistent with the naming rules xml test results is now generated out of source git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/add_test_windows@2364 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ae2dd1592b63f4e7da5e17655761697b6daf7dd0 --- src/Alpha_complex/doc/Intro_alpha_complex.h | 4 +- src/Alpha_complex/example/CMakeLists.txt | 1 - src/Alpha_complex/test/CMakeLists.txt | 12 ++--- src/Alpha_complex/test/README | 2 +- src/Bitmap_cubical_complex/example/CMakeLists.txt | 33 +++++------- src/Bitmap_cubical_complex/test/CMakeLists.txt | 22 ++------ src/Bottleneck_distance/example/CMakeLists.txt | 10 ++-- src/Bottleneck_distance/test/CMakeLists.txt | 24 +++------ src/Bottleneck_distance/test/README | 2 +- src/Contraction/example/CMakeLists.txt | 9 ++-- src/Persistent_cohomology/example/CMakeLists.txt | 56 ++++++++++---------- src/Persistent_cohomology/test/CMakeLists.txt | 54 ++++++++----------- src/Persistent_cohomology/test/README | 10 +++- .../test/persistent_cohomology_unit_test.cpp | 6 +-- ...persistent_cohomology_unit_test_multi_field.cpp | 6 +-- src/Rips_complex/doc/Intro_rips_complex.h | 8 +-- src/Rips_complex/example/CMakeLists.txt | 61 +++++++++++++--------- src/Rips_complex/test/CMakeLists.txt | 19 ++----- src/Simplex_tree/example/CMakeLists.txt | 33 ++++++------ src/Simplex_tree/example/README | 8 +-- src/Simplex_tree/test/CMakeLists.txt | 22 ++------ src/Skeleton_blocker/example/CMakeLists.txt | 14 ++--- src/Skeleton_blocker/test/CMakeLists.txt | 37 ++++--------- src/Spatial_searching/example/CMakeLists.txt | 16 +++--- src/Spatial_searching/test/CMakeLists.txt | 15 ++---- src/Subsampling/example/CMakeLists.txt | 12 ++--- src/Subsampling/test/CMakeLists.txt | 25 ++------- src/Tangential_complex/example/CMakeLists.txt | 9 ++-- src/Tangential_complex/test/CMakeLists.txt | 15 ++---- src/Witness_complex/example/CMakeLists.txt | 30 ++++++----- src/Witness_complex/test/CMakeLists.txt | 21 ++------ src/cmake/modules/GUDHI_test_coverage.cmake | 1 - src/common/example/CMakeLists.txt | 9 ++-- src/common/test/CMakeLists.txt | 29 +++------- 34 files changed, 253 insertions(+), 382 deletions(-) diff --git a/src/Alpha_complex/doc/Intro_alpha_complex.h b/src/Alpha_complex/doc/Intro_alpha_complex.h index 3ffdae7f..69959fc5 100644 --- a/src/Alpha_complex/doc/Intro_alpha_complex.h +++ b/src/Alpha_complex/doc/Intro_alpha_complex.h @@ -71,7 +71,7 @@ namespace alpha_complex { * * When launching: * - * \code $> ./alphapoints + * \code $> ./Alpha_complex_example_from_points * \endcode * * the program output is: @@ -155,7 +155,7 @@ namespace alpha_complex { * * When launching: * - * \code $> ./alphaoffreader ../../data/points/alphacomplexdoc.off 32.0 + * \code $> ./Alpha_complex_example_from_off ../../data/points/alphacomplexdoc.off 32.0 * \endcode * * the program output is: diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index ab09fe91..a4853d78 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -15,7 +15,6 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) add_test(NAME Alpha_complex_example_from_points COMMAND $) - # Do not forget to copy test files in current binary dir add_test(NAME Alpha_complex_example_from_off_60 COMMAND $ "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "60.0" "${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt") add_test(NAME Alpha_complex_example_from_off_32 COMMAND $ diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt index 59f86c5b..d7f49b53 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -1,19 +1,19 @@ cmake_minimum_required(VERSION 2.6) project(Alpha_complex_tests) -include(GUDHI_test_coverage) - if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) - add_executable ( Alpha_complex_unit_test Alpha_complex_unit_test.cpp ) - target_link_libraries(Alpha_complex_unit_test ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + include(GUDHI_test_coverage) + + add_executable ( Alpha_complex_test_unit Alpha_complex_unit_test.cpp ) + target_link_libraries(Alpha_complex_test_unit ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(Alpha_complex_unit_test ${TBB_LIBRARIES}) + target_link_libraries(Alpha_complex_test_unit ${TBB_LIBRARIES}) 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(Alpha_complex_unit_test) + gudhi_add_coverage_test(Alpha_complex_test_unit) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) diff --git a/src/Alpha_complex/test/README b/src/Alpha_complex/test/README index 45b87d91..0e5b9eb1 100644 --- a/src/Alpha_complex/test/README +++ b/src/Alpha_complex/test/README @@ -7,6 +7,6 @@ make To launch with details: *********************** -./AlphaComplexUnitTest --report_level=detailed --log_level=all +./Alpha_complex_unit_test --report_level=detailed --log_level=all ==> echo $? returns 0 in case of success (non-zero otherwise) diff --git a/src/Bitmap_cubical_complex/example/CMakeLists.txt b/src/Bitmap_cubical_complex/example/CMakeLists.txt index 97a45190..241a11e5 100644 --- a/src/Bitmap_cubical_complex/example/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/example/CMakeLists.txt @@ -7,24 +7,19 @@ if (TBB_FOUND) target_link_libraries(Bitmap_cubical_complex ${TBB_LIBRARIES}) endif() -# Do not forget to copy test files in current binary dir -file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/CubicalOneSphere.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/CubicalTwoSphere.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) +add_test(NAME Bitmap_cubical_complex_example_persistence_one_sphere COMMAND $ + "${CMAKE_SOURCE_DIR}/data/bitmap/CubicalOneSphere.txt") -add_test(Bitmap_cubical_complex_one_sphere - ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex - ${CMAKE_CURRENT_BINARY_DIR}/CubicalOneSphere.txt) - -add_test(Bitmap_cubical_complex_two_sphere - ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex - ${CMAKE_CURRENT_BINARY_DIR}/CubicalTwoSphere.txt) +add_test(NAME Bitmap_cubical_complex_example_persistence_two_sphere COMMAND $ + "${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}) if (TBB_FOUND) target_link_libraries(Random_bitmap_cubical_complex ${TBB_LIBRARIES}) endif() -add_test(Random_bitmap_cubical_complex ${CMAKE_CURRENT_BINARY_DIR}/Random_bitmap_cubical_complex 2 100 100) +add_test(NAME Bitmap_cubical_complex_example_random COMMAND $ + "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}) @@ -32,14 +27,10 @@ if (TBB_FOUND) target_link_libraries(Bitmap_cubical_complex_periodic_boundary_conditions ${TBB_LIBRARIES}) endif() -# Do not forget to copy test files in current binary dir -file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/2d_torus.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -file(COPY "${CMAKE_SOURCE_DIR}/data/bitmap/3d_torus.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - -add_test(Bitmap_cubical_complex_periodic_2d_torus - ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex_periodic_boundary_conditions - ${CMAKE_CURRENT_BINARY_DIR}/2d_torus.txt) -add_test(Bitmap_cubical_complex_periodic_3d_torus - ${CMAKE_CURRENT_BINARY_DIR}/Bitmap_cubical_complex_periodic_boundary_conditions - ${CMAKE_CURRENT_BINARY_DIR}/3d_torus.txt) +add_test(NAME Bitmap_cubical_complex_example_periodic_boundary_conditions_2d_torus + COMMAND $ + "${CMAKE_SOURCE_DIR}/data/bitmap/2d_torus.txt") +add_test(NAME Bitmap_cubical_complex_example_periodic_boundary_conditions_3d_torus + COMMAND $ + "${CMAKE_SOURCE_DIR}/data/bitmap/3d_torus.txt") diff --git a/src/Bitmap_cubical_complex/test/CMakeLists.txt b/src/Bitmap_cubical_complex/test/CMakeLists.txt index daf0e14f..b2895f85 100644 --- a/src/Bitmap_cubical_complex/test/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/test/CMakeLists.txt @@ -1,24 +1,12 @@ cmake_minimum_required(VERSION 2.6) project(Bitmap_cubical_complex_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) -add_executable ( BitmapCCUT Bitmap_test.cpp ) -target_link_libraries(BitmapCCUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( Bitmap_cubical_complex_test_unit Bitmap_test.cpp ) +target_link_libraries(Bitmap_cubical_complex_test_unit ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(BitmapCCUT ${TBB_LIBRARIES}) + target_link_libraries(Bitmap_cubical_complex_test_unit ${TBB_LIBRARIES}) endif() -# Unitary tests -add_test(NAME BitmapCCUT - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/BitmapCCUT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/BitmapCCUT.xml --log_level=test_suite --report_level=no) - +gudhi_add_coverage_test(Bitmap_cubical_complex_test_unit) diff --git a/src/Bottleneck_distance/example/CMakeLists.txt b/src/Bottleneck_distance/example/CMakeLists.txt index b0a19f8b..0d0bff45 100644 --- a/src/Bottleneck_distance/example/CMakeLists.txt +++ b/src/Bottleneck_distance/example/CMakeLists.txt @@ -5,8 +5,6 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) add_executable (bottleneck_read_file_example bottleneck_read_file_example.cpp) add_executable (bottleneck_basic_example bottleneck_basic_example.cpp) - add_test(bottleneck_basic_example ${CMAKE_CURRENT_BINARY_DIR}/bottleneck_basic_example) - 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) @@ -14,7 +12,11 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) 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 - ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -r 0.15 -m 0.12 -d 3 -p 3) + + add_test(NAME Bottleneck_distance_example_basic COMMAND $) + + add_test(NAME Bottleneck_distance_example_alpha_rips_persistence_bottleneck + COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.15" "-m" "0.12" "-d" "3" "-p" "3") endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Bottleneck_distance/test/CMakeLists.txt b/src/Bottleneck_distance/test/CMakeLists.txt index 3d8e1f95..e1bbbbec 100644 --- a/src/Bottleneck_distance/test/CMakeLists.txt +++ b/src/Bottleneck_distance/test/CMakeLists.txt @@ -1,25 +1,15 @@ cmake_minimum_required(VERSION 2.6) project(Bottleneck_distance_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() - if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) - add_executable ( bottleneckUT bottleneck_unit_test.cpp ) - target_link_libraries(bottleneckUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + include(GUDHI_test_coverage) + + add_executable ( Bottleneck_distance_test_unit bottleneck_unit_test.cpp ) + target_link_libraries(Bottleneck_distance_test_unit ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(bottleneckUT ${TBB_LIBRARIES}) + target_link_libraries(Bottleneck_distance_test_unit ${TBB_LIBRARIES}) endif(TBB_FOUND) - # Unitary tests - add_test(NAME bottleneckUT COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bottleneckUT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/bottleneckUT.xml --log_level=test_suite --report_level=no) + gudhi_add_coverage_test(Bottleneck_distance_test_unit) + endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Bottleneck_distance/test/README b/src/Bottleneck_distance/test/README index 0e7b8673..00bd9a91 100644 --- a/src/Bottleneck_distance/test/README +++ b/src/Bottleneck_distance/test/README @@ -7,6 +7,6 @@ make To launch with details: *********************** -./BottleneckUnitTest --report_level=detailed --log_level=all +./Bottleneck_distance_unit_test --report_level=detailed --log_level=all ==> echo $? returns 0 in case of success (non-zero otherwise) diff --git a/src/Contraction/example/CMakeLists.txt b/src/Contraction/example/CMakeLists.txt index 4c09a0a7..51a6832d 100644 --- a/src/Contraction/example/CMakeLists.txt +++ b/src/Contraction/example/CMakeLists.txt @@ -9,7 +9,10 @@ target_link_libraries(RipsContraction ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBR target_link_libraries(GarlandHeckbert ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBRARY}) -add_test(RipsContraction.tore3D.0.2 ${CMAKE_CURRENT_BINARY_DIR}/RipsContraction ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 0.2) +add_test(NAME Contraction_example_tore3D_0.2 COMMAND $ + "${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) +#add_test(NAME Contraction_example_sphere_0.2 COMMAND $ +# "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2") +#add_test(NAME Contraction_example_SO3_0.3 COMMAND $ +# "${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 a6b698c3..3c45e79b 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -32,20 +32,21 @@ if (TBB_FOUND) target_link_libraries(persistence_from_file ${TBB_LIBRARIES}) endif() -add_test(plain_homology ${CMAKE_CURRENT_BINARY_DIR}/plain_homology) -add_test(persistence_from_simple_simplex_tree ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_simple_simplex_tree 1 0) -add_test(rips_distance_matrix ${CMAKE_CURRENT_BINARY_DIR}/rips_distance_matrix_persistence - ${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv -r 1.0 -d 3 -p 3 -m 0) -add_test(rips_persistence_3 ${CMAKE_CURRENT_BINARY_DIR}/rips_persistence - ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 3) -add_test(rips_persistence_step_by_step_3 ${CMAKE_CURRENT_BINARY_DIR}/rips_persistence_step_by_step - ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 3) -add_test(rips_persistence_via_boundary_matrix_3 ${CMAKE_CURRENT_BINARY_DIR}/rips_persistence_via_boundary_matrix - ${CMAKE_SOURCE_DIR}/data/points/Kl.off -r 0.16 -d 3 -p 3 -m 100) -add_test(persistence_from_file_3_2_0 ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_file - ${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/bunny_5000_complex.fsc -p 2 -m 0) -add_test(persistence_from_file_3_3_100 ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_file - ${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/bunny_5000_complex.fsc -p 3 -m 100) +add_test(NAME Persistent_cohomology_example_plain_homology COMMAND $) +add_test(NAME Persistent_cohomology_example_from_simple_simplex_tree COMMAND $ + "1" "0") +add_test(NAME Persistent_cohomology_example_from_rips_distance_matrix COMMAND $ + "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "-r" "1.0" "-d" "3" "-p" "3" "-m" "0") +add_test(NAME Persistent_cohomology_example_from_rips_on_tore_3D COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3") +add_test(NAME Persistent_cohomology_example_from_rips_step_by_step_on_tore_3D COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3") +add_test(NAME Persistent_cohomology_example_via_boundary_matrix COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/Kl.off" "-r" "0.16" "-d" "3" "-p" "3" "-m" "100") +add_test(NAME Persistent_cohomology_example_from_file_3_2_0 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/bunny_5000_complex.fsc" "-p" "2" "-m" "0") +add_test(NAME Persistent_cohomology_example_from_file_3_3_100 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/bunny_5000_complex.fsc" "-p" "3" "-m" "100") if(GMP_FOUND) if(GMPXX_FOUND) @@ -55,8 +56,8 @@ if(GMP_FOUND) if (TBB_FOUND) target_link_libraries(rips_multifield_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/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 2 -q 71) + add_test(NAME Persistent_cohomology_example_multifield_2_71 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "2" "-q" "71") endif(GMPXX_FOUND) endif(GMP_FOUND) @@ -73,13 +74,12 @@ if(CGAL_FOUND) target_link_libraries(exact_alpha_complex_3d_persistence ${TBB_LIBRARIES}) target_link_libraries(weighted_alpha_complex_3d_persistence ${TBB_LIBRARIES}) 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) - add_test(exact_alpha_complex_3d_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/exact_alpha_complex_3d_persistence - ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off 2 0.45) - add_test(weighted_alpha_complex_3d_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/weighted_alpha_complex_3d_persistence - ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.weights 2 0.45) - + add_test(NAME Persistent_cohomology_example_alpha_complex_3d COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "2" "0.45") + add_test(NAME Persistent_cohomology_example_exact_alpha_complex_3d COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "2" "0.45") + add_test(NAME Persistent_cohomology_example_weighted_alpha_complex_3d COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.weights" "2" "0.45") if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) @@ -97,10 +97,10 @@ if(CGAL_FOUND) target_link_libraries(periodic_alpha_complex_3d_persistence ${TBB_LIBRARIES}) target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES}) 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) + add_test(NAME Persistent_cohomology_example_alpha_complex COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-p" "2" "-m" "0.45") + add_test(NAME Persistent_cohomology_example_periodic_alpha_complex_3d COMMAND $ + "${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(NAME Persistent_cohomology_example_custom_persistence_sort COMMAND $) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) endif(CGAL_FOUND) diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt index a21f39c4..11e9a951 100644 --- a/src/Persistent_cohomology/test/CMakeLists.txt +++ b/src/Persistent_cohomology/test/CMakeLists.txt @@ -1,49 +1,37 @@ cmake_minimum_required(VERSION 2.6) 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(GCOVR_PATH) -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif(GPROF_PATH) - -add_executable ( PersistentCohomologyUT persistent_cohomology_unit_test.cpp ) -target_link_libraries(PersistentCohomologyUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) -add_executable ( BettiNumbersUT betti_numbers_unit_test.cpp ) -target_link_libraries(BettiNumbersUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +include(GUDHI_test_coverage) + +add_executable ( Persistent_cohomology_test_unit persistent_cohomology_unit_test.cpp ) +target_link_libraries(Persistent_cohomology_test_unit ${Boost_SYSTEM_LIBRARY} ${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_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(PersistentCohomologyUT ${TBB_LIBRARIES}) - target_link_libraries(BettiNumbersUT ${TBB_LIBRARIES}) + target_link_libraries(Persistent_cohomology_test_unit ${TBB_LIBRARIES}) + target_link_libraries(Persistent_cohomology_test_betti_numbers ${TBB_LIBRARIES}) endif(TBB_FOUND) -# Unitary tests -add_test(NAME PersistentCohomologyUT - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/PersistentCohomologyUT - ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_unit_test.txt - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/PersistentCohomologyUT.xml --log_level=test_suite --report_level=no) +# Do not forget to copy test results files in current binary dir +file(COPY "${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_unit_test.txt" + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -add_test(NAME BettiNumbersUT - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/BettiNumbersUT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/BettiNumbersUT.xml --log_level=test_suite --report_level=no) +# Unitary tests +gudhi_add_coverage_test(Persistent_cohomology_test_unit) +gudhi_add_coverage_test(Persistent_cohomology_test_betti_numbers) 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}) + 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_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) if (TBB_FOUND) - target_link_libraries(PersistentCohomologyMultiFieldUT ${TBB_LIBRARIES}) + target_link_libraries(Persistent_cohomology_test_unit_multi_field ${TBB_LIBRARIES}) endif(TBB_FOUND) + # Do not forget to copy test results files in current binary dir + 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 - add_test(NAME PersistentCohomologyMultiFieldUT - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/PersistentCohomologyMultiFieldUT - ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/PersistentCohomologyMultiFieldUT.xml --log_level=test_suite --report_level=no) + gudhi_add_coverage_test(Persistent_cohomology_test_unit_multi_field) endif(GMPXX_FOUND AND GMP_FOUND) diff --git a/src/Persistent_cohomology/test/README b/src/Persistent_cohomology/test/README index 6c64b5fe..0c41feed 100644 --- a/src/Persistent_cohomology/test/README +++ b/src/Persistent_cohomology/test/README @@ -11,13 +11,19 @@ To launch with details: SINGLE FIELD ------------ -./PersistentCohomologyUT simplex_tree_file_for_unit_test.txt --report_level=detailed --log_level=all +./Persistent_cohomology_test_unit --report_level=detailed --log_level=all ==> echo $? returns 0 in case of success (non-zero otherwise) MULTI FIELD ----------- -./PersistentCohomologyMultiFieldUT simplex_tree_file_for_multi_field_unit_test.txt --report_level=detailed --log_level=all +./Persistent_cohomology_test_unit_multi_field --report_level=detailed --log_level=all + + ==> echo $? returns 0 in case of success (non-zero otherwise) + +BETTI NUMBERS +------------- +./Persistent_cohomology_test_betti_numbers --report_level=detailed --log_level=all ==> echo $? returns 0 in case of success (non-zero otherwise) diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp index e2e0bc71..f8174020 100644 --- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp +++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp @@ -22,11 +22,9 @@ using namespace boost::unit_test; typedef Simplex_tree<> typeST; std::string test_rips_persistence(int coefficient, int min_persistence) { - // file name is given as parameter from CMakeLists.txt - const std::string inputFile(framework::master_test_suite().argv[1]); - + // file is copied in CMakeLists.txt std::ifstream simplex_tree_stream; - simplex_tree_stream.open(inputFile.c_str()); + simplex_tree_stream.open("simplex_tree_file_for_unit_test.txt"); typeST st; simplex_tree_stream >> st; simplex_tree_stream.close(); diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp index 6a7ecbec..3537cfa4 100644 --- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp +++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp @@ -22,11 +22,9 @@ using namespace boost::unit_test; typedef Simplex_tree<> typeST; std::string test_rips_persistence(int min_coefficient, int max_coefficient, double min_persistence) { - // file name is given as parameter from CMakeLists.txt - const std::string inputFile(framework::master_test_suite().argv[1]); - + // file is copied in CMakeLists.txt std::ifstream simplex_tree_stream; - simplex_tree_stream.open(inputFile.c_str()); + simplex_tree_stream.open("simplex_tree_file_for_multi_field_unit_test.txt"); typeST st; simplex_tree_stream >> st; simplex_tree_stream.close(); diff --git a/src/Rips_complex/doc/Intro_rips_complex.h b/src/Rips_complex/doc/Intro_rips_complex.h index 8e374c09..124dfec9 100644 --- a/src/Rips_complex/doc/Intro_rips_complex.h +++ b/src/Rips_complex/doc/Intro_rips_complex.h @@ -77,7 +77,7 @@ namespace rips_complex { * When launching (Rips maximal distance between 2 points is 12.0, is expanded until dimension 1 - one skeleton graph * in other words): * - * \code $> ./oneskeletonripspoints + * \code $> ./Rips_complex_example_one_skeleton_from_points * \endcode * * the program output is: @@ -97,7 +97,7 @@ namespace rips_complex { * * When launching: * - * \code $> ./ripsoffreader ../../data/points/alphacomplexdoc.off 12.0 3 + * \code $> ./Rips_complex_example_from_off ../../data/points/alphacomplexdoc.off 12.0 3 * \endcode * * the program output is: @@ -120,7 +120,7 @@ namespace rips_complex { * When launching (Rips maximal distance between 2 points is 1.0, is expanded until dimension 1 - one skeleton graph * with other words): * - * \code $> ./oneskeletonripsdistance + * \code $> ./Rips_complex_example_one_skeleton_from_distance_matrix * \endcode * * the program output is: @@ -139,7 +139,7 @@ namespace rips_complex { * * When launching: * - * \code $> ./ripscsvdistancereader ../../data/distance_matrix/full_square_distance_matrix.csv 1.0 3 + * \code $> ./Rips_complex_example_from_csv_distance_matrix ../../data/distance_matrix/full_square_distance_matrix.csv 1.0 3 * \endcode * * the program output is: diff --git a/src/Rips_complex/example/CMakeLists.txt b/src/Rips_complex/example/CMakeLists.txt index 070ac710..8aee79e2 100644 --- a/src/Rips_complex/example/CMakeLists.txt +++ b/src/Rips_complex/example/CMakeLists.txt @@ -2,37 +2,40 @@ cmake_minimum_required(VERSION 2.6) project(Rips_complex_examples) # Point cloud -add_executable ( ripsoffreader example_rips_complex_from_off_file.cpp ) -target_link_libraries(ripsoffreader ${Boost_SYSTEM_LIBRARY}) +add_executable ( Rips_complex_example_from_off example_rips_complex_from_off_file.cpp ) +target_link_libraries(Rips_complex_example_from_off ${Boost_SYSTEM_LIBRARY}) -add_executable ( oneskeletonripspoints example_one_skeleton_rips_from_points.cpp ) -target_link_libraries(oneskeletonripspoints ${Boost_SYSTEM_LIBRARY}) +add_executable ( Rips_complex_example_one_skeleton_from_points example_one_skeleton_rips_from_points.cpp ) +target_link_libraries(Rips_complex_example_one_skeleton_from_points ${Boost_SYSTEM_LIBRARY}) # Distance matrix -add_executable ( oneskeletonripsdistance example_one_skeleton_rips_from_distance_matrix.cpp ) -target_link_libraries(oneskeletonripsdistance ${Boost_SYSTEM_LIBRARY}) +add_executable ( Rips_complex_example_one_skeleton_from_distance_matrix example_one_skeleton_rips_from_distance_matrix.cpp ) +target_link_libraries(Rips_complex_example_one_skeleton_from_distance_matrix ${Boost_SYSTEM_LIBRARY}) -add_executable ( ripscsvdistancereader example_rips_complex_from_csv_distance_matrix_file.cpp ) -target_link_libraries(ripscsvdistancereader ${Boost_SYSTEM_LIBRARY}) +add_executable ( Rips_complex_example_from_csv_distance_matrix example_rips_complex_from_csv_distance_matrix_file.cpp ) +target_link_libraries(Rips_complex_example_from_csv_distance_matrix ${Boost_SYSTEM_LIBRARY}) if (TBB_FOUND) - target_link_libraries(ripsoffreader ${TBB_LIBRARIES}) - target_link_libraries(oneskeletonripspoints ${TBB_LIBRARIES}) - target_link_libraries(oneskeletonripsdistance ${TBB_LIBRARIES}) - target_link_libraries(ripscsvdistancereader ${TBB_LIBRARIES}) + target_link_libraries(Rips_complex_example_from_off ${TBB_LIBRARIES}) + target_link_libraries(Rips_complex_example_one_skeleton_from_points ${TBB_LIBRARIES}) + target_link_libraries(Rips_complex_example_one_skeleton_from_distance_matrix ${TBB_LIBRARIES}) + target_link_libraries(Rips_complex_example_from_csv_distance_matrix ${TBB_LIBRARIES}) endif() -add_test(oneskeletonripspoints ${CMAKE_CURRENT_BINARY_DIR}/oneskeletonripspoints) -add_test(oneskeletonripsdistance ${CMAKE_CURRENT_BINARY_DIR}/oneskeletonripsdistance) +add_test(NAME Rips_complex_example_one_skeleton_from_points + COMMAND $) +add_test(NAME Rips_complex_example_one_skeleton_from_distance_matrix + COMMAND $) -# 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_test(ripsoffreader_doc_12_1 ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader alphacomplexdoc.off 12.0 1 ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_1.txt) -add_test(ripsoffreader_doc_12_3 ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader alphacomplexdoc.off 12.0 3 ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_3.txt) +add_test(NAME Rips_complex_example_from_off_doc_12_1 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "12.0" "1" "${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_1.txt") +add_test(NAME Rips_complex_example_from_off_doc_12_3 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "12.0" "3" "${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_3.txt") -file(COPY "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -add_test(ripscsvdistancereader_doc_12_1 ${CMAKE_CURRENT_BINARY_DIR}/ripscsvdistancereader full_square_distance_matrix.csv 12.0 1 ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_1.txt) -add_test(ripscsvdistancereader_doc_12_3 ${CMAKE_CURRENT_BINARY_DIR}/ripscsvdistancereader full_square_distance_matrix.csv 12.0 3 ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_3.txt) +add_test(NAME Rips_complex_example_from_csv_distance_matrix_doc_12_1 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "12.0" "1" "${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_1.txt") +add_test(NAME Rips_complex_example_from_csv_distance_matrix_doc_12_3 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "12.0" "3" "${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_3.txt") if (DIFF_PATH) @@ -40,8 +43,16 @@ if (DIFF_PATH) file(COPY "one_skeleton_rips_for_doc.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) file(COPY "full_skeleton_rips_for_doc.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - add_test(ripsoffreader_doc_12_1_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_1.txt ${CMAKE_CURRENT_BINARY_DIR}/one_skeleton_rips_for_doc.txt) - add_test(ripsoffreader_doc_12_3_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_3.txt ${CMAKE_CURRENT_BINARY_DIR}/full_skeleton_rips_for_doc.txt) - add_test(ripscsvreader_doc_12_1_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_1.txt ${CMAKE_CURRENT_BINARY_DIR}/one_skeleton_rips_for_doc.txt) - add_test(ripscsvreader_doc_12_3_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_3.txt ${CMAKE_CURRENT_BINARY_DIR}/full_skeleton_rips_for_doc.txt) + add_test(Rips_complex_example_from_off_doc_12_1_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_1.txt + ${CMAKE_CURRENT_BINARY_DIR}/one_skeleton_rips_for_doc.txt) + add_test(Rips_complex_example_from_off_doc_12_3_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_3.txt + ${CMAKE_CURRENT_BINARY_DIR}/full_skeleton_rips_for_doc.txt) + add_test(Rips_complex_example_from_csv_distance_matrix_doc_12_1_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_1.txt + ${CMAKE_CURRENT_BINARY_DIR}/one_skeleton_rips_for_doc.txt) + add_test(Rips_complex_example_from_csv_distance_matrix_doc_12_3_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/ripscsvreader_result_12_3.txt + ${CMAKE_CURRENT_BINARY_DIR}/full_skeleton_rips_for_doc.txt) endif() diff --git a/src/Rips_complex/test/CMakeLists.txt b/src/Rips_complex/test/CMakeLists.txt index 87bad2ed..57f780f1 100644 --- a/src/Rips_complex/test/CMakeLists.txt +++ b/src/Rips_complex/test/CMakeLists.txt @@ -1,25 +1,16 @@ cmake_minimum_required(VERSION 2.6) project(Rips_complex_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) -add_executable ( rips_complex_UT test_rips_complex.cpp ) -target_link_libraries(rips_complex_UT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( Rips_complex_test_unit test_rips_complex.cpp ) +target_link_libraries(Rips_complex_test_unit ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(rips_complex_UT ${TBB_LIBRARIES}) + target_link_libraries(Rips_complex_test_unit ${TBB_LIBRARIES}) 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}/) file(COPY "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -add_test(rips_complex_UT ${CMAKE_CURRENT_BINARY_DIR}/rips_complex_UT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/rips_complex_UT.xml --log_level=test_suite --report_level=no) +gudhi_add_coverage_test(Rips_complex_test_unit) diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt index e5285591..b1ea98d4 100644 --- a/src/Simplex_tree/example/CMakeLists.txt +++ b/src/Simplex_tree/example/CMakeLists.txt @@ -1,33 +1,32 @@ cmake_minimum_required(VERSION 2.6) project(Simplex_tree_examples) -add_executable ( simplex_tree_from_cliques_of_graph simplex_tree_from_cliques_of_graph.cpp ) +add_executable ( Simplex_tree_example_from_cliques_of_graph simplex_tree_from_cliques_of_graph.cpp ) if (TBB_FOUND) - target_link_libraries(simplex_tree_from_cliques_of_graph ${TBB_LIBRARIES}) + target_link_libraries(Simplex_tree_example_from_cliques_of_graph ${TBB_LIBRARIES}) endif() -add_test(simplex_tree_from_cliques_of_graph_2 ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_from_cliques_of_graph - ${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/Klein_bottle_complex.fsc 2) -add_test(simplex_tree_from_cliques_of_graph_3 ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_from_cliques_of_graph - ${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/Klein_bottle_complex.fsc 3) +add_test(NAME Simplex_tree_example_from_cliques_of_graph_2 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/Klein_bottle_complex.fsc" "2") +add_test(NAME Simplex_tree_example_from_cliques_of_graph_3 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/filtered_simplicial_complex/Klein_bottle_complex.fsc" "3") -add_executable ( simple_simplex_tree simple_simplex_tree.cpp ) +add_executable ( Simplex_tree_example_simple_simplex_tree simple_simplex_tree.cpp ) if (TBB_FOUND) - target_link_libraries(simple_simplex_tree ${TBB_LIBRARIES}) + target_link_libraries(Simplex_tree_example_simple_simplex_tree ${TBB_LIBRARIES}) endif() -add_test(simple_simplex_tree ${CMAKE_CURRENT_BINARY_DIR}/simple_simplex_tree) +add_test(NAME Simplex_tree_example_simple_simplex_tree COMMAND $) -add_executable ( mini_simplex_tree mini_simplex_tree.cpp ) -add_test(mini_simplex_tree ${CMAKE_CURRENT_BINARY_DIR}/mini_simplex_tree) +add_executable ( Simplex_tree_example_mini_simplex_tree mini_simplex_tree.cpp ) +add_test(NAME Simplex_tree_example_mini_simplex_tree COMMAND $) # An example with Simplex-tree using CGAL alpha_shapes_3 if(GMP_FOUND AND CGAL_FOUND) - add_executable ( alpha_shapes_3_simplex_tree_from_off_file example_alpha_shapes_3_simplex_tree_from_off_file.cpp ) - target_link_libraries(alpha_shapes_3_simplex_tree_from_off_file ${GMP_LIBRARIES} ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY}) + add_executable ( Simplex_tree_example_alpha_shapes_3_from_off example_alpha_shapes_3_simplex_tree_from_off_file.cpp ) + target_link_libraries(Simplex_tree_example_alpha_shapes_3_from_off ${GMP_LIBRARIES} ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY}) if (TBB_FOUND) - target_link_libraries(alpha_shapes_3_simplex_tree_from_off_file ${TBB_LIBRARIES}) + target_link_libraries(Simplex_tree_example_alpha_shapes_3_from_off ${TBB_LIBRARIES}) endif() - add_test(alpha_shapes_3_simplex_tree_from_off_file - ${CMAKE_CURRENT_BINARY_DIR}/alpha_shapes_3_simplex_tree_from_off_file - ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.off) + add_test(NAME Simplex_tree_example_alpha_shapes_3_from_off COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/bunny_5000.off") endif() diff --git a/src/Simplex_tree/example/README b/src/Simplex_tree/example/README index e37af790..a9498173 100644 --- a/src/Simplex_tree/example/README +++ b/src/Simplex_tree/example/README @@ -10,7 +10,7 @@ Example of use : *** Simple simplex tree construction -./simple_simplex_tree +./Simplex_tree_example_simple_simplex_tree ******************************************************************** EXAMPLE OF SIMPLE INSERTION @@ -52,7 +52,7 @@ EXAMPLE OF SIMPLE INSERTION *** Simplex tree construction with Z/2Z coefficients on weighted graph Klein bottle file: -./simplex_tree_from_cliques_of_graph ../../../data/points/Klein_bottle_complex.txt 2 +./Simplex_tree_example_from_cliques_of_graph ../../../data/points/Klein_bottle_complex.txt 2 Insert the 1-skeleton in the simplex tree in 0 s. Expand the simplex tree in 0 s. Information of the Simplex Tree: @@ -60,7 +60,7 @@ Information of the Simplex Tree: with Z/3Z coefficients: -./simplex_tree_from_cliques_of_graph ../../../data/points/Klein_bottle_complex.txt 3 +./Simplex_tree_example_from_cliques_of_graph ../../../data/points/Klein_bottle_complex.txt 3 Insert the 1-skeleton in the simplex tree in 0 s. Expand the simplex tree in 0 s. @@ -70,4 +70,4 @@ Information of the Simplex Tree: *** Simplex_tree computed and displayed from a 3D alpha complex: [ Requires CGAL, GMP and GMPXX to be installed] -./simplex_tree_from_alpha_shapes_3 ../../../data/points/bunny_5000 +./Simplex_tree_example_alpha_shapes_3_from_off ../../../data/points/bunny_5000 diff --git a/src/Simplex_tree/test/CMakeLists.txt b/src/Simplex_tree/test/CMakeLists.txt index e95d0782..17b0f2c2 100644 --- a/src/Simplex_tree/test/CMakeLists.txt +++ b/src/Simplex_tree/test/CMakeLists.txt @@ -1,27 +1,15 @@ cmake_minimum_required(VERSION 2.6) project(Simplex_tree_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) -add_executable ( SimplexTreeUT simplex_tree_unit_test.cpp ) -target_link_libraries(SimplexTreeUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( Simplex_tree_test_unit simplex_tree_unit_test.cpp ) +target_link_libraries(Simplex_tree_test_unit ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(SimplexTreeUT ${TBB_LIBRARIES}) + target_link_libraries(Simplex_tree_test_unit ${TBB_LIBRARIES}) endif() # Do not forget to copy test files in current binary dir file(COPY "simplex_tree_for_unit_test.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -# Unitary tests -add_test(NAME SimplexTreeUT - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/SimplexTreeUT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/SimplexTreeUT.xml --log_level=test_suite --report_level=no) - +gudhi_add_coverage_test(Simplex_tree_test_unit) diff --git a/src/Skeleton_blocker/example/CMakeLists.txt b/src/Skeleton_blocker/example/CMakeLists.txt index cc7f37f3..c887e408 100644 --- a/src/Skeleton_blocker/example/CMakeLists.txt +++ b/src/Skeleton_blocker/example/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 2.6) project(Skeleton_blocker_examples) -add_executable(SkeletonBlockerFromSimplices Skeleton_blocker_from_simplices.cpp) -add_executable(SkeletonBlockerIteration Skeleton_blocker_iteration.cpp) -add_executable(SkeletonBlockerLink Skeleton_blocker_link.cpp) +add_executable(Skeleton_blocker_example_from_simplices Skeleton_blocker_from_simplices.cpp) +add_executable(Skeleton_blocker_example_iteration Skeleton_blocker_iteration.cpp) +add_executable(Skeleton_blocker_example_link Skeleton_blocker_link.cpp) -target_link_libraries(SkeletonBlockerIteration ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +target_link_libraries(Skeleton_blocker_example_iteration ${Boost_TIMER_LIBRARY} ${Boost_SYSTEM_LIBRARY}) -add_test(SkeletonBlockerFromSimplices ${CMAKE_CURRENT_BINARY_DIR}/SkeletonBlockerFromSimplices) -add_test(SkeletonBlockerIteration ${CMAKE_CURRENT_BINARY_DIR}/SkeletonBlockerIteration) -add_test(SkeletonBlockerLink ${CMAKE_CURRENT_BINARY_DIR}/SkeletonBlockerLink) +add_test(NAME Skeleton_blocker_example_from_simplices COMMAND $) +add_test(NAME Skeleton_blocker_example_iteration COMMAND $) +add_test(NAME Skeleton_blocker_example_link COMMAND $) diff --git a/src/Skeleton_blocker/test/CMakeLists.txt b/src/Skeleton_blocker/test/CMakeLists.txt index f98517f0..0887fcff 100644 --- a/src/Skeleton_blocker/test/CMakeLists.txt +++ b/src/Skeleton_blocker/test/CMakeLists.txt @@ -1,35 +1,18 @@ cmake_minimum_required(VERSION 2.6) project(Skeleton_blocker_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) -add_executable ( test_skeleton_blocker_complex test_skeleton_blocker_complex.cpp ) -target_link_libraries(test_skeleton_blocker_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) -add_executable ( test_skeleton_blocker_geometric_complex test_skeleton_blocker_geometric_complex.cpp ) -target_link_libraries(test_skeleton_blocker_geometric_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) -add_executable ( test_skeleton_blocker_simplifiable test_skeleton_blocker_simplifiable.cpp ) -target_link_libraries(test_skeleton_blocker_simplifiable ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( Skeleton_blocker_test_unit test_skeleton_blocker_complex.cpp ) +target_link_libraries(Skeleton_blocker_test_unit ${Boost_SYSTEM_LIBRARY} ${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_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( Skeleton_blocker_test_simplifiable test_skeleton_blocker_simplifiable.cpp ) +target_link_libraries(Skeleton_blocker_test_simplifiable ${Boost_SYSTEM_LIBRARY} ${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}/) -# Unitary tests -add_test(NAME test_skeleton_blocker_complex - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_skeleton_blocker_complex - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/skbl_complexUT.xml --log_level=test_suite --report_level=no) -add_test(NAME test_skeleton_blocker_geometric_complex - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_skeleton_blocker_geometric_complex - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/skbl_geometric_complexUT.xml --log_level=test_suite --report_level=no) -add_test(NAME test_skeleton_blocker_simplifiable - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_skeleton_blocker_simplifiable - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/skbl_simplifiableUT.xml --log_level=test_suite --report_level=no) +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) diff --git a/src/Spatial_searching/example/CMakeLists.txt b/src/Spatial_searching/example/CMakeLists.txt index 6238a0ec..f4b9f3cb 100644 --- a/src/Spatial_searching/example/CMakeLists.txt +++ b/src/Spatial_searching/example/CMakeLists.txt @@ -1,13 +1,9 @@ cmake_minimum_required(VERSION 2.6) project(Spatial_searching_examples) -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - if (EIGEN3_FOUND) - add_executable( Spatial_searching_example_spatial_searching example_spatial_searching.cpp ) - target_link_libraries(Spatial_searching_example_spatial_searching ${CGAL_LIBRARY}) - add_test(Spatial_searching_example_spatial_searching - ${CMAKE_CURRENT_BINARY_DIR}/Spatial_searching_example_spatial_searching) - endif() - endif() -endif() +if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + add_executable( Spatial_searching_example_spatial_searching example_spatial_searching.cpp ) + target_link_libraries(Spatial_searching_example_spatial_searching ${CGAL_LIBRARY}) + add_test(NAME Spatial_searching_example_spatial_searching + COMMAND $) +endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt index bdc95e4a..2502ea5e 100644 --- a/src/Spatial_searching/test/CMakeLists.txt +++ b/src/Spatial_searching/test/CMakeLists.txt @@ -1,21 +1,12 @@ cmake_minimum_required(VERSION 2.6) project(Spatial_searching_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() - if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + include(GUDHI_test_coverage) + 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_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - add_test(Spatial_searching_test_Kd_tree_search ${CMAKE_CURRENT_BINARY_DIR}/Spatial_searching_test_Kd_tree_search - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Spatial_searching_UT.xml --log_level=test_suite --report_level=no) + gudhi_add_coverage_test(Spatial_searching_test_Kd_tree_search) endif () diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index bb043297..71b8d2e8 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -8,10 +8,10 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY}) - add_test(Subsampling_example_pick_n_random_points - ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_example_pick_n_random_points) - add_test(Subsampling_example_choose_n_farthest_points - ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_example_choose_n_farthest_points) - add_test(Subsampling_example_sparsify_point_set - ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_example_sparsify_point_set) + add_test(NAME Subsampling_example_pick_n_random_points + COMMAND $) + add_test(NAME Subsampling_example_choose_n_farthest_points + COMMAND $) + add_test(NAME Subsampling_example_sparsify_point_set + COMMAND $) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 5517fe9d..dbf97db3 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -1,16 +1,9 @@ cmake_minimum_required(VERSION 2.6) project(Subsampling_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() - if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + include(GUDHI_test_coverage) + 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}) @@ -20,15 +13,7 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) 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}) - add_test(Subsampling_test_pick_n_random_points ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_test_pick_n_random_points - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Subsampling_test_pick_n_random_points_UT.xml --log_level=test_suite --report_level=no) - - add_test(Subsampling_test_choose_n_farthest_points ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_test_choose_n_farthest_points - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Subsampling_test_choose_n_farthest_points_UT.xml --log_level=test_suite --report_level=no) - - add_test(Subsampling_test_sparsify_point_set ${CMAKE_CURRENT_BINARY_DIR}/Subsampling_test_sparsify_point_set - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Subsampling_test_sparsify_point_set_UT.xml --log_level=test_suite --report_level=no) + 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) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt index 47a56e3b..339d0581 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -11,9 +11,8 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) target_link_libraries(Tangential_complex_example_with_perturb ${TBB_LIBRARIES}) endif(TBB_FOUND) - add_test(Tangential_complex_example_basic - ${CMAKE_CURRENT_BINARY_DIR}/Tangential_complex_example_basic) - - add_test(Tangential_complex_example_with_perturb - ${CMAKE_CURRENT_BINARY_DIR}/Tangential_complex_example_with_perturb) + add_test(NAME Tangential_complex_example_basic + COMMAND $) + add_test(NAME Tangential_complex_example_with_perturb + COMMAND $) endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Tangential_complex/test/CMakeLists.txt b/src/Tangential_complex/test/CMakeLists.txt index b2bf5dd7..fc710676 100644 --- a/src/Tangential_complex/test/CMakeLists.txt +++ b/src/Tangential_complex/test/CMakeLists.txt @@ -1,23 +1,14 @@ cmake_minimum_required(VERSION 2.6) project(Tangential_complex_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() - if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + include(GUDHI_test_coverage) + add_executable( Tangential_complex_test_TC test_tangential_complex.cpp ) target_link_libraries(Tangential_complex_test_TC ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) target_link_libraries(Tangential_complex_test_TC ${TBB_LIBRARIES}) endif() - add_test(Tangential_complex_test_TC ${CMAKE_CURRENT_BINARY_DIR}/Tangential_complex_test_TC - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Tangential_complex_UT.xml --log_level=test_suite --report_level=no) + gudhi_add_coverage_test(Tangential_complex_test_TC) endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index 549a85be..670651ce 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -6,7 +6,8 @@ target_link_libraries(Witness_complex_example_nearest_landmark_table ${Boost_SYS if (TBB_FOUND) target_link_libraries(Witness_complex_example_nearest_landmark_table ${TBB_LIBRARIES}) endif() -add_test(Witness_complex_test_nearest_landmark_table Witness_complex_example_nearest_landmark_table) +add_test(NAME Witness_complex_example_nearest_landmark_table + COMMAND $) # CGAL and Eigen3 are required for Euclidean version of Witness if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) @@ -28,17 +29,18 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) target_link_libraries(Witness_complex_example_strong_witness_persistence ${TBB_LIBRARIES}) endif() - add_test(Witness_complex_off_test_torus - ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_off - ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3) - add_test(Witness_complex_strong_off_test_torus - ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_off - ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off 20 1.0 3) - add_test(Witness_complex_test_sphere_10 Witness_complex_example_sphere 10) - add_test(Witness_complex_test_torus_persistence - ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_witness_persistence - ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5) - add_test(Witness_complex_strong_test_torus_persistence - ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_witness_persistence - ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5) + add_test(NAME Witness_complex_example_off_test_torus + COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "20" "1.0" "3") + add_test(NAME Witness_complex_example_strong_off_test_torus + COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "20" "1.0" "3") + add_test(NAME Witness_complex_example_test_sphere_10 + COMMAND $ "10") + add_test(NAME Witness_complex_example_test_torus_persistence + COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-l" "20" "-a" "0.5") + add_test(NAME Witness_complex_example_strong_test_torus_persistence + COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-l" "20" "-a" "0.5") endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt index e73f9c3a..152e2f2c 100644 --- a/src/Witness_complex/test/CMakeLists.txt +++ b/src/Witness_complex/test/CMakeLists.txt @@ -1,14 +1,7 @@ cmake_minimum_required(VERSION 2.6) project(Witness_complex_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) add_executable ( Witness_complex_test_simple_witness_complex test_simple_witness_complex.cpp ) target_link_libraries(Witness_complex_test_simple_witness_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) @@ -16,11 +9,7 @@ if (TBB_FOUND) target_link_libraries(Witness_complex_test_simple_witness_complex ${TBB_LIBRARIES}) endif(TBB_FOUND) -# Unitary tests definition and xml result file generation -add_test(NAME simple_witness_complex - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_test_simple_witness_complex - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_simple_witness_complexUT.xml --log_level=test_suite --report_level=no) +gudhi_add_coverage_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.6.0) @@ -30,9 +19,5 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${TBB_LIBRARIES}) endif(TBB_FOUND) - # Unitary tests definition and xml result file generation - add_test(NAME euclidean_simple_witness_complex - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_test_euclidean_simple_witness_complex - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_euclidean_simple_witness_complexUT.xml --log_level=test_suite --report_level=no) + gudhi_add_coverage_test(Witness_complex_test_euclidean_simple_witness_complex) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) diff --git a/src/cmake/modules/GUDHI_test_coverage.cmake b/src/cmake/modules/GUDHI_test_coverage.cmake index bf7ad7e4..ce171a0e 100644 --- a/src/cmake/modules/GUDHI_test_coverage.cmake +++ b/src/cmake/modules/GUDHI_test_coverage.cmake @@ -9,7 +9,6 @@ if (GPROF_PATH) endif() function(gudhi_add_coverage_test unitary_test) - message("++ ${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml") add_test(NAME ${unitary_test} COMMAND $ "--log_format=XML" "--log_sink=${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml" "--log_level=test_suite" "--report_level=no") endfunction() diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index 61c94391..d5311b18 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -3,17 +3,20 @@ project(Common_examples) add_executable ( vector_double_off_reader example_vector_double_points_off_reader.cpp ) target_link_libraries(vector_double_off_reader ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) -add_test(vector_double_off_reader ${CMAKE_CURRENT_BINARY_DIR}/vector_double_off_reader ${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off) +add_test(NAME Common_example_vector_double_off_reader COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off") if(CGAL_FOUND) add_executable ( cgal_3D_off_reader example_CGAL_3D_points_off_reader.cpp ) target_link_libraries(cgal_3D_off_reader ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - add_test(cgal_3D_off_reader ${CMAKE_CURRENT_BINARY_DIR}/cgal_3D_off_reader ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off) + add_test(NAME Common_example_vector_cgal_3D_off_reader COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off") # need CGAL 4.7and Eigen3 if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) add_executable ( cgal_off_reader example_CGAL_points_off_reader.cpp ) target_link_libraries(cgal_off_reader ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - add_test(cgal_off_reader ${CMAKE_CURRENT_BINARY_DIR}/cgal_off_reader ${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off) + add_test(NAME Common_example_vector_cgal_off_reader COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off") endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) endif() diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index baa24539..c695fbf4 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -1,33 +1,18 @@ cmake_minimum_required(VERSION 2.6) project(Common_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() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) -add_executable ( poffreader_UT test_points_off_reader.cpp ) -target_link_libraries(poffreader_UT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( Common_test_points_off_reader test_points_off_reader.cpp ) +target_link_libraries(Common_test_points_off_reader ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) -add_executable ( distancematrixreader_UT test_distance_matrix_reader.cpp ) -target_link_libraries(distancematrixreader_UT ${Boost_SYSTEM_LIBRARY} ${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_SYSTEM_LIBRARY} ${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}/) file(COPY "${CMAKE_SOURCE_DIR}/data/distance_matrix/lower_triangular_distance_matrix.csv" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) file(COPY "${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) -# Unitary tests -add_test(poffreader_UT ${CMAKE_CURRENT_BINARY_DIR}/poffreader_UT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/poffreader_UT.xml --log_level=test_suite --report_level=no) - -add_test(distancematrixreader_UT ${CMAKE_CURRENT_BINARY_DIR}/distancematrixreader_UT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/distancematrixreader_UT.xml --log_level=test_suite --report_level=no) - - +gudhi_add_coverage_test(Common_test_points_off_reader) +gudhi_add_coverage_test(Common_test_distance_matrix_reader) -- cgit v1.2.3 From c23eee17fb16dd3d6229184aac95d57d04f93275 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 19 Apr 2017 20:19:35 +0000 Subject: Fix doc issue git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2368 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: aa8997eb2c66b9b25206688acc5819f2ded0e985 --- biblio/how_to_cite_gudhi.bib | 2 +- src/common/doc/header.html | 4 ++-- src/common/doc/main_page.h | 2 +- src/cython/doc/_templates/layout.html | 4 ++-- src/cython/doc/index.rst | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/biblio/how_to_cite_gudhi.bib b/biblio/how_to_cite_gudhi.bib index 79b1ddd6..59c05a5b 100644 --- a/biblio/how_to_cite_gudhi.bib +++ b/biblio/how_to_cite_gudhi.bib @@ -119,6 +119,6 @@ , title = "Cython interface" , publisher = "{GUDHI Editorial Board}" , booktitle = "{GUDHI} User and Reference Manual" -, url = "http://gudhi.gforge.inria.fr/cython/latest/" +, url = "http://gudhi.gforge.inria.fr/python/latest/" , year = 2016 } diff --git a/src/common/doc/header.html b/src/common/doc/header.html index 94e641b2..53b5c0a2 100644 --- a/src/common/doc/header.html +++ b/src/common/doc/header.html @@ -64,8 +64,8 @@ $extrastylesheet
  • diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index e6f29fa8..2e45e5aa 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -5,7 +5,7 @@ * \section Introduction Introduction * The GUDHI library (Geometry Understanding in Higher Dimensions) is a generic open source * C++ library, with a - * Cython interface, for + * Python interface, for * Computational Topology and Topological Data Analysis * (TDA). * The GUDHI library intends to help the development of new algorithmic solutions in TDA and their transfer to diff --git a/src/cython/doc/_templates/layout.html b/src/cython/doc/_templates/layout.html index af0eef64..b11c1236 100644 --- a/src/cython/doc/_templates/layout.html +++ b/src/cython/doc/_templates/layout.html @@ -205,8 +205,8 @@
  • diff --git a/src/cython/doc/index.rst b/src/cython/doc/index.rst index fca63d65..94dbc65a 100644 --- a/src/cython/doc/index.rst +++ b/src/cython/doc/index.rst @@ -9,7 +9,7 @@ Introduction The Gudhi library (Geometry Understanding in Higher Dimensions) is a generic open source `C++ library `_, with a -`Cython interface `_, for +`Python interface `_, for Computational Topology and Topological Data Analysis (`TDA `_). The GUDHI library intends to help the development of new algorithmic solutions -- cgit v1.2.3 From 3f98e5b18fc468222711cd483cca78f64eddfeeb Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 24 Apr 2017 11:18:41 +0000 Subject: Doc typo git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2375 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 181a2d688b3333b202aa7a25768413259c6c8fbd --- src/common/doc/main_page.h | 2 +- src/cython/doc/index.rst | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 2e45e5aa..125ef47b 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -16,7 +16,7 @@ * * \li Data structures to represent, construct and manipulate simplicial complexes. * \li Simplification of simplicial complexes by edge contraction. - * \li Algorithms to compute persistent homology persistent homology. + * \li Algorithms to compute persistent homology and bottleneck distance. * * All data-structures are generic and several of their aspects can be parameterized via template classes. * We refer to \cite gudhilibrary_ICMS14 for a detailed description of the design of the library. diff --git a/src/cython/doc/index.rst b/src/cython/doc/index.rst index 94dbc65a..89bc0bb2 100644 --- a/src/cython/doc/index.rst +++ b/src/cython/doc/index.rst @@ -20,12 +20,11 @@ data structures. The current release of the GUDHI library includes: * Data structures to represent, construct and manipulate simplicial complexes. -* Algorithms to compute persistent homology and multi-field persistent homology. * Simplication of simplicial complexes by edge contraction. +* Algorithms to compute persistent homology and bottleneck distance. -All data-structures are generic and several of their aspects can be -parameterized via template classes. We refer to :cite:`gudhilibrary_ICMS14` -for a detailed description of the design of the library. +We refer to :cite:`gudhilibrary_ICMS14` for a detailed description of the +design of the library. Data structures *************** -- cgit v1.2.3 From 0973c016220d689fcb429021a86d9e5833034800 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 24 Apr 2017 12:24:54 +0000 Subject: Make compilation and tests out of source git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2376 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 0bc362b7321ed22af0c20f020eafc98efecbac46 --- .../example/Bitmap_cubical_complex.cpp | 24 ++++++++++++++-------- ...ubical_complex_periodic_boundary_conditions.cpp | 21 ++++++++++++------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp index e6bc6648..67735ba1 100644 --- a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp +++ b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex.cpp @@ -27,8 +27,9 @@ // standard stuff #include -#include +#include #include +#include int main(int argc, char** argv) { std::cout << "This program computes persistent homology, by using bitmap_cubical_complex class, of cubical " << @@ -38,9 +39,6 @@ int main(int argc, char** argv) { "filtrations of top dimensional cells. We assume that the cells are in the lexicographical order. See " << "CubicalOneSphere.txt or CubicalTwoSphere.txt for example.\n" << std::endl; - int p = 2; - double min_persistence = 0; - if (argc != 2) { std::cerr << "Wrong number of parameters. Please provide the name of a file with a Perseus style bitmap at " << "the input. The program will now terminate.\n"; @@ -56,16 +54,26 @@ int main(int argc, char** argv) { // Compute the persistence diagram of the complex Persistent_cohomology pcoh(b); + int p = 2; + double min_persistence = 0; + pcoh.init_coefficients(p); // initializes the coefficient field for homology pcoh.compute_persistent_cohomology(min_persistence); - std::stringstream ss; - ss << argv[1] << "_persistence"; - std::ofstream out(ss.str().c_str()); + std::string output_file_name(argv[1]); + output_file_name += "_persistence"; + + std::size_t last_in_path = output_file_name.find_last_of("/\\"); + + if (last_in_path != std::string::npos) { + output_file_name = output_file_name.substr(last_in_path+1); + } + + std::ofstream out(output_file_name.c_str()); pcoh.output_diagram(out); out.close(); - std::cout << "Result in file: " << ss.str().c_str() << "\n"; + std::cout << "Result in file: " << output_file_name << "\n"; return 0; } diff --git a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex_periodic_boundary_conditions.cpp b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex_periodic_boundary_conditions.cpp index 839a4c89..f8754345 100644 --- a/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex_periodic_boundary_conditions.cpp +++ b/src/Bitmap_cubical_complex/example/Bitmap_cubical_complex_periodic_boundary_conditions.cpp @@ -40,9 +40,6 @@ int main(int argc, char** argv) { "assume that the cells are in the lexicographical order. See CubicalOneSphere.txt or CubicalTwoSphere.txt for" << " example.\n" << std::endl; - int p = 2; - double min_persistence = 0; - if (argc != 2) { std::cerr << "Wrong number of parameters. Please provide the name of a file with a Perseus style bitmap at " << "the input. The program will now terminate.\n"; @@ -58,16 +55,26 @@ int main(int argc, char** argv) { typedef Gudhi::persistent_cohomology::Persistent_cohomology Persistent_cohomology; // Compute the persistence diagram of the complex Persistent_cohomology pcoh(b, true); + + int p = 2; + double min_persistence = 0; pcoh.init_coefficients(p); // initializes the coefficient field for homology pcoh.compute_persistent_cohomology(min_persistence); - std::stringstream ss; - ss << argv[1] << "_persistence"; - std::ofstream out(ss.str().c_str()); + std::string output_file_name(argv[1]); + output_file_name += "_persistence"; + + std::size_t last_in_path = output_file_name.find_last_of("/\\"); + + if (last_in_path != std::string::npos) { + output_file_name = output_file_name.substr(last_in_path+1); + } + + std::ofstream out(output_file_name.c_str()); pcoh.output_diagram(out); out.close(); - std::cout << "Result in file: " << ss.str().c_str() << "\n"; + std::cout << "Result in file: " << output_file_name << "\n"; return 0; } -- cgit v1.2.3 From 69d023fad672093a4eb7eaa974bcfb3c17b5aed1 Mon Sep 17 00:00:00 2001 From: cjamin Date: Mon, 24 Apr 2017 15:22:52 +0000 Subject: Remove unused variables git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2379 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 90fd2f0b1fe4ff48e5ba0ee69db76bed60906ec1 --- src/Tangential_complex/include/gudhi/Tangential_complex.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index cfc82eb1..9fa7c825 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -1059,7 +1059,6 @@ class Tangential_complex { Triangulation &triangulation, bool verbose = false) { int tangent_space_dim = tsb.dimension(); const Tr_traits &local_tr_traits = triangulation.geom_traits(); - Tr_vertex_handle center_vertex; // Kernel functor & objects typename K::Squared_distance_d k_sqdist = m_k.squared_distance_d_object(); @@ -1084,7 +1083,7 @@ class Tangential_complex { proj_wp = project_point_and_compute_weight(wp, tsb, local_tr_traits); } - center_vertex = triangulation.insert(proj_wp); + Tr_vertex_handle center_vertex = triangulation.insert(proj_wp); center_vertex->data() = i; if (verbose) std::cerr << "* Inserted point #" << i << "\n"; @@ -1823,7 +1822,6 @@ class Tangential_complex { bool is_inconsistent = false; Star const& star = m_stars[tr_index]; - Tr_vertex_handle center_vh = m_triangulations[tr_index].center_vertex(); // For each incident simplex Star::const_iterator it_inc_simplex = star.begin(); @@ -1950,7 +1948,6 @@ class Tangential_complex { bool is_star_inconsistent = false; Triangulation const& tr = it_tr->tr(); - Tr_vertex_handle center_vh = it_tr->center_vertex(); if (tr.current_dimension() < m_intrinsic_dim) continue; -- cgit v1.2.3 From 08f745543df5944075c9091f97c217284ce7f52f Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 26 Apr 2017 07:56:09 +0000 Subject: Fix warnings git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2381 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: db27facc0c7eec7c48233648c6df4a47f9e09697 --- src/Witness_complex/include/gudhi/Strong_witness_complex.h | 4 ---- src/Witness_complex/include/gudhi/Witness_complex.h | 4 ---- 2 files changed, 8 deletions(-) diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h index a973ddb7..6f4bcf60 100644 --- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h +++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h @@ -105,10 +105,6 @@ class Strong_witness_complex { << "non-negative.\n"; return false; } - if (limit_dimension < 0) { - std::cerr << "Strong witness complex cannot create complex - limit dimension must be non-negative.\n"; - return false; - } for (auto w : nearest_landmark_table_) { ActiveWitness aw(w); typeVectorVertex simplex; diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 63f03687..bcfe8484 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -106,10 +106,6 @@ class Witness_complex { std::cerr << "Witness complex cannot create complex - squared relaxation parameter must be non-negative.\n"; return false; } - if (limit_dimension < 0) { - std::cerr << "Witness complex cannot create complex - limit dimension must be non-negative.\n"; - return false; - } ActiveWitnessList active_witnesses; Landmark_id k = 0; /* current dimension in iterative construction */ for (auto w : nearest_landmark_table_) -- cgit v1.2.3 From 00ac8cd356f628490630c8294b3fea2a6c52e082 Mon Sep 17 00:00:00 2001 From: glisse Date: Tue, 2 May 2017 20:14:45 +0000 Subject: typos git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2392 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 6f20690dcf711382a244eef6ce6eccab76315710 --- src/Simplex_tree/doc/Intro_simplex_tree.h | 2 +- src/cython/doc/alpha_complex_sum.rst | 2 +- src/cython/doc/index.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Simplex_tree/doc/Intro_simplex_tree.h b/src/Simplex_tree/doc/Intro_simplex_tree.h index 940dd694..f5b72ff6 100644 --- a/src/Simplex_tree/doc/Intro_simplex_tree.h +++ b/src/Simplex_tree/doc/Intro_simplex_tree.h @@ -32,7 +32,7 @@ namespace Gudhi { * \author Clément Maria * * A simplicial complex \f$\mathbf{K}\f$ on a set of vertices \f$V = \{1, \cdots ,|V|\}\f$ is a collection of - * implices \f$\{\sigma\}\f$, \f$\sigma \subseteq V\f$ such that + * simplices \f$\{\sigma\}\f$, \f$\sigma \subseteq V\f$ such that * \f$\tau \subseteq \sigma \in \mathbf{K} \rightarrow \tau \in \mathbf{K}\f$. The dimension \f$n=|\sigma|-1\f$ of * \f$\sigma\f$ is its number of elements minus \f$1\f$. * diff --git a/src/cython/doc/alpha_complex_sum.rst b/src/cython/doc/alpha_complex_sum.rst index 8437e901..a5f6420a 100644 --- a/src/cython/doc/alpha_complex_sum.rst +++ b/src/cython/doc/alpha_complex_sum.rst @@ -16,7 +16,7 @@ | | complex. | | | | | | This package requires having CGAL version 4.7 or higher (4.8.1 is | -| | advised for better perfomances). | +| | advised for better performance). | +----------------------------------------------------------------+------------------------------------------------------------------------+ | :doc:`alpha_complex_user` | :doc:`alpha_complex_ref` | +----------------------------------------------------------------+------------------------------------------------------------------------+ diff --git a/src/cython/doc/index.rst b/src/cython/doc/index.rst index 89bc0bb2..4f5acfd4 100644 --- a/src/cython/doc/index.rst +++ b/src/cython/doc/index.rst @@ -20,7 +20,7 @@ data structures. The current release of the GUDHI library includes: * Data structures to represent, construct and manipulate simplicial complexes. -* Simplication of simplicial complexes by edge contraction. +* Simplification of simplicial complexes by edge contraction. * Algorithms to compute persistent homology and bottleneck distance. We refer to :cite:`gudhilibrary_ICMS14` for a detailed description of the -- cgit v1.2.3 From b487c8bf2bb87566a73d607f83785f2497866684 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 9 May 2017 13:07:56 +0000 Subject: Doc issue git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2407 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 59aa4cbeef583b93f5e0e4416a4cd2903643d8f0 --- src/Persistent_cohomology/example/README | 2 +- src/common/doc/main_page.h | 5 ++--- src/cython/doc/index.rst | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Persistent_cohomology/example/README b/src/Persistent_cohomology/example/README index 2ac79398..794b94ae 100644 --- a/src/Persistent_cohomology/example/README +++ b/src/Persistent_cohomology/example/README @@ -121,7 +121,7 @@ N.B.: - alpha_complex_persistence accepts OFF files in d-Dimension. 3) 3D periodic special case --------------------------- -./periodic_alpha_complex_3d_persistence ../../data/points/grid_10_10_10_in_0_1.off 3 1.0 +./periodic_alpha_complex_3d_persistence ../../data/points/grid_10_10_10_in_0_1.off ../../data/points/iso_cuboid_3_in_0_1.txt 3 1.0 output: Periodic Delaunay computed. diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 125ef47b..bd4615f5 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -1,11 +1,10 @@ -/*! \mainpage +/*! \mainpage The C++ library * \tableofcontents * \image html "Gudhi_banner.png" "" width=20cm * * \section Introduction Introduction * The GUDHI library (Geometry Understanding in Higher Dimensions) is a generic open source - * C++ library, with a - * Python interface, for + * C++ library for * Computational Topology and Topological Data Analysis * (TDA). * The GUDHI library intends to help the development of new algorithmic solutions in TDA and their transfer to diff --git a/src/cython/doc/index.rst b/src/cython/doc/index.rst index 4f5acfd4..f6d10567 100644 --- a/src/cython/doc/index.rst +++ b/src/cython/doc/index.rst @@ -1,5 +1,5 @@ -GUDHI documentation -################### +GUDHI Python module documentation +################################# .. image:: img/Gudhi_banner.png :align: center @@ -7,9 +7,9 @@ GUDHI documentation Introduction ************ -The Gudhi library (Geometry Understanding in Higher Dimensions) is a generic -open source `C++ library `_, with a -`Python interface `_, for +The Python interface for the Gudhi library (Geometry Understanding in Higher +Dimensions) is a generic open source +`Python module `_, for Computational Topology and Topological Data Analysis (`TDA `_). The GUDHI library intends to help the development of new algorithmic solutions -- cgit v1.2.3 From 700c2cf3833a55af11b731a6a44c189e8f01b978 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 9 May 2017 14:38:46 +0000 Subject: Fix Windows python module compilation rips_complex_diagram_persistence_from_distance_matrix_file_example.py shall use csv_file instead of off_file git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2409 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b73613ce923e4bb72f5eae110cf290dc2215994d --- src/Bottleneck_distance/include/gudhi/Bottleneck.h | 4 +- .../include/gudhi/Persistence_graph.h | 8 ++-- ...ersistence_from_distance_matrix_file_example.py | 45 +++++++++------------- 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h index b90a0ee0..8c97dce9 100644 --- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h +++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h @@ -101,11 +101,11 @@ double bottleneck_distance_exact(Persistence_graph& g) { */ template double bottleneck_distance(const Persistence_diagram1 &diag1, const Persistence_diagram2 &diag2, - double e = std::numeric_limits::min()) { + double e = (std::numeric_limits::min)()) { Persistence_graph g(diag1, diag2, e); if (g.bottleneck_alive() == std::numeric_limits::infinity()) return std::numeric_limits::infinity(); - return std::max(g.bottleneck_alive(), e == 0. ? bottleneck_distance_exact(g) : bottleneck_distance_approx(g, e)); + return (std::max)(g.bottleneck_alive(), e == 0. ? bottleneck_distance_exact(g) : bottleneck_distance_approx(g, e)); } } // namespace persistence_diagram diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h index 44f4b827..622b0691 100644 --- a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h +++ b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h @@ -102,7 +102,7 @@ Persistence_graph::Persistence_graph(const Persistence_diagram1 &diag1, b_alive = std::numeric_limits::infinity(); } else { for (auto it_u = u_alive.cbegin(), it_v = v_alive.cbegin(); it_u != u_alive.cend(); ++it_u, ++it_v) - b_alive = std::max(b_alive, std::fabs(*it_u - *it_v)); + b_alive = (std::max)(b_alive, std::fabs(*it_u - *it_v)); } } @@ -129,7 +129,7 @@ inline double Persistence_graph::distance(int u_point_index, int v_point_index) return 0.; Internal_point p_u = get_u_point(u_point_index); Internal_point p_v = get_v_point(v_point_index); - return std::max(std::fabs(p_u.x() - p_v.x()), std::fabs(p_u.y() - p_v.y())); + return (std::max)(std::fabs(p_u.x() - p_v.x()), std::fabs(p_u.y() - p_v.y())); } inline int Persistence_graph::size() const { @@ -175,9 +175,9 @@ inline Internal_point Persistence_graph::get_v_point(int v_point_index) const { inline double Persistence_graph::diameter_bound() const { double max = 0.; for (auto it = u.cbegin(); it != u.cend(); it++) - max = std::max(max, it->y()); + max = (std::max)(max, it->y()); for (auto it = v.cbegin(); it != v.cend(); it++) - max = std::max(max, it->y()); + max = (std::max)(max, it->y()); return max; } diff --git a/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py b/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py index 664eb5c4..984dbf1b 100755 --- a/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py +++ b/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py @@ -43,29 +43,22 @@ parser.add_argument('--no-diagram', default=False, action='store_true' , help='F args = parser.parse_args() -with open(args.file, 'r') as f: - first_line = f.readline() - if (first_line == 'OFF\n') or (first_line == 'nOFF\n'): - print("#####################################################################") - print("RipsComplex creation from distance matrix read in a csv file") - - message = "RipsComplex with max_edge_length=" + repr(args.max_edge_length) - print(message) - - rips_complex = gudhi.RipsComplex(off_file=args.file, max_edge_length=args.max_edge_length) - simplex_tree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension) - - message = "Number of simplices=" + repr(simplex_tree.num_simplices()) - print(message) - - diag = simplex_tree.persistence() - - print("betti_numbers()=") - print(simplex_tree.betti_numbers()) - - if args.no_diagram == False: - gudhi.plot_persistence_diagram(diag) - else: - print(args.file, "is not a valid OFF file") - - f.close() +print("#####################################################################") +print("RipsComplex creation from distance matrix read in a csv file") + +message = "RipsComplex with max_edge_length=" + repr(args.max_edge_length) +print(message) + +rips_complex = gudhi.RipsComplex(csv_file=args.file, max_edge_length=args.max_edge_length) +simplex_tree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension) + +message = "Number of simplices=" + repr(simplex_tree.num_simplices()) +print(message) + +diag = simplex_tree.persistence() + +print("betti_numbers()=") +print(simplex_tree.betti_numbers()) + +if args.no_diagram == False: + gudhi.plot_persistence_diagram(diag) -- cgit v1.2.3 -- cgit v1.2.3 From c014546f2f2ecd99b8d4f6477f48514a65614577 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 15 May 2017 15:26:26 +0000 Subject: Add GPL copyright to the software used to generate the data. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/doxygen_using_mathjax@2427 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3aa8a0a8847b57db28ec26a38af72abf3bf509ad --- data/points/SO3.COPYRIGHT | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/points/SO3.COPYRIGHT b/data/points/SO3.COPYRIGHT index 26bbb0ad..a9383f8f 100644 --- a/data/points/SO3.COPYRIGHT +++ b/data/points/SO3.COPYRIGHT @@ -7,3 +7,5 @@ This software is an implementation of the two following papers: J. C. Mitchell. Discrete Uniform Sampling of Rotation Groups Using Orthogonal Images. SIAM Journal of Scientific Computing, 30(1):525-547, 2007. A. Yershova, S. Jain, S. M. LaValle, and J. C. Mitchell. Generating Uniform Incremental Grids on SO(3) Using the Hopf Fibration International Journal of Robotics Research, November 2009. + +This software copyright is GNU General Public License as published by the Free Software Foundation version 2. -- cgit v1.2.3 From b4d174675a9b4538c18a2bac85fa99ef61c35727 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 15 May 2017 15:27:27 +0000 Subject: Use MATHJAX for doxygen documentation generation. Fix pseudo code for alpha complex git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/doxygen_using_mathjax@2428 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 05ce587c4ba46e164dad02766cbaca40373e3ad8 --- src/Alpha_complex/doc/Intro_alpha_complex.h | 83 ++++++++++++++++++++--------- src/Doxyfile | 6 +-- 2 files changed, 61 insertions(+), 28 deletions(-) diff --git a/src/Alpha_complex/doc/Intro_alpha_complex.h b/src/Alpha_complex/doc/Intro_alpha_complex.h index 69959fc5..cf1a946a 100644 --- a/src/Alpha_complex/doc/Intro_alpha_complex.h +++ b/src/Alpha_complex/doc/Intro_alpha_complex.h @@ -89,31 +89,64 @@ namespace alpha_complex { * \image html "alpha_complex_doc.png" "Simplicial complex structure construction example" * * \subsection filtrationcomputation Filtration value computation algorithm - * - * \f{algorithm}{ - * \caption{Filtration value computation algorithm}\label{alpha} - * \begin{algorithmic} - * \For{i : dimension $\rightarrow$ 0} - * \ForAll{$\sigma$ of dimension i} - * \If {filtration($\sigma$) is NaN} - * \State filtration($\sigma$) = $\alpha^2(\sigma)$ - * \EndIf - * \ForAll{$\tau$ face of $\sigma$} \Comment{propagate alpha filtration value} - * \If {filtration($\tau$) is not NaN} - * \State filtration($\tau$) = min (filtration($\tau$), filtration($\sigma$)) - * \Else - * \If {$\tau$ is not Gabriel for $\sigma$} - * \State filtration($\tau$) = filtration($\sigma$) - * \EndIf - * \EndIf - * \EndFor - * \EndFor - * \EndFor - * \State make\_filtration\_non\_decreasing() - * \State prune\_above\_filtration() - * \end{algorithmic} - * \f} - * + * + * + * + *
      + *
    • \f$ \textbf{for } i : dimension \rightarrow 0 \textbf{ do} \f$ + *
        + *
      • \f$\textbf{for all } \sigma of dimension i \f$ + *
          + *
        • \f$\textbf{if } filtration( \sigma ) is NaN \textbf{ then} \f$ + *
            + *
          • \f$ filtration( \sigma ) = \alpha^2( \sigma ) \f$ + *
          • + *
          + *
        • + *
        • \f$\textbf{end if}\f$ + *
        • + *
        • \f$\textbf{for all } \tau face of \sigma \textbf{ do} \f$ + *        // propagate alpha filtration value + *
            + *
          • \f$\textbf{if } filtration( \tau ) is not NaN \textbf{ then} \f$ + *
              + *
            • \f$ filtration( \tau ) = min ( filtration( \tau ), filtration( \sigma ) ) \f$ + *
            • + *
            + *
          • + *
          • \f$\textbf{else}\f$ + *
              + *
            • \f$\textbf{if } \tau is not Gabriel for \sigma \textbf{ then} \f$ + *
                + *
              • \f$ filtration( \tau ) = filtration( \sigma ) \f$ + *
              • + *
              + *
            • + *
            • \f$\textbf{end if}\f$ + *
            • + *
            + *
          • + *
          • \f$\textbf{end if}\f$ + *
          • + *
          + *
        • + *
        • \f$\textbf{end for}\f$ + *
        • + *
        + *
      • + *
      • \f$\textbf{end for}\f$ + *
      • + *
      + *
    • + *
    • \f$\textbf{end for}\f$ + *
    • + *
    • \f$make\_filtration\_non\_decreasing()\f$ + *
    • + *
    • \f$prune\_above\_filtration()\f$ + *
    • + *
    + * + * * \subsubsection dimension2 Dimension 2 * * From the example above, it means the algorithm looks into each triangle ([0,1,2], [0,2,4], [1,2,3], ...), diff --git a/src/Doxyfile b/src/Doxyfile index d2d0a447..9cd3894c 100644 --- a/src/Doxyfile +++ b/src/Doxyfile @@ -1427,7 +1427,7 @@ FORMULA_TRANSPARENT = YES # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -USE_MATHJAX = NO +USE_MATHJAX = YES # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: @@ -1450,14 +1450,14 @@ MATHJAX_FORMAT = HTML-CSS # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_RELPATH = http://gudhi.gforge.inria.fr/doc # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols TeX/algorithm TeX/algpseudocode # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -- cgit v1.2.3