From bb56631552ff8cf431d2286470223f7394cb2846 Mon Sep 17 00:00:00 2001 From: cjamin Date: Tue, 31 May 2016 16:09:46 +0000 Subject: Farthest points (from Siargey) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1230 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3093bfd41948fecf5f6ccb2d1d77546c12e628f4 --- src/Subsampling/test/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/Subsampling/test/CMakeLists.txt (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt new file mode 100644 index 00000000..3a45c685 --- /dev/null +++ b/src/Subsampling/test/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 2.6) +project(GUDHILandmarkingTest) + +# Landmarking test +if(CGAL_FOUND) + if (NOT CGAL_VERSION VERSION_LESS 4.8.0) + message(STATUS "CGAL version: ${CGAL_VERSION}.") + + find_package(Eigen3 3.1.0) + if (EIGEN3_FOUND) + message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") + include( ${EIGEN3_USE_FILE} ) + include_directories (BEFORE "../../include") + + add_executable( landmarking_UT landmarking.cpp ) + else() + message(WARNING "Eigen3 not found. Version 3.1.0 is required for Landmarking feature.") + endif() + else() + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Landmarking feature. Version 4.8.0 is required.") + endif () +endif() -- cgit v1.2.3 From a3b6dbe9223bc71ebbb763066a1cd9f3359322a8 Mon Sep 17 00:00:00 2001 From: cjamin Date: Mon, 20 Jun 2016 16:54:13 +0000 Subject: Add test git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1316 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a597203ec80289750b8faa2d6e5293211125dd3c --- src/Subsampling/test/CMakeLists.txt | 6 ++--- src/Subsampling/test/test_sparsify_point_set.cpp | 34 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/Subsampling/test/test_sparsify_point_set.cpp (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 3a45c685..1785b86d 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHILandmarkingTest) +project(Subsampling_tests) -# Landmarking test if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.0) message(STATUS "CGAL version: ${CGAL_VERSION}.") @@ -13,8 +12,9 @@ if(CGAL_FOUND) include_directories (BEFORE "../../include") add_executable( landmarking_UT landmarking.cpp ) + add_executable( Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Landmarking feature.") + message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() else() message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Landmarking feature. Version 4.8.0 is required.") diff --git a/src/Subsampling/test/test_sparsify_point_set.cpp b/src/Subsampling/test/test_sparsify_point_set.cpp new file mode 100644 index 00000000..e9d2a8f6 --- /dev/null +++ b/src/Subsampling/test/test_sparsify_point_set.cpp @@ -0,0 +1,34 @@ +// #ifdef _DEBUG +// # define TBB_USE_THREADING_TOOL +// #endif + +#include + +#include +#include + +#include +#include +#include + +int main() { + typedef CGAL::Epick_d > K; + typedef typename K::FT FT; + typedef typename K::Point_d Point_d; + + CGAL::Random rd; + + std::vector points; + for (int i = 0 ; i < 500 ; ++i) + points.push_back(Point_d(std::array({rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1)}))); + + K k; + std::vector results; + Gudhi::subsampling::sparsify_point_set(k, points, 0.5, std::back_inserter(results)); + std::cout << "Before sparsification: " << points.size() << " points.\n"; + std::cout << "After sparsification: " << results.size() << " points.\n"; + //for (auto p : results) + // std::cout << p << "\n"; + + return 0; +} -- cgit v1.2.3 From 1539aa803375bbb562559ab632d8ce22c6ce940b Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 21 Jun 2016 09:20:44 +0000 Subject: Merged the CMakeLists and added test_choose_by_farthest_point git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1318 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 534a2ac30a2177a780d1f483add2c472d4cedac3 --- .../include/gudhi/choose_by_farthest_point.h | 4 ++- src/Subsampling/test/CMakeLists.txt | 14 ++++++++- .../test/test_choose_farthest_point.cpp | 35 ++++++++++++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 src/Subsampling/test/test_choose_farthest_point.cpp (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/include/gudhi/choose_by_farthest_point.h b/src/Subsampling/include/gudhi/choose_by_farthest_point.h index 61a21f44..9877d5eb 100644 --- a/src/Subsampling/include/gudhi/choose_by_farthest_point.h +++ b/src/Subsampling/include/gudhi/choose_by_farthest_point.h @@ -25,6 +25,8 @@ #include +#include + #include #include // for sort #include @@ -73,7 +75,7 @@ namespace Gudhi { for (current_number_of_landmarks = 0; current_number_of_landmarks != nbL; current_number_of_landmarks++) { // curr_max_w at this point is the next landmark *output_it++ = points[curr_max_w]; - std::cout << curr_max_w << "\n"; + // std::cout << curr_max_w << "\n"; unsigned i = 0; for (auto& p : points) { double curr_dist = sqdist(p, *(std::begin(points) + curr_max_w)); diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 1785b86d..3a7fc092 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -1,6 +1,16 @@ 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() + +# Landmarking test if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.0) message(STATUS "CGAL version: ${CGAL_VERSION}.") @@ -11,7 +21,9 @@ if(CGAL_FOUND) include( ${EIGEN3_USE_FILE} ) include_directories (BEFORE "../../include") - add_executable( landmarking_UT landmarking.cpp ) + add_executable( test_choose_farthest_point test_choose_farthest_point.cpp ) + target_link_libraries(test_choose_farthest_point ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable( Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") diff --git a/src/Subsampling/test/test_choose_farthest_point.cpp b/src/Subsampling/test/test_choose_farthest_point.cpp new file mode 100644 index 00000000..2f83fac9 --- /dev/null +++ b/src/Subsampling/test/test_choose_farthest_point.cpp @@ -0,0 +1,35 @@ +// #ifdef _DEBUG +// # define TBB_USE_THREADING_TOOL +// #endif + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE "witness_complex_points" +#include +#include + +#include +#include +#include + +#include + +typedef CGAL::Epick_d K; +typedef typename K::FT FT; +typedef typename K::Point_d Point_d; + + +BOOST_AUTO_TEST_CASE(test_choose_farthest_point) { + std::vector< Point_d > points, landmarks; + // Add grid points (625 points) + for (FT i = 0; i < 5; i += 1.0) + for (FT j = 0; j < 5; j += 1.0) + for (FT k = 0; k < 5; k += 1.0) + for (FT l = 0; l < 5; l += 1.0) + points.push_back(Point_d(std::vector({i, j, k, l}))); + + landmarks.clear(); + K k; + Gudhi::choose_by_farthest_point(k, points, 100, std::back_inserter(landmarks)); + + assert(landmarks.size() == 100); +} -- cgit v1.2.3 From 3113edccca8b0ecf1bc3a942abd03f62c7bb0bcb Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 21 Jun 2016 09:29:59 +0000 Subject: Renamed the test for pick_random_points git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1319 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 2210767dc829ba596409170200ba8fce5d39fdf1 --- src/Subsampling/test/CMakeLists.txt | 6 ++- src/Subsampling/test/landmarking.cpp | 47 ------------------------ src/Subsampling/test/test_pick_random_points.cpp | 44 ++++++++++++++++++++++ 3 files changed, 48 insertions(+), 49 deletions(-) delete mode 100644 src/Subsampling/test/landmarking.cpp create mode 100644 src/Subsampling/test/test_pick_random_points.cpp (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 3a7fc092..0c591e8b 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -21,8 +21,10 @@ if(CGAL_FOUND) include( ${EIGEN3_USE_FILE} ) include_directories (BEFORE "../../include") - add_executable( test_choose_farthest_point test_choose_farthest_point.cpp ) - target_link_libraries(test_choose_farthest_point ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable( Subsampling_test_pick_random_points test_pick_random_points.cpp ) + + add_executable( Subsampling_test_choose_farthest_point test_choose_farthest_point.cpp ) + target_link_libraries(Subsampling_test_choose_farthest_point ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) add_executable( Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) else() diff --git a/src/Subsampling/test/landmarking.cpp b/src/Subsampling/test/landmarking.cpp deleted file mode 100644 index a2c85349..00000000 --- a/src/Subsampling/test/landmarking.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// #ifdef _DEBUG -// # define TBB_USE_THREADING_TOOL -// #endif - -#include -#include -#include -#include - -#include - - -int main() { - typedef CGAL::Epick_d K; - typedef typename K::FT FT; - typedef typename K::Point_d Point_d; - - std::vector vect; - vect.push_back(Point_d(std::vector({0,0,0,0}))); - vect.push_back(Point_d(std::vector({0,0,0,1}))); - vect.push_back(Point_d(std::vector({0,0,1,0}))); - vect.push_back(Point_d(std::vector({0,0,1,1}))); - vect.push_back(Point_d(std::vector({0,1,0,0}))); - vect.push_back(Point_d(std::vector({0,1,0,1}))); - vect.push_back(Point_d(std::vector({0,1,1,0}))); - vect.push_back(Point_d(std::vector({0,1,1,1}))); - vect.push_back(Point_d(std::vector({1,0,0,0}))); - vect.push_back(Point_d(std::vector({1,0,0,1}))); - vect.push_back(Point_d(std::vector({1,0,1,0}))); - vect.push_back(Point_d(std::vector({1,0,1,1}))); - vect.push_back(Point_d(std::vector({1,1,0,0}))); - vect.push_back(Point_d(std::vector({1,1,0,1}))); - vect.push_back(Point_d(std::vector({1,1,1,0}))); - vect.push_back(Point_d(std::vector({1,1,1,1}))); - - - std::vector landmarks; - Gudhi::pick_random_points(vect, 5, std::back_inserter(landmarks)); - std::cout << "landmark vector contains: "; - for (auto l: landmarks) - std::cout << l << "\n"; - - landmarks.clear(); - K k; - Gudhi::choose_by_farthest_point(k, vect, 16, std::back_inserter(landmarks)); - -} diff --git a/src/Subsampling/test/test_pick_random_points.cpp b/src/Subsampling/test/test_pick_random_points.cpp new file mode 100644 index 00000000..13c7dcad --- /dev/null +++ b/src/Subsampling/test/test_pick_random_points.cpp @@ -0,0 +1,44 @@ +// #ifdef _DEBUG +// # define TBB_USE_THREADING_TOOL +// #endif + +#include +#include +#include +#include + +#include + + +int main() { + typedef CGAL::Epick_d K; + typedef typename K::FT FT; + typedef typename K::Point_d Point_d; + + std::vector vect; + vect.push_back(Point_d(std::vector({0,0,0,0}))); + vect.push_back(Point_d(std::vector({0,0,0,1}))); + vect.push_back(Point_d(std::vector({0,0,1,0}))); + vect.push_back(Point_d(std::vector({0,0,1,1}))); + vect.push_back(Point_d(std::vector({0,1,0,0}))); + vect.push_back(Point_d(std::vector({0,1,0,1}))); + vect.push_back(Point_d(std::vector({0,1,1,0}))); + vect.push_back(Point_d(std::vector({0,1,1,1}))); + vect.push_back(Point_d(std::vector({1,0,0,0}))); + vect.push_back(Point_d(std::vector({1,0,0,1}))); + vect.push_back(Point_d(std::vector({1,0,1,0}))); + vect.push_back(Point_d(std::vector({1,0,1,1}))); + vect.push_back(Point_d(std::vector({1,1,0,0}))); + vect.push_back(Point_d(std::vector({1,1,0,1}))); + vect.push_back(Point_d(std::vector({1,1,1,0}))); + vect.push_back(Point_d(std::vector({1,1,1,1}))); + + + std::vector landmarks; + Gudhi::pick_random_points(vect, 5, std::back_inserter(landmarks)); + std::cout << "landmark vector contains: "; + for (auto l: landmarks) + std::cout << l << "\n"; + assert(landmarks_size() == 5); + +} -- cgit v1.2.3 From 1ed4039613bee6d3cd85b312e88af71acdbdc163 Mon Sep 17 00:00:00 2001 From: cjamin Date: Tue, 21 Jun 2016 13:53:51 +0000 Subject: Boostify the test git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1323 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 58b2cfba030198debf2831809e430e3bf3251346 --- src/Subsampling/test/CMakeLists.txt | 3 ++- src/Subsampling/test/test_sparsify_point_set.cpp | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 0c591e8b..6fd70e39 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -26,7 +26,8 @@ if(CGAL_FOUND) add_executable( Subsampling_test_choose_farthest_point test_choose_farthest_point.cpp ) target_link_libraries(Subsampling_test_choose_farthest_point ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - add_executable( Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) + add_executable(Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) + target_link_libraries(Subsampling_test_sparsify_point_set ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() diff --git a/src/Subsampling/test/test_sparsify_point_set.cpp b/src/Subsampling/test/test_sparsify_point_set.cpp index e9d2a8f6..8e89f81a 100644 --- a/src/Subsampling/test/test_sparsify_point_set.cpp +++ b/src/Subsampling/test/test_sparsify_point_set.cpp @@ -2,6 +2,10 @@ // # define TBB_USE_THREADING_TOOL // #endif +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE Subsampling - test sparsify_point_set +#include + #include #include @@ -11,7 +15,8 @@ #include #include -int main() { +BOOST_AUTO_TEST_CASE(test_sparsify_point_set) +{ typedef CGAL::Epick_d > K; typedef typename K::FT FT; typedef typename K::Point_d Point_d; @@ -30,5 +35,5 @@ int main() { //for (auto p : results) // std::cout << p << "\n"; - return 0; + BOOST_CHECK(points.size() > results.size()); } -- cgit v1.2.3 From 091796c9be3ac7ddaa96bacc71842a2808da14e4 Mon Sep 17 00:00:00 2001 From: cjamin Date: Tue, 21 Jun 2016 15:15:25 +0000 Subject: Use namespace + improve CMakeLists.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1326 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 7481553ea143479fa48b3722370b3d031ad8175a --- src/Subsampling/include/gudhi/sparsify_point_set.h | 6 +++--- src/Subsampling/test/CMakeLists.txt | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/include/gudhi/sparsify_point_set.h b/src/Subsampling/include/gudhi/sparsify_point_set.h index bd7f4c56..62b1b4b6 100644 --- a/src/Subsampling/include/gudhi/sparsify_point_set.h +++ b/src/Subsampling/include/gudhi/sparsify_point_set.h @@ -40,9 +40,9 @@ sparsify_point_set( const Kernel &k, Point_container const& input_pts, typename Kernel::FT min_squared_dist, OutputIterator output_it) -{ - typedef typename Gudhi::Spatial_tree_data_structure< - Kernel, Point_container> Points_ds; +{ + typedef typename Gudhi::spatial_searching::Spatial_tree_data_structure< + Kernel, Point_container> Points_ds; typename Kernel::Squared_distance_d sqdist = k.squared_distance_d_object(); diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 6fd70e39..80b0ccbb 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -10,7 +10,6 @@ if (GPROF_PATH) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() -# Landmarking test if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.0) message(STATUS "CGAL version: ${CGAL_VERSION}.") @@ -32,6 +31,8 @@ if(CGAL_FOUND) message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Landmarking feature. Version 4.8.0 is required.") + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling tests. Version 4.8.0 is required.") endif () +else() + message(WARNING "CGAL not found. It is required for the Subsampling tests.") endif() -- cgit v1.2.3 From 8587109e64af7ce1f17d8e7756e078a025a37bcb Mon Sep 17 00:00:00 2001 From: cjamin Date: Wed, 6 Jul 2016 16:05:39 +0000 Subject: Fix CMake scripts git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1389 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: b97e07531b300c47ddefd056cc574d89c71a4400 --- src/Spatial_searching/example/CMakeLists.txt | 1 + src/Spatial_searching/test/CMakeLists.txt | 3 ++- src/Subsampling/example/CMakeLists.txt | 2 +- src/Subsampling/test/CMakeLists.txt | 5 +++-- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Spatial_searching/example/CMakeLists.txt b/src/Spatial_searching/example/CMakeLists.txt index c1190d1b..0885c24c 100644 --- a/src/Spatial_searching/example/CMakeLists.txt +++ b/src/Spatial_searching/example/CMakeLists.txt @@ -12,6 +12,7 @@ if(CGAL_FOUND) include_directories (BEFORE "../../include") add_executable( Spatial_searching_example_spatial_searching example_spatial_searching.cpp ) + target_link_libraries(Spatial_searching_example_spatial_searching ${CGAL_LIBRARY}) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for the Tangential_complex examples.") endif() diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt index 297b6749..41059286 100644 --- a/src/Spatial_searching/test/CMakeLists.txt +++ b/src/Spatial_searching/test/CMakeLists.txt @@ -18,7 +18,8 @@ if(CGAL_FOUND) include_directories (BEFORE "../../include") add_executable( Spatial_searching_test_Spatial_tree_data_structure test_Spatial_tree_data_structure.cpp ) - target_link_libraries(Spatial_searching_test_Spatial_tree_data_structure ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + target_link_libraries(Spatial_searching_test_Spatial_tree_data_structure + ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for the Spatial_searching tests.") endif() diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index e1e7cc71..532440eb 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -17,7 +17,7 @@ if(CGAL_FOUND) #target_link_libraries(Subsampling_example_choose_farthest_point ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) - target_link_libraries(Subsampling_example_sparsify_point_set ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 80b0ccbb..18fc84f4 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -21,12 +21,13 @@ if(CGAL_FOUND) include_directories (BEFORE "../../include") add_executable( Subsampling_test_pick_random_points test_pick_random_points.cpp ) + target_link_libraries(Subsampling_test_pick_random_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) add_executable( Subsampling_test_choose_farthest_point test_choose_farthest_point.cpp ) - target_link_libraries(Subsampling_test_choose_farthest_point ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + target_link_libraries(Subsampling_test_choose_farthest_point ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) add_executable(Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) - target_link_libraries(Subsampling_test_sparsify_point_set ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + target_link_libraries(Subsampling_test_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() -- cgit v1.2.3 From d38ddb2d2b6943e1e9b26694ac624f85263ad24b Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 20 Sep 2016 09:45:31 +0000 Subject: Changed choose_by_farthest_point -> choose_n_farthest_points git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1513 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 287ef6f3be6e4db4616ad92ff7369cd7722a1f2d --- src/Subsampling/example/CMakeLists.txt | 4 ++-- src/Subsampling/test/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index 532440eb..b6d71dac 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -13,8 +13,8 @@ if(CGAL_FOUND) add_executable( Subsampling_example_pick_random_points example_pick_random_points.cpp ) - add_executable( Subsampling_example_choose_by_farthest_point example_choose_by_farthest_point.cpp ) - #target_link_libraries(Subsampling_example_choose_farthest_point ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable( Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp ) + #target_link_libraries(Subsampling_example_choose_n_farthest_points ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 18fc84f4..95241cd2 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -23,8 +23,8 @@ if(CGAL_FOUND) add_executable( Subsampling_test_pick_random_points test_pick_random_points.cpp ) target_link_libraries(Subsampling_test_pick_random_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - add_executable( Subsampling_test_choose_farthest_point test_choose_farthest_point.cpp ) - target_link_libraries(Subsampling_test_choose_farthest_point ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable( Subsampling_test_choose_n_farthest_points test_choose_n_farthest_points.cpp ) + target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) add_executable(Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) target_link_libraries(Subsampling_test_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) -- cgit v1.2.3 From 6ad5ac6794ebc46638cd1f0862a553f40d2557d7 Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 20 Sep 2016 16:14:38 +0000 Subject: Renamed pick_random_points -> pick_n_random_points git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1516 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 45cc8cca9debf56dd0d21762e537649dd92d9a4d --- src/Subsampling/doc/Intro_subsampling.h | 4 +- src/Subsampling/example/CMakeLists.txt | 2 +- .../example/example_pick_n_random_points.cpp | 29 ++++++++ .../example/example_pick_random_points.cpp | 29 -------- .../include/gudhi/pick_n_random_points.h | 82 ++++++++++++++++++++++ src/Subsampling/include/gudhi/pick_random_points.h | 82 ---------------------- src/Subsampling/test/CMakeLists.txt | 4 +- src/Subsampling/test/test_pick_n_random_points.cpp | 69 ++++++++++++++++++ src/Subsampling/test/test_pick_random_points.cpp | 69 ------------------ .../example/witness_complex_from_file.cpp | 4 +- .../example/witness_complex_sphere.cpp | 4 +- .../test/witness_complex_points.cpp | 4 +- 12 files changed, 191 insertions(+), 191 deletions(-) create mode 100644 src/Subsampling/example/example_pick_n_random_points.cpp delete mode 100644 src/Subsampling/example/example_pick_random_points.cpp create mode 100644 src/Subsampling/include/gudhi/pick_n_random_points.h delete mode 100644 src/Subsampling/include/gudhi/pick_random_points.h create mode 100644 src/Subsampling/test/test_pick_n_random_points.cpp delete mode 100644 src/Subsampling/test/test_pick_random_points.cpp (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/doc/Intro_subsampling.h b/src/Subsampling/doc/Intro_subsampling.h index aed41430..06aee2fc 100644 --- a/src/Subsampling/doc/Intro_subsampling.h +++ b/src/Subsampling/doc/Intro_subsampling.h @@ -53,11 +53,11 @@ namespace subsampling { * * \include Subsampling/example_choose_by_farthest_point.cpp * - * \section randompointexamples Example: pick_random_points + * \section randompointexamples Example: pick_n_random_points * * This example outputs a subset of 100 points picked randomly. * - * \include Subsampling/example_pick_random_points.cpp + * \include Subsampling/example_pick_n_random_points.cpp * \copyright GNU General Public License v3. * \verbatim Contact: gudhi-users@lists.gforge.inria.fr \endverbatim */ diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index b6d71dac..4710cf00 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -11,7 +11,7 @@ if(CGAL_FOUND) include( ${EIGEN3_USE_FILE} ) include_directories (BEFORE "../../include") - add_executable( Subsampling_example_pick_random_points example_pick_random_points.cpp ) + add_executable( Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp ) add_executable( Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp ) #target_link_libraries(Subsampling_example_choose_n_farthest_points ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) diff --git a/src/Subsampling/example/example_pick_n_random_points.cpp b/src/Subsampling/example/example_pick_n_random_points.cpp new file mode 100644 index 00000000..d2f063ba --- /dev/null +++ b/src/Subsampling/example/example_pick_n_random_points.cpp @@ -0,0 +1,29 @@ +#include + +#include +#include + +#include +#include +#include + +int main (void) +{ + typedef CGAL::Epick_d > K; + typedef typename K::FT FT; + typedef typename K::Point_d Point_d; + + CGAL::Random rd; + + std::vector points; + for (int i = 0 ; i < 500 ; ++i) + points.push_back(Point_d(std::array({rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1)}))); + + K k; + std::vector results; + Gudhi::subsampling::pick_n_random_points(points, 100, std::back_inserter(results)); + std::cout << "Before sparsification: " << points.size() << " points.\n"; + std::cout << "After sparsification: " << results.size() << " points.\n"; + + return 0; +} diff --git a/src/Subsampling/example/example_pick_random_points.cpp b/src/Subsampling/example/example_pick_random_points.cpp deleted file mode 100644 index 348b1b81..00000000 --- a/src/Subsampling/example/example_pick_random_points.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include - -#include -#include - -#include -#include -#include - -int main (void) -{ - typedef CGAL::Epick_d > K; - typedef typename K::FT FT; - typedef typename K::Point_d Point_d; - - CGAL::Random rd; - - std::vector points; - for (int i = 0 ; i < 500 ; ++i) - points.push_back(Point_d(std::array({rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1),rd.get_double(-1.,1)}))); - - K k; - std::vector results; - Gudhi::subsampling::pick_random_points(points, 100, std::back_inserter(results)); - std::cout << "Before sparsification: " << points.size() << " points.\n"; - std::cout << "After sparsification: " << results.size() << " points.\n"; - - return 0; -} diff --git a/src/Subsampling/include/gudhi/pick_n_random_points.h b/src/Subsampling/include/gudhi/pick_n_random_points.h new file mode 100644 index 00000000..4ca1fafc --- /dev/null +++ b/src/Subsampling/include/gudhi/pick_n_random_points.h @@ -0,0 +1,82 @@ +/* This file is part of the Gudhi Library. The Gudhi library + * (Geometric Understanding in Higher Dimensions) is a generic C++ + * library for computational topology. + * + * Author(s): Siargey Kachanovich + * + * Copyright (C) 2016 INRIA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef PICK_RANDOM_POINTS_H_ +#define PICK_RANDOM_POINTS_H_ + +#include + +#include // random_device, mt19937 +#include // shuffle +#include // iota +#include +#include + + +namespace Gudhi { + +namespace subsampling { + + /** + * \ingroup subsampling + * \brief Subsample a point set by picking random vertices. + * + * \details It chooses `final_size` distinct points from a random access range `points` + * and outputs them to the output iterator `output_it`. + * Point_container::iterator should be ValueSwappable and RandomAccessIterator. + */ + + template + void pick_n_random_points(Point_container const &points, + unsigned final_size, + OutputIterator output_it) { +#ifdef GUDHI_SUBS_PROFILING + Gudhi::Clock t; +#endif + + unsigned nbP = boost::size(points); + assert(nbP >= final_size); + std::vector landmarks(nbP); + std::iota(landmarks.begin(), landmarks.end(), 0); + + std::random_device rd; + std::mt19937 g(rd()); + + std::shuffle(landmarks.begin(), landmarks.end(), g); + landmarks.resize(final_size); + + for (int l: landmarks) + *output_it++ = points[l]; + +#ifdef GUDHI_SUBS_PROFILING + t.end(); + std::cerr << "Random landmark choice took " << t.num_seconds() + << " seconds." << std::endl; +#endif + } + +} // namesapce subsampling + +} // namespace Gudhi + +#endif // PICK_RANDOM_POINTS_H_ diff --git a/src/Subsampling/include/gudhi/pick_random_points.h b/src/Subsampling/include/gudhi/pick_random_points.h deleted file mode 100644 index 732ae3f7..00000000 --- a/src/Subsampling/include/gudhi/pick_random_points.h +++ /dev/null @@ -1,82 +0,0 @@ -/* This file is part of the Gudhi Library. The Gudhi library - * (Geometric Understanding in Higher Dimensions) is a generic C++ - * library for computational topology. - * - * Author(s): Siargey Kachanovich - * - * Copyright (C) 2016 INRIA - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef PICK_RANDOM_POINTS_H_ -#define PICK_RANDOM_POINTS_H_ - -#include - -#include // random_device, mt19937 -#include // shuffle -#include // iota -#include -#include - - -namespace Gudhi { - -namespace subsampling { - - /** - * \ingroup subsampling - * \brief Subsample a point set by picking random vertices. - * - * \details It chooses `final_size` distinct points from a random access range `points` - * and outputs them to the output iterator `output_it`. - * Point_container::iterator should be ValueSwappable and RandomAccessIterator. - */ - - template - void pick_random_points(Point_container const &points, - unsigned final_size, - OutputIterator output_it) { -#ifdef GUDHI_SUBS_PROFILING - Gudhi::Clock t; -#endif - - unsigned nbP = boost::size(points); - assert(nbP >= final_size); - std::vector landmarks(nbP); - std::iota(landmarks.begin(), landmarks.end(), 0); - - std::random_device rd; - std::mt19937 g(rd()); - - std::shuffle(landmarks.begin(), landmarks.end(), g); - landmarks.resize(final_size); - - for (int l: landmarks) - *output_it++ = points[l]; - -#ifdef GUDHI_SUBS_PROFILING - t.end(); - std::cerr << "Random landmark choice took " << t.num_seconds() - << " seconds." << std::endl; -#endif - } - -} // namesapce subsampling - -} // namespace Gudhi - -#endif // PICK_RANDOM_POINTS_H_ diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 95241cd2..c9e48416 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -20,8 +20,8 @@ if(CGAL_FOUND) include( ${EIGEN3_USE_FILE} ) include_directories (BEFORE "../../include") - add_executable( Subsampling_test_pick_random_points test_pick_random_points.cpp ) - target_link_libraries(Subsampling_test_pick_random_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + 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}) add_executable( Subsampling_test_choose_n_farthest_points test_choose_n_farthest_points.cpp ) target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) diff --git a/src/Subsampling/test/test_pick_n_random_points.cpp b/src/Subsampling/test/test_pick_n_random_points.cpp new file mode 100644 index 00000000..6c8dbea2 --- /dev/null +++ b/src/Subsampling/test/test_pick_n_random_points.cpp @@ -0,0 +1,69 @@ +/* This file is part of the Gudhi Library. The Gudhi library + * (Geometric Understanding in Higher Dimensions) is a generic C++ + * library for computational topology. + * + * Author(s): Siargey Kachanovich + * + * Copyright (C) 2016 INRIA + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// #ifdef _DEBUG +// # define TBB_USE_THREADING_TOOL +// #endif + +#define BOOST_TEST_DYN_LINK +#define BOOST_TEST_MODULE Subsampling - test pick_n_random_points +#include + +#include +#include +#include + +#include + + +BOOST_AUTO_TEST_CASE(test_pick_n_random_points) +{ + typedef CGAL::Epick_d K; + typedef typename K::FT FT; + typedef typename K::Point_d Point_d; + + std::vector vect; + vect.push_back(Point_d(std::vector({0,0,0,0}))); + vect.push_back(Point_d(std::vector({0,0,0,1}))); + vect.push_back(Point_d(std::vector({0,0,1,0}))); + vect.push_back(Point_d(std::vector({0,0,1,1}))); + vect.push_back(Point_d(std::vector({0,1,0,0}))); + vect.push_back(Point_d(std::vector({0,1,0,1}))); + vect.push_back(Point_d(std::vector({0,1,1,0}))); + vect.push_back(Point_d(std::vector({0,1,1,1}))); + vect.push_back(Point_d(std::vector({1,0,0,0}))); + vect.push_back(Point_d(std::vector({1,0,0,1}))); + vect.push_back(Point_d(std::vector({1,0,1,0}))); + vect.push_back(Point_d(std::vector({1,0,1,1}))); + vect.push_back(Point_d(std::vector({1,1,0,0}))); + vect.push_back(Point_d(std::vector({1,1,0,1}))); + vect.push_back(Point_d(std::vector({1,1,1,0}))); + vect.push_back(Point_d(std::vector({1,1,1,1}))); + + std::vector results; + Gudhi::subsampling::pick_n_random_points(vect, 5, std::back_inserter(results)); + std::cout << "landmark vector contains: "; + for (auto l: results) + std::cout << l << "\n"; + + BOOST_CHECK(results.size() == 5); +} diff --git a/src/Subsampling/test/test_pick_random_points.cpp b/src/Subsampling/test/test_pick_random_points.cpp deleted file mode 100644 index 16841eff..00000000 --- a/src/Subsampling/test/test_pick_random_points.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* This file is part of the Gudhi Library. The Gudhi library - * (Geometric Understanding in Higher Dimensions) is a generic C++ - * library for computational topology. - * - * Author(s): Siargey Kachanovich - * - * Copyright (C) 2016 INRIA - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -// #ifdef _DEBUG -// # define TBB_USE_THREADING_TOOL -// #endif - -#define BOOST_TEST_DYN_LINK -#define BOOST_TEST_MODULE Subsampling - test pick_random_points -#include - -#include -#include -#include - -#include - - -BOOST_AUTO_TEST_CASE(test_pick_random_points) -{ - typedef CGAL::Epick_d K; - typedef typename K::FT FT; - typedef typename K::Point_d Point_d; - - std::vector vect; - vect.push_back(Point_d(std::vector({0,0,0,0}))); - vect.push_back(Point_d(std::vector({0,0,0,1}))); - vect.push_back(Point_d(std::vector({0,0,1,0}))); - vect.push_back(Point_d(std::vector({0,0,1,1}))); - vect.push_back(Point_d(std::vector({0,1,0,0}))); - vect.push_back(Point_d(std::vector({0,1,0,1}))); - vect.push_back(Point_d(std::vector({0,1,1,0}))); - vect.push_back(Point_d(std::vector({0,1,1,1}))); - vect.push_back(Point_d(std::vector({1,0,0,0}))); - vect.push_back(Point_d(std::vector({1,0,0,1}))); - vect.push_back(Point_d(std::vector({1,0,1,0}))); - vect.push_back(Point_d(std::vector({1,0,1,1}))); - vect.push_back(Point_d(std::vector({1,1,0,0}))); - vect.push_back(Point_d(std::vector({1,1,0,1}))); - vect.push_back(Point_d(std::vector({1,1,1,0}))); - vect.push_back(Point_d(std::vector({1,1,1,1}))); - - std::vector results; - Gudhi::subsampling::pick_random_points(vect, 5, std::back_inserter(results)); - std::cout << "landmark vector contains: "; - for (auto l: results) - std::cout << l << "\n"; - - BOOST_CHECK(results.size() == 5); -} diff --git a/src/Witness_complex/example/witness_complex_from_file.cpp b/src/Witness_complex/example/witness_complex_from_file.cpp index 0d82ee38..5e9f0e81 100644 --- a/src/Witness_complex/example/witness_complex_from_file.cpp +++ b/src/Witness_complex/example/witness_complex_from_file.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -87,7 +87,7 @@ int main(int argc, char * const argv[]) { // Choose landmarks start = clock(); std::vector > knn; - Gudhi::subsampling::pick_random_points(point_vector, 100, std::back_inserter(landmarks)); + Gudhi::subsampling::pick_n_random_points(point_vector, 100, std::back_inserter(landmarks)); Gudhi::witness_complex::construct_closest_landmark_table(point_vector, landmarks, knn); end = clock(); std::cout << "Landmark choice for " << nbL << " landmarks took " diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp index d0c4b4c4..e6f88274 100644 --- a/src/Witness_complex/example/witness_complex_sphere.cpp +++ b/src/Witness_complex/example/witness_complex_sphere.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -76,7 +76,7 @@ int main(int argc, char * const argv[]) { // Choose landmarks start = clock(); std::vector > knn; - Gudhi::subsampling::pick_random_points(point_vector, 100, std::back_inserter(landmarks)); + Gudhi::subsampling::pick_n_random_points(point_vector, 100, std::back_inserter(landmarks)); Gudhi::witness_complex::construct_closest_landmark_table(point_vector, landmarks, knn); // Compute witness complex diff --git a/src/Witness_complex/test/witness_complex_points.cpp b/src/Witness_complex/test/witness_complex_points.cpp index 596152f4..d40bbf14 100644 --- a/src/Witness_complex/test/witness_complex_points.cpp +++ b/src/Witness_complex/test/witness_complex_points.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(witness_complex_points) { bool b_print_output = false; // First test: random choice Simplex_tree complex1; - Gudhi::pick_random_points(points, 100, std::back_inserter(landmarks)); + Gudhi::subsampling::pick_n_random_points(points, 100, std::back_inserter(landmarks)); Gudhi::witness_complex::construct_closest_landmark_table(points, landmarks, knn); assert(!knn.empty()); WitnessComplex witnessComplex1(knn, 100, 3, complex1); -- cgit v1.2.3 From aa994dbd8dadfd4be416f13b13721e7e13c3623a Mon Sep 17 00:00:00 2001 From: cjamin Date: Thu, 22 Sep 2016 11:58:31 +0000 Subject: Require CGAL 4.8.1 (furthest neighbor is bugged before) See https://github.com/CGAL/cgal/pull/1105 git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1536 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fc980f30c107b39f8a47e18deb23820b411a9201 --- src/Subsampling/example/CMakeLists.txt | 4 ++-- src/Subsampling/test/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index 4710cf00..6bf717f7 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.6) project(Subsampling_examples) if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) + if (NOT CGAL_VERSION VERSION_LESS 4.8.1) message(STATUS "CGAL version: ${CGAL_VERSION}.") find_package(Eigen3 3.1.0) @@ -22,7 +22,7 @@ if(CGAL_FOUND) message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling examples. Version 4.8.0 is required.") + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling examples. Version 4.8.1 is required.") endif () else() message(WARNING "CGAL not found. It is required for the Subsampling examples.") diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index c9e48416..72de5ac7 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -11,7 +11,7 @@ if (GPROF_PATH) endif() if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) + if (NOT CGAL_VERSION VERSION_LESS 4.8.1) message(STATUS "CGAL version: ${CGAL_VERSION}.") find_package(Eigen3 3.1.0) @@ -32,7 +32,7 @@ if(CGAL_FOUND) message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling tests. Version 4.8.0 is required.") + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling tests. Version 4.8.1 is required.") endif () else() message(WARNING "CGAL not found. It is required for the Subsampling tests.") -- cgit v1.2.3 From 39a0577d06d7d5349a08a64e4a73d0eaf67e6d1c Mon Sep 17 00:00:00 2001 From: cjamin Date: Thu, 22 Sep 2016 15:27:44 +0000 Subject: Clean-up CMakeLists.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1541 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3204fef66b8a8358820531f8d6d2494c96a7226e --- src/Spatial_searching/example/CMakeLists.txt | 5 ----- src/Spatial_searching/test/CMakeLists.txt | 4 ---- src/Subsampling/example/CMakeLists.txt | 15 ++++----------- src/Subsampling/test/CMakeLists.txt | 9 ++------- 4 files changed, 6 insertions(+), 27 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Spatial_searching/example/CMakeLists.txt b/src/Spatial_searching/example/CMakeLists.txt index 0c41d56c..3c3970d8 100644 --- a/src/Spatial_searching/example/CMakeLists.txt +++ b/src/Spatial_searching/example/CMakeLists.txt @@ -5,12 +5,7 @@ if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) message(STATUS "CGAL version: ${CGAL_VERSION}.") - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") - add_executable( Spatial_searching_example_spatial_searching example_spatial_searching.cpp ) target_link_libraries(Spatial_searching_example_spatial_searching ${CGAL_LIBRARY}) else() diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt index ed61cc64..0f2c5ae4 100644 --- a/src/Spatial_searching/test/CMakeLists.txt +++ b/src/Spatial_searching/test/CMakeLists.txt @@ -14,11 +14,7 @@ if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) message(STATUS "CGAL version: ${CGAL_VERSION}.") - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") add_executable( Spatial_searching_test_Kd_tree_search test_Kd_tree_search.cpp ) target_link_libraries(Spatial_searching_test_Kd_tree_search diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index 6bf717f7..81b39d6e 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -5,19 +5,12 @@ if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) message(STATUS "CGAL version: ${CGAL_VERSION}.") - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") - add_executable( Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp ) - - add_executable( Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp ) - #target_link_libraries(Subsampling_example_choose_n_farthest_points ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - - add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) - target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp) + add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp) + add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) + target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY}) else() message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") endif() diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 72de5ac7..91d4ed8f 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -14,18 +14,13 @@ if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) message(STATUS "CGAL version: ${CGAL_VERSION}.") - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") - 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}) add_executable( Subsampling_test_choose_n_farthest_points test_choose_n_farthest_points.cpp ) - target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - + target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable(Subsampling_test_sparsify_point_set test_sparsify_point_set.cpp) target_link_libraries(Subsampling_test_sparsify_point_set ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) else() -- cgit v1.2.3 From a1d8a8b08002d7d2067b76b7109cae4c20618540 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 6 Oct 2016 10:50:47 +0000 Subject: Add unitary tests in make test target Fix doxygen warning fix compilation warning (typedef not used) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/subsampling_and_spatialsearching@1652 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d080543ea90aa089e2f09933a44156f07ae82eb4 --- src/Spatial_searching/example/CMakeLists.txt | 12 +++--------- src/Spatial_searching/test/CMakeLists.txt | 13 ++++--------- src/Subsampling/doc/Intro_subsampling.h | 2 +- src/Subsampling/example/CMakeLists.txt | 22 ++++++++++------------ .../example/example_sparsify_point_set.cpp | 1 - src/Subsampling/test/CMakeLists.txt | 20 ++++++++++++-------- src/Subsampling/test/test_sparsify_point_set.cpp | 1 - 7 files changed, 30 insertions(+), 41 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/src/Spatial_searching/example/CMakeLists.txt b/src/Spatial_searching/example/CMakeLists.txt index 3c3970d8..6238a0ec 100644 --- a/src/Spatial_searching/example/CMakeLists.txt +++ b/src/Spatial_searching/example/CMakeLists.txt @@ -3,17 +3,11 @@ project(Spatial_searching_examples) if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - if (EIGEN3_FOUND) add_executable( Spatial_searching_example_spatial_searching example_spatial_searching.cpp ) target_link_libraries(Spatial_searching_example_spatial_searching ${CGAL_LIBRARY}) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for the Tangential_complex examples.") + add_test(Spatial_searching_example_spatial_searching + ${CMAKE_CURRENT_BINARY_DIR}/Spatial_searching_example_spatial_searching) endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Spatial_searching examples. Version 4.8.1 is required.") - endif () -else() - message(WARNING "CGAL not found. It is required for the Spatial_searching examples.") + endif() endif() diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt index 0f2c5ae4..2c685c72 100644 --- a/src/Spatial_searching/test/CMakeLists.txt +++ b/src/Spatial_searching/test/CMakeLists.txt @@ -12,19 +12,14 @@ endif() if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - if (EIGEN3_FOUND) - 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}) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for the Spatial_searching tests.") + + 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) endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling tests. Version 4.8.1 is required.") endif () -else() - message(WARNING "CGAL not found. It is required for the Spatial_searching tests.") endif() diff --git a/src/Subsampling/doc/Intro_subsampling.h b/src/Subsampling/doc/Intro_subsampling.h index f8eb2fdd..c84616dd 100644 --- a/src/Subsampling/doc/Intro_subsampling.h +++ b/src/Subsampling/doc/Intro_subsampling.h @@ -34,7 +34,7 @@ namespace subsampling { * * @{ * - * \section introduction Introduction + * \section subsamplingintroduction Introduction * * This Gudhi component offers methods to subsample a set of points. * diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index 81b39d6e..54349f0c 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -3,20 +3,18 @@ project(Subsampling_examples) if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - if (EIGEN3_FOUND) + add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp) + add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp) + add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) + target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY}) - add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp) - add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp) - add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) - target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY}) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") + 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) endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling examples. Version 4.8.1 is required.") endif () -else() - message(WARNING "CGAL not found. It is required for the Subsampling examples.") endif() diff --git a/src/Subsampling/example/example_sparsify_point_set.cpp b/src/Subsampling/example/example_sparsify_point_set.cpp index ccf83bc0..ad68b4c1 100644 --- a/src/Subsampling/example/example_sparsify_point_set.cpp +++ b/src/Subsampling/example/example_sparsify_point_set.cpp @@ -9,7 +9,6 @@ int main (void) { typedef CGAL::Epick_d > K; - typedef typename K::FT FT; typedef typename K::Point_d Point_d; CGAL::Random rd; diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt index 91d4ed8f..3a2fb649 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -12,8 +12,6 @@ endif() if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - if (EIGEN3_FOUND) 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}) @@ -23,12 +21,18 @@ if(CGAL_FOUND) 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}) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Subsampling feature.") + + 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) endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Subsampling tests. Version 4.8.1 is required.") endif () -else() - message(WARNING "CGAL not found. It is required for the Subsampling tests.") endif() diff --git a/src/Subsampling/test/test_sparsify_point_set.cpp b/src/Subsampling/test/test_sparsify_point_set.cpp index 04a055ff..f993d6d6 100644 --- a/src/Subsampling/test/test_sparsify_point_set.cpp +++ b/src/Subsampling/test/test_sparsify_point_set.cpp @@ -35,7 +35,6 @@ BOOST_AUTO_TEST_CASE(test_sparsify_point_set) { typedef CGAL::Epick_d > K; - typedef typename K::FT FT; typedef typename K::Point_d Point_d; CGAL::Random rd; -- cgit v1.2.3 From 70960dc646b6cfa396584ab4997aeef76424154d Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 24 Mar 2017 23:13:48 +0000 Subject: Workaround for CGAL version 4.8 compilation issue New target CGAL_WITH_EIGEN3_VERSION set with CGAL_VERSION when CGAL and Eigen3 found to ease CMakeLists.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cgal_4.8_issue@2241 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 2fbf1f9397aa1549ba05aa26ac6852b882dce147 --- data/points/generator/CMakeLists.txt | 26 ++++------ src/Alpha_complex/example/CMakeLists.txt | 50 +++++++++--------- src/Alpha_complex/test/CMakeLists.txt | 28 +++++----- src/Bottleneck_distance/benchmark/CMakeLists.txt | 17 +++---- src/Bottleneck_distance/example/CMakeLists.txt | 32 +++++------- src/Bottleneck_distance/test/CMakeLists.txt | 26 ++++------ src/GudhUI/CMakeLists.txt | 6 ++- src/Persistent_cohomology/example/CMakeLists.txt | 46 ++++++++--------- src/Spatial_searching/test/CMakeLists.txt | 20 +++----- src/Subsampling/example/CMakeLists.txt | 30 +++++------ src/Subsampling/test/CMakeLists.txt | 38 +++++++------- src/Tangential_complex/benchmark/CMakeLists.txt | 22 +++----- src/Tangential_complex/example/CMakeLists.txt | 32 +++++------- src/Tangential_complex/test/CMakeLists.txt | 28 ++++------ src/Witness_complex/example/CMakeLists.txt | 62 +++++++++++------------ src/Witness_complex/test/CMakeLists.txt | 28 +++++----- src/cmake/modules/GUDHI_third_party_libraries.txt | 23 ++++++++- src/common/doc/main_page.h | 32 ++++++++++-- src/common/example/CMakeLists.txt | 14 +++-- src/cython/CMakeLists.txt | 17 +++---- 20 files changed, 276 insertions(+), 301 deletions(-) (limited to 'src/Subsampling/test/CMakeLists.txt') diff --git a/data/points/generator/CMakeLists.txt b/data/points/generator/CMakeLists.txt index f559610c..9a7f7bce 100644 --- a/data/points/generator/CMakeLists.txt +++ b/data/points/generator/CMakeLists.txt @@ -1,18 +1,14 @@ cmake_minimum_required(VERSION 2.6) project(Data_points_generator) -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.6.0) - if (EIGEN3_FOUND) - 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) - # 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) - endif(EIGEN3_FOUND) - endif(NOT CGAL_VERSION VERSION_LESS 4.6.0) -endif(CGAL_FOUND) +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) + # 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) +endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index 71a95d61..b9bcdb55 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -2,32 +2,28 @@ cmake_minimum_required(VERSION 2.6) project(Alpha_complex_examples) # need CGAL 4.7 -# cmake -DCGAL_DIR=~/workspace/CGAL-4.7-Ic-41 ../../.. -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - if (EIGEN3_FOUND) - 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}) - if (TBB_FOUND) - target_link_libraries(alphapoints ${TBB_LIBRARIES}) - target_link_libraries(alphaoffreader ${TBB_LIBRARIES}) - endif() +# 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}) + if (TBB_FOUND) + target_link_libraries(alphapoints ${TBB_LIBRARIES}) + target_link_libraries(alphaoffreader ${TBB_LIBRARIES}) + endif() - add_test(alphapoints ${CMAKE_CURRENT_BINARY_DIR}/alphapoints) - # 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) - 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(alphapoints ${CMAKE_CURRENT_BINARY_DIR}/alphapoints) + # 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) + 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) - endif() - endif(EIGEN3_FOUND) - endif(NOT CGAL_VERSION VERSION_LESS 4.7.0) -endif(CGAL_FOUND) + 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) + 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 efc0565f..32091196 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -10,23 +10,19 @@ if (GPROF_PATH) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - if (EIGEN3_FOUND) - 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}) - if (TBB_FOUND) - target_link_libraries(AlphaComplexUT ${TBB_LIBRARIES}) - endif() +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}) + if (TBB_FOUND) + target_link_libraries(AlphaComplexUT ${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}/) + # 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) + 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) - endif(EIGEN3_FOUND) - endif (NOT CGAL_VERSION VERSION_LESS 4.7.0) -endif(CGAL_FOUND) +endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) diff --git a/src/Bottleneck_distance/benchmark/CMakeLists.txt b/src/Bottleneck_distance/benchmark/CMakeLists.txt index c99e0373..170081ce 100644 --- a/src/Bottleneck_distance/benchmark/CMakeLists.txt +++ b/src/Bottleneck_distance/benchmark/CMakeLists.txt @@ -1,14 +1,9 @@ cmake_minimum_required(VERSION 2.6) project(Bottleneck_distance_benchmark) - -# requires CGAL 4.8 -# cmake -DCGAL_DIR=~/workspace/CGAL-4.8 ../../.. -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - add_executable ( bottleneck_chrono bottleneck_chrono.cpp ) - if (TBB_FOUND) - target_link_libraries(bottleneck_chrono ${TBB_LIBRARIES}) - endif(TBB_FOUND) - endif () -endif() +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + add_executable ( bottleneck_chrono bottleneck_chrono.cpp ) + if (TBB_FOUND) + target_link_libraries(bottleneck_chrono ${TBB_LIBRARIES}) + endif(TBB_FOUND) +endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Bottleneck_distance/example/CMakeLists.txt b/src/Bottleneck_distance/example/CMakeLists.txt index 55f22c01..b0a19f8b 100644 --- a/src/Bottleneck_distance/example/CMakeLists.txt +++ b/src/Bottleneck_distance/example/CMakeLists.txt @@ -1,24 +1,20 @@ cmake_minimum_required(VERSION 2.6) project(Bottleneck_distance_examples) -# requires CGAL 4.8 -# cmake -DCGAL_DIR=~/workspace/CGAL-4.8 ../../.. -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - add_executable (bottleneck_read_file_example bottleneck_read_file_example.cpp) - add_executable (bottleneck_basic_example bottleneck_basic_example.cpp) +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_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) - target_link_libraries(bottleneck_read_file_example ${TBB_LIBRARIES}) - 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_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) + target_link_libraries(bottleneck_read_file_example ${TBB_LIBRARIES}) + 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) - endif () -endif() +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 3e61f4cf..3d8e1f95 100644 --- a/src/Bottleneck_distance/test/CMakeLists.txt +++ b/src/Bottleneck_distance/test/CMakeLists.txt @@ -11,19 +11,15 @@ if (GPROF_PATH) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() -# requires CGAL 4.8 -# cmake -DCGAL_DIR=~/workspace/CGAL-4.8 ../../.. -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - add_executable ( bottleneckUT bottleneck_unit_test.cpp ) - target_link_libraries(bottleneckUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - if (TBB_FOUND) - target_link_libraries(bottleneckUT ${TBB_LIBRARIES}) - endif(TBB_FOUND) +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}) + if (TBB_FOUND) + target_link_libraries(bottleneckUT ${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) - endif () -endif() + # 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) +endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt index 64429baa..ca2e47c1 100644 --- a/src/GudhUI/CMakeLists.txt +++ b/src/GudhUI/CMakeLists.txt @@ -5,6 +5,10 @@ find_package(Qt5 COMPONENTS Widgets Xml OpenGL) find_package(QGLViewer) find_package(OpenGL) +if (CGAL_VERSION VERSION_EQUAL 4.8.0) + message(ERROR " GudhUI does not compile with CGAL 4.8.0. 4.8.1, 4.8.2 and 4.9 are OK.") +endif() + if (NOT CGAL_FOUND) message(ERROR " GudhUI requires CGAL and will not be compiled.") endif() @@ -23,7 +27,7 @@ endif() -if ( CGAL_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND ) +if ( CGAL_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND AND NOT CGAL_VERSION VERSION_EQUAL 4.8.0) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index 20700d86..a6b698c3 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -81,28 +81,26 @@ if(CGAL_FOUND) ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.weights 2 0.45) - if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - if (EIGEN3_FOUND) - add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) - target_link_libraries(alpha_complex_persistence - ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) - - add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp) - target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - - add_executable(custom_persistence_sort custom_persistence_sort.cpp) - target_link_libraries(custom_persistence_sort ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - - if (TBB_FOUND) - target_link_libraries(alpha_complex_persistence ${TBB_LIBRARIES}) - target_link_libraries(periodic_alpha_complex_3d_persistence ${TBB_LIBRARIES}) - target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES}) - endif(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) - endif(EIGEN3_FOUND) - endif (NOT CGAL_VERSION VERSION_LESS 4.7.0) + if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) + add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) + target_link_libraries(alpha_complex_persistence + ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) + + add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp) + target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) + + add_executable(custom_persistence_sort custom_persistence_sort.cpp) + target_link_libraries(custom_persistence_sort ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) + + if (TBB_FOUND) + target_link_libraries(alpha_complex_persistence ${TBB_LIBRARIES}) + target_link_libraries(periodic_alpha_complex_3d_persistence ${TBB_LIBRARIES}) + target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES}) + endif(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) + endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) endif(CGAL_FOUND) diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt index 2c685c72..bdc95e4a 100644 --- a/src/Spatial_searching/test/CMakeLists.txt +++ b/src/Spatial_searching/test/CMakeLists.txt @@ -10,16 +10,12 @@ if (GPROF_PATH) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - if (EIGEN3_FOUND) - 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}) +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + 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) - endif() - endif () -endif() + 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) +endif () diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt index 0fd3335c..bb043297 100644 --- a/src/Subsampling/example/CMakeLists.txt +++ b/src/Subsampling/example/CMakeLists.txt @@ -1,21 +1,17 @@ cmake_minimum_required(VERSION 2.6) project(Subsampling_examples) -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - if (EIGEN3_FOUND) - add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp) - add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp) - add_executable(Subsampling_example_custom_kernel example_custom_kernel.cpp) - add_executable(Subsampling_example_sparsify_point_set example_sparsify_point_set.cpp) - target_link_libraries(Subsampling_example_sparsify_point_set ${CGAL_LIBRARY}) +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp) + add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp) + add_executable(Subsampling_example_custom_kernel example_custom_kernel.cpp) + 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) - endif() - endif () -endif() + 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) +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 3a2fb649..5517fe9d 100644 --- a/src/Subsampling/test/CMakeLists.txt +++ b/src/Subsampling/test/CMakeLists.txt @@ -10,29 +10,25 @@ if (GPROF_PATH) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - if (EIGEN3_FOUND) - 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}) +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + 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}) - add_executable( Subsampling_test_choose_n_farthest_points test_choose_n_farthest_points.cpp ) - target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable( Subsampling_test_choose_n_farthest_points test_choose_n_farthest_points.cpp ) + target_link_libraries(Subsampling_test_choose_n_farthest_points ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - 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_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_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_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) - endif() - endif () -endif() + 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) +endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) diff --git a/src/Tangential_complex/benchmark/CMakeLists.txt b/src/Tangential_complex/benchmark/CMakeLists.txt index 788c2b4d..ef772be8 100644 --- a/src/Tangential_complex/benchmark/CMakeLists.txt +++ b/src/Tangential_complex/benchmark/CMakeLists.txt @@ -1,17 +1,11 @@ cmake_minimum_required(VERSION 2.6) project(Tangential_complex_benchmark) -# need CGAL 4.8 -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - if (EIGEN3_FOUND) - add_executable(Tangential_complex_benchmark benchmark_tc.cpp) - target_link_libraries(Tangential_complex_benchmark - ${Boost_DATE_TIME_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - if (TBB_FOUND) - target_link_libraries(Tangential_complex_benchmark ${TBB_LIBRARIES}) - endif(TBB_FOUND) - endif(EIGEN3_FOUND) - endif (NOT CGAL_VERSION VERSION_LESS 4.8.0) -endif(CGAL_FOUND) - +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + add_executable(Tangential_complex_benchmark benchmark_tc.cpp) + target_link_libraries(Tangential_complex_benchmark + ${Boost_DATE_TIME_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) + if (TBB_FOUND) + target_link_libraries(Tangential_complex_benchmark ${TBB_LIBRARIES}) + endif(TBB_FOUND) +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 a75ccd5b..47a56e3b 100644 --- a/src/Tangential_complex/example/CMakeLists.txt +++ b/src/Tangential_complex/example/CMakeLists.txt @@ -1,23 +1,19 @@ cmake_minimum_required(VERSION 2.6) project(Tangential_complex_examples) -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - if (EIGEN3_FOUND) - add_executable( Tangential_complex_example_basic example_basic.cpp ) - target_link_libraries(Tangential_complex_example_basic ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) - add_executable( Tangential_complex_example_with_perturb example_with_perturb.cpp ) - target_link_libraries(Tangential_complex_example_with_perturb ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) - if (TBB_FOUND) - target_link_libraries(Tangential_complex_example_basic ${TBB_LIBRARIES}) - target_link_libraries(Tangential_complex_example_with_perturb ${TBB_LIBRARIES}) - endif(TBB_FOUND) +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + add_executable( Tangential_complex_example_basic example_basic.cpp ) + target_link_libraries(Tangential_complex_example_basic ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) + add_executable( Tangential_complex_example_with_perturb example_with_perturb.cpp ) + target_link_libraries(Tangential_complex_example_with_perturb ${CGAL_LIBRARY} ${Boost_DATE_TIME_LIBRARY}) + if (TBB_FOUND) + target_link_libraries(Tangential_complex_example_basic ${TBB_LIBRARIES}) + 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_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) - endif(EIGEN3_FOUND) - endif(NOT CGAL_VERSION VERSION_LESS 4.8.0) -endif(CGAL_FOUND) + add_test(Tangential_complex_example_with_perturb + ${CMAKE_CURRENT_BINARY_DIR}/Tangential_complex_example_with_perturb) +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 075028c8..b2bf5dd7 100644 --- a/src/Tangential_complex/test/CMakeLists.txt +++ b/src/Tangential_complex/test/CMakeLists.txt @@ -10,22 +10,14 @@ if (GPROF_PATH) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1) + 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) - 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) - - endif() - endif () -endif() \ No newline at end of file +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 9990c541..549a85be 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -9,40 +9,36 @@ endif() add_test(Witness_complex_test_nearest_landmark_table Witness_complex_example_nearest_landmark_table) # CGAL and Eigen3 are required for Euclidean version of Witness -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.6.0) - if (EIGEN3_FOUND) - add_executable( Witness_complex_example_off example_witness_complex_off.cpp ) - target_link_libraries(Witness_complex_example_off ${Boost_SYSTEM_LIBRARY}) - add_executable( Witness_complex_example_strong_off example_strong_witness_complex_off.cpp ) - target_link_libraries(Witness_complex_example_strong_off ${Boost_SYSTEM_LIBRARY}) - add_executable ( Witness_complex_example_sphere example_witness_complex_sphere.cpp ) - target_link_libraries(Witness_complex_example_sphere ${Boost_SYSTEM_LIBRARY}) +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) + add_executable( Witness_complex_example_off example_witness_complex_off.cpp ) + target_link_libraries(Witness_complex_example_off ${Boost_SYSTEM_LIBRARY}) + add_executable( Witness_complex_example_strong_off example_strong_witness_complex_off.cpp ) + target_link_libraries(Witness_complex_example_strong_off ${Boost_SYSTEM_LIBRARY}) + add_executable ( Witness_complex_example_sphere example_witness_complex_sphere.cpp ) + target_link_libraries(Witness_complex_example_sphere ${Boost_SYSTEM_LIBRARY}) - add_executable ( Witness_complex_example_witness_persistence example_witness_complex_persistence.cpp ) - target_link_libraries(Witness_complex_example_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) + add_executable ( Witness_complex_example_witness_persistence example_witness_complex_persistence.cpp ) + target_link_libraries(Witness_complex_example_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) - add_executable ( Witness_complex_example_strong_witness_persistence example_strong_witness_persistence.cpp ) - target_link_libraries(Witness_complex_example_strong_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) + add_executable ( Witness_complex_example_strong_witness_persistence example_strong_witness_persistence.cpp ) + target_link_libraries(Witness_complex_example_strong_witness_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) - if (TBB_FOUND) - target_link_libraries(Witness_complex_example_witness_persistence ${TBB_LIBRARIES}) - target_link_libraries(Witness_complex_example_strong_witness_persistence ${TBB_LIBRARIES}) - endif() + if (TBB_FOUND) + target_link_libraries(Witness_complex_example_witness_persistence ${TBB_LIBRARIES}) + 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) - endif(EIGEN3_FOUND) - endif (NOT CGAL_VERSION VERSION_LESS 4.6.0) -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) +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 12b3be56..e73f9c3a 100644 --- a/src/Witness_complex/test/CMakeLists.txt +++ b/src/Witness_complex/test/CMakeLists.txt @@ -23,20 +23,16 @@ add_test(NAME simple_witness_complex --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_simple_witness_complexUT.xml --log_level=test_suite --report_level=no) # CGAL and Eigen3 are required for Euclidean version of Witness -if(CGAL_FOUND) - if (NOT CGAL_VERSION VERSION_LESS 4.6.0) - if (EIGEN3_FOUND) - add_executable ( Witness_complex_test_euclidean_simple_witness_complex test_euclidean_simple_witness_complex.cpp ) - target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) - if (TBB_FOUND) - target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${TBB_LIBRARIES}) - endif(TBB_FOUND) +if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) + add_executable ( Witness_complex_test_euclidean_simple_witness_complex test_euclidean_simple_witness_complex.cpp ) + target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + if (TBB_FOUND) + 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) - endif(EIGEN3_FOUND) - endif (NOT CGAL_VERSION VERSION_LESS 4.6.0) -endif() + # 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) +endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) diff --git a/src/cmake/modules/GUDHI_third_party_libraries.txt b/src/cmake/modules/GUDHI_third_party_libraries.txt index 1a2b510f..75f73537 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.txt +++ b/src/cmake/modules/GUDHI_third_party_libraries.txt @@ -24,6 +24,7 @@ endif() # 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.") @@ -34,6 +35,25 @@ if(CGAL_FOUND) 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 @@ -50,11 +70,12 @@ if (TBB_FOUND) 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} ) - #include_directories (BEFORE "../../include") + set(CGAL_WITH_EIGEN3_VERSION ${CGAL_VERSION}) endif (EIGEN3_FOUND) # Required programs for unitary tests purpose diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 593faea5..e6f29fa8 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -122,7 +122,7 @@ Author: Clément Jamin
Introduced in: GUDHI 2.0.0
Copyright: GPL v3
- Requires: \ref cgal ≥ 4.8.0 and \ref eigen3 + Requires: \ref cgal ≥ 4.8.1 and \ref eigen3 A Tangential Delaunay complex is a simplicial complex @@ -161,7 +161,7 @@ Author: François Godi
Introduced in: GUDHI 2.0.0
Copyright: GPL v3
- Requires: \ref cgal ≥ 4.8.0 and \ref eigen3 + Requires: \ref cgal ≥ 4.8.1 and \ref eigen3 Bottleneck distance measures the similarity between two persistence diagrams. @@ -297,11 +297,27 @@ make doxygen * \li * Persistent_cohomology/custom_persistence_sort.cpp * - * The following example requires CGAL version ≥ 4.8.0: - * \li + * The following example requires CGAL version ≥ 4.8.1: + * \li + * Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp.cpp + * \li * Bottleneck_distance/bottleneck_basic_example.cpp - * \li + * \li * Bottleneck_distance/bottleneck_read_file_example.cpp + * \li + * Spatial_searching/example_spatial_searching.cpp + * \li + * Subsampling/example_choose_n_farthest_points.cpp + * \li + * Subsampling/example_custom_kernel.cpp + * \li + * Subsampling/example_pick_n_random_points.cpp + * \li + * Subsampling/example_sparsify_point_set.cpp + * \li + * Tangential_complex/example_basic.cpp + * \li + * Tangential_complex/example_with_perturb.cpp * * \subsection eigen3 Eigen3 * The \ref alpha_complex data structure and few examples requires @@ -405,6 +421,7 @@ make doxygen /*! @file Examples * @example Alpha_complex/Alpha_complex_from_off.cpp * @example Alpha_complex/Alpha_complex_from_points.cpp + * @example Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp * @example Bottleneck_distance/bottleneck_basic_example.cpp * @example Bottleneck_distance/bottleneck_read_file_example.cpp * @example Bitmap_cubical_complex/Bitmap_cubical_complex.cpp @@ -437,6 +454,11 @@ make doxygen * @example Skeleton_blocker/Skeleton_blocker_from_simplices.cpp * @example Skeleton_blocker/Skeleton_blocker_iteration.cpp * @example Skeleton_blocker/Skeleton_blocker_link.cpp + * @example Spatial_searching/example_spatial_searching.cpp + * @example Subsampling/example_choose_n_farthest_points.cpp + * @example Subsampling/example_custom_kernel.cpp + * @example Subsampling/example_pick_n_random_points.cpp + * @example Subsampling/example_sparsify_point_set.cpp * @example Tangential_complex/example_basic.cpp * @example Tangential_complex/example_with_perturb.cpp * @example Witness_complex/example_nearest_landmark_table.cpp diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index b0c6d69a..61c94391 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -10,12 +10,10 @@ if(CGAL_FOUND) 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) - # need CGAL 4.7 - if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - if (EIGEN3_FOUND) - 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) - endif(EIGEN3_FOUND) - endif (NOT CGAL_VERSION VERSION_LESS 4.7.0) + # 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) + endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) endif() diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt index 25cf952e..2131505d 100644 --- a/src/cython/CMakeLists.txt +++ b/src/cython/CMakeLists.txt @@ -90,21 +90,16 @@ if(PYTHON_PATH AND CYTHON_PATH) file(COPY "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/doc/") if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - # If CGAL_VERSION >= 4.8.1, include subsampling - # CGAL things are done in CGAL_VERSION >= 4.8.0 - set(GUDHI_CYTHON_SUBSAMPLING "include 'cython/subsampling.pyx'") + # If CGAL_VERSION >= 4.8.1, include subsampling + set(GUDHI_CYTHON_SUBSAMPLING "include 'cython/subsampling.pyx'") + set(GUDHI_CYTHON_TANGENTIAL_COMPLEX "include 'cython/tangential_complex.pyx'") + set(GUDHI_CYTHON_BOTTLENECK_DISTANCE "include 'cython/bottleneck_distance.pyx'") else (NOT CGAL_VERSION VERSION_LESS 4.8.1) - # Remove alpha complex unitary tests + # Remove subsampling unitary tests file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test/test_subsampling.py) file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/doc/subsampling_ref.rst") file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/doc/subsampling_sum.rst") file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/doc/subsampling_user.rst") - endif (NOT CGAL_VERSION VERSION_LESS 4.8.1) - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - # If CGAL_VERSION >= 4.8.0, include tangential complex - set(GUDHI_CYTHON_TANGENTIAL_COMPLEX "include 'cython/tangential_complex.pyx'") - set(GUDHI_CYTHON_BOTTLENECK_DISTANCE "include 'cython/bottleneck_distance.pyx'") - else (NOT CGAL_VERSION VERSION_LESS 4.8.0) # Remove tangential complex and bottleneck unitary tests file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test/test_tangential_complex.py) file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test/test_bottleneck_distance.py) @@ -114,7 +109,7 @@ if(PYTHON_PATH AND CYTHON_PATH) file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/doc/tangential_complex_ref.rst") file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/doc/tangential_complex_sum.rst") file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/doc/tangential_complex_user.rst") - endif (NOT CGAL_VERSION VERSION_LESS 4.8.0) + endif (NOT CGAL_VERSION VERSION_LESS 4.8.1) if (NOT CGAL_VERSION VERSION_LESS 4.7.0) # If CGAL_VERSION >= 4.7.0, include alpha set(GUDHI_CYTHON_ALPHA_COMPLEX "include 'cython/alpha_complex.pyx'") -- cgit v1.2.3