diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-18 14:49:07 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-18 14:49:07 +0000 |
commit | 669459903831d01ac1399c2d0fd2111d00392a1b (patch) | |
tree | e073865b8245272626a5066ea9524a01d4f5a170 /src | |
parent | 4f18bf5115955c764f4eb15cd600a776f1a4d9ce (diff) | |
parent | d7c885fc4eaa06be6e6b57b8c3bd622b82a20c77 (diff) |
Backmerge of last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@625 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 8729c94e37923be0bbf943513025e7362807f041
Diffstat (limited to 'src')
27 files changed, 463 insertions, 364 deletions
diff --git a/src/Bottleneck/include/gudhi/Persistence_diagrams_graph.h b/src/Bottleneck/include/gudhi/Persistence_diagrams_graph.h index 7e278209..73ad940b 100644 --- a/src/Bottleneck/include/gudhi/Persistence_diagrams_graph.h +++ b/src/Bottleneck/include/gudhi/Persistence_diagrams_graph.h @@ -34,7 +34,7 @@ namespace Gudhi { namespace bottleneck { // Diagram_point is the type of the persistence diagram's points -typedef typename std::pair<double, double> Diagram_point; +typedef std::pair<double, double> Diagram_point; // Return the used index for encoding none of the points int null_point_index(); @@ -81,7 +81,7 @@ Persistence_diagrams_graph::Persistence_diagrams_graph(Persistence_diagram1& dia swap(u, v); } -Persistence_diagrams_graph::Persistence_diagrams_graph::Persistence_diagrams_graph() +Persistence_diagrams_graph::Persistence_diagrams_graph() : u(), v() { } inline bool Persistence_diagrams_graph::on_the_u_diagonal(int u_point_index) const { @@ -108,7 +108,7 @@ inline double Persistence_diagrams_graph::distance(int u_point_index, int v_poin return 0; Diagram_point p_u = get_u_point(u_point_index); Diagram_point p_v = get_v_point(v_point_index); - return std::max(std::fabs(p_u.first - p_v.first), std::fabs(p_u.second - p_v.second)); + return (std::max)(std::fabs(p_u.first - p_v.first), std::fabs(p_u.second - p_v.second)); } inline int Persistence_diagrams_graph::size() const { diff --git a/src/Bottleneck/test/CMakeLists.txt b/src/Bottleneck/test/CMakeLists.txt index 7044372e..3dfd80cd 100644 --- a/src/Bottleneck/test/CMakeLists.txt +++ b/src/Bottleneck/test/CMakeLists.txt @@ -1,21 +1,25 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIBottleneckUnitTest) +project(GUDHIBottleneckUT) -if(NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --coverage") +if (GCOVR_PATH) + # for gcovr to make coverage reports - Corbera Jenkins plugin + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage") +endif() +if (GPROF_PATH) + # for gprof to make coverage reports - Jenkins + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg") endif() -add_executable ( BottleneckUnitTest bottleneck_unit_test.cpp ) -target_link_libraries(BottleneckUnitTest ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( BottleneckUT bottleneck_unit_test.cpp ) +target_link_libraries(BottleneckUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) # Unitary tests -add_test(BottleneckUnitTest ${CMAKE_CURRENT_BINARY_DIR}/BottleneckUnitTest) - -if (LCOV_PATH) - # Lcov code coverage of unitary test - add_test(src/Bottleneck/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Bottleneck) -endif() +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) -cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Bottleneck/include/gudhi") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2271efd..7b30f77a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,25 +10,32 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif() if(MSVC) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018") else() - list(APPEND CMAKE_CXX_FLAGS "-std=c++11") -endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +endif() -# BOOST ISSUE result_of vs C++11 -add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) +set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_RUNTIME OFF) -find_package(Boost) +find_package(Boost) find_package(GMP) if(GMP_FOUND) - find_package(GMPXX) + find_package(GMPXX) endif() + find_package(CGAL) if(NOT Boost_FOUND) message(FATAL_ERROR "NOTICE: This demo requires Boost and will not be compiled.") else() - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + # BOOST ISSUE result_of vs C++11 + add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) + # BOOST ISSUE with Libraries name resolution under Windows + add_definitions(-DBOOST_ALL_NO_LIB) + + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) include_directories(include/) @@ -41,4 +48,10 @@ else() add_subdirectory(example/Alpha_complex) add_subdirectory(example/Bottleneck) + # GudhUI + add_subdirectory(GudhUI) + + # data points generator + add_subdirectory(data/points/generator) + endif() diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp index 5b178ff9..a41f65aa 100644 --- a/src/Contraction/example/Garland_heckbert.cpp +++ b/src/Contraction/example/Garland_heckbert.cpp @@ -7,7 +7,7 @@ * * Author(s): David Salinas * - * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France) + * Copyright (C) 2014 INRIA Sophia Antipolis-M�diterran�e (France) * * 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 @@ -42,72 +42,70 @@ using namespace Gudhi; using namespace skbl; using namespace contraction; - -struct Geometry_trait{ - typedef Point_d Point; +struct Geometry_trait { + typedef Point_d Point; }; /** * The vertex stored in the complex contains a quadric. */ struct Garland_heckbert_traits : public Skeleton_blocker_simple_geometric_traits<Geometry_trait> { + public: -public: - struct Garland_heckbert_vertex : public Simple_geometric_vertex{ - Error_quadric<Geometry_trait::Point> quadric; - }; - typedef Garland_heckbert_vertex Graph_vertex; + struct Garland_heckbert_vertex : public Simple_geometric_vertex { + Error_quadric<Geometry_trait::Point> quadric; + }; + typedef Garland_heckbert_vertex Graph_vertex; }; typedef Skeleton_blocker_geometric_complex< Garland_heckbert_traits > Complex; typedef Edge_profile<Complex> EdgeProfile; typedef Skeleton_blocker_contractor<Complex> Complex_contractor; - /** * How the new vertex is placed after an edge collapse : here it is placed at * the point minimizing the cost of the quadric. */ -class GH_placement : public Gudhi::contraction::Placement_policy<EdgeProfile>{ - Complex& complex_; -public: - typedef typename Gudhi::contraction::Placement_policy<EdgeProfile>::Placement_type Placement_type; - - GH_placement(Complex& complex):complex_(complex){} - - Placement_type operator()(const EdgeProfile& profile) const override{ - auto sum_quad(profile.v0().quadric); - sum_quad += profile.v1().quadric; - - boost::optional<Point> min_quadric_pt(sum_quad.min_cost()); - if (min_quadric_pt) - return Placement_type(*min_quadric_pt); - else - return profile.p0(); - } +class GH_placement : public Gudhi::contraction::Placement_policy<EdgeProfile> { + Complex& complex_; + public: + typedef Gudhi::contraction::Placement_policy<EdgeProfile>::Placement_type Placement_type; + + GH_placement(Complex& complex) : complex_(complex) { } + + Placement_type operator()(const EdgeProfile& profile) const override { + auto sum_quad(profile.v0().quadric); + sum_quad += profile.v1().quadric; + + boost::optional<Point> min_quadric_pt(sum_quad.min_cost()); + if (min_quadric_pt) + return Placement_type(*min_quadric_pt); + else + return profile.p0(); + } }; /** * How much cost an edge collapse : here the costs is given by a quadric * which expresses a squared distances with triangles planes. */ -class GH_cost : public Gudhi::contraction::Cost_policy<EdgeProfile>{ - Complex& complex_; -public: - - typedef typename Gudhi::contraction::Cost_policy<EdgeProfile>::Cost_type Cost_type; - - GH_cost(Complex& complex):complex_(complex){} - - Cost_type operator()( EdgeProfile const& profile, boost::optional<Point> const& new_point ) const override { - Cost_type res; - if (new_point){ - auto sum_quad(profile.v0().quadric); - sum_quad += profile.v1().quadric; - res = sum_quad.cost(*new_point); - } - return res; - } +class GH_cost : public Gudhi::contraction::Cost_policy<EdgeProfile> { + Complex& complex_; + public: + + typedef Gudhi::contraction::Cost_policy<EdgeProfile>::Cost_type Cost_type; + + GH_cost(Complex& complex) : complex_(complex) { } + + Cost_type operator()(EdgeProfile const& profile, boost::optional<Point> const& new_point) const override { + Cost_type res; + if (new_point) { + auto sum_quad(profile.v0().quadric); + sum_quad += profile.v1().quadric; + res = sum_quad.cost(*new_point); + } + return res; + } }; /** @@ -115,79 +113,80 @@ public: * Here we initializes the quadrics of every vertex at the on_started call back * and we update them when contracting an edge (the quadric become the sum of both quadrics). */ -class GH_visitor: public Gudhi::contraction::Contraction_visitor<EdgeProfile> { - Complex& complex_; -public: - GH_visitor(Complex& complex):complex_(complex){} - - //Compute quadrics for every vertex v - //The quadric of v consists in the sum of quadric - //of every triangles passing through v weighted by its area - void on_started(Complex & complex) override{ - for(auto v : complex.vertex_range()){ - auto & quadric_v(complex[v].quadric); - for(auto t : complex.triangle_range(v)){ - auto t_it = t.begin(); - const auto& p0(complex.point(*t_it++)); - const auto& p1(complex.point(*t_it++)); - const auto& p2(complex.point(*t_it++)); - quadric_v+=Error_quadric<Point>(p0,p1,p2); - } - } - } - - /** - * @brief Called when an edge is about to be contracted and replaced by a vertex whose position is *placement. - */ - void on_contracting(EdgeProfile const &profile, boost::optional< Point > placement) - override{ - profile.v0().quadric += profile.v1().quadric; - } +class GH_visitor : public Gudhi::contraction::Contraction_visitor<EdgeProfile> { + Complex& complex_; + public: + + GH_visitor(Complex& complex) : complex_(complex) { } + + //Compute quadrics for every vertex v + //The quadric of v consists in the sum of quadric + //of every triangles passing through v weighted by its area + + void on_started(Complex & complex) override { + for (auto v : complex.vertex_range()) { + auto & quadric_v(complex[v].quadric); + for (auto t : complex.triangle_range(v)) { + auto t_it = t.begin(); + const auto& p0(complex.point(*t_it++)); + const auto& p1(complex.point(*t_it++)); + const auto& p2(complex.point(*t_it++)); + quadric_v += Error_quadric<Point>(p0, p1, p2); + } + } + } + + /** + * @brief Called when an edge is about to be contracted and replaced by a vertex whose position is *placement. + */ + void on_contracting(EdgeProfile const &profile, boost::optional< Point > placement) + override { + profile.v0().quadric += profile.v1().quadric; + } }; +int main(int argc, char *argv[]) { + if (argc != 4) { + std::cerr << "Usage " << argv[0] << " input.off output.off N to load the file input.off, contract N edges and save the result to output.off.\n"; + return EXIT_FAILURE; + } -int main(int argc, char *argv[]){ - if (argc!=4){ - std::cerr << "Usage "<<argv[0]<<" input.off output.off N to load the file input.off, contract N edges and save the result to output.off.\n"; - return EXIT_FAILURE; - } - - Complex complex; + Complex complex; - // load the points - Skeleton_blocker_off_reader<Complex> off_reader(argv[1],complex); - if(!off_reader.is_valid()){ - std::cerr << "Unable to read file:"<<argv[1]<<std::endl; - return EXIT_FAILURE; - } + // load the points + Skeleton_blocker_off_reader<Complex> off_reader(argv[1], complex); + if (!off_reader.is_valid()) { + std::cerr << "Unable to read file:" << argv[1] << std::endl; + return EXIT_FAILURE; + } - std::cout << "Load complex with "<<complex.num_vertices()<<" vertices"<<std::endl; + std::cout << "Load complex with " << complex.num_vertices() << " vertices" << std::endl; - int num_contractions = atoi(argv[3]); + int num_contractions = atoi(argv[3]); - boost::timer::auto_cpu_timer t; + boost::timer::auto_cpu_timer t; - // constructs the contractor object with Garland Heckbert policies. - Complex_contractor contractor(complex, - new GH_cost(complex), - new GH_placement(complex), - contraction::make_link_valid_contraction<EdgeProfile>(), - new GH_visitor(complex) - ); + // constructs the contractor object with Garland Heckbert policies. + Complex_contractor contractor(complex, + new GH_cost(complex), + new GH_placement(complex), + contraction::make_link_valid_contraction<EdgeProfile>(), + new GH_visitor(complex) + ); - std::cout<<"Contract "<<num_contractions<<" edges"<<std::endl; - contractor.contract_edges(num_contractions); + std::cout << "Contract " << num_contractions << " edges" << std::endl; + contractor.contract_edges(num_contractions); - std::cout << "Final complex has "<< - complex.num_vertices()<<" vertices, "<< - complex.num_edges()<<" edges and" << - complex.num_triangles()<<" triangles."<<std::endl; + std::cout << "Final complex has " << + complex.num_vertices() << " vertices, " << + complex.num_edges() << " edges and" << + complex.num_triangles() << " triangles." << std::endl; - //write simplified complex - Skeleton_blocker_off_writer<Complex> off_writer(argv[2],complex); + //write simplified complex + Skeleton_blocker_off_writer<Complex> off_writer(argv[2], complex); - return EXIT_SUCCESS; + return EXIT_SUCCESS; } diff --git a/src/Contraction/example/Garland_heckbert/Error_quadric.h b/src/Contraction/example/Garland_heckbert/Error_quadric.h index 725a3a56..725a3a56 100755..100644 --- a/src/Contraction/example/Garland_heckbert/Error_quadric.h +++ b/src/Contraction/example/Garland_heckbert/Error_quadric.h diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt index b62be8ff..ddbae969 100644 --- a/src/GudhUI/CMakeLists.txt +++ b/src/GudhUI/CMakeLists.txt @@ -1,82 +1,69 @@ cmake_minimum_required(VERSION 2.8) project(GudhUI) -#Specify Gudhi's path here -#for instance -#set(Gudhi_Path "C:/Users/dsalinas/Documents/Recherche/Code/c++/Gudhi_library_1.1.0/include") -set(Gudhi_Path "/home/dsalinas/Documents/CodeSVN/gudhi/src/include") -if(MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018 -frounding-math") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic -frounding-math") -endif() - -set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE}) - -find_package(Boost REQUIRED COMPONENTS) find_package(CGAL COMPONENTS Qt4) find_package(Qt4) find_package(QGLViewer) find_package(OpenGL) +message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") +message("CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}") +message("CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}") if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND ) - set( QT_USE_QTXML TRUE ) - set( QT_USE_QTMAIN TRUE ) - set( QT_USE_QTSCRIPT TRUE ) - set( QT_USE_QTOPENGL TRUE ) - SET(Boost_USE_STATIC_LIBS ON) - SET(Boost_USE_MULTITHREAD OFF) - - INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) - LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) - - include(${QT_USE_FILE}) - include(${CGAL_USE_FILE}) - - include_directories (${QGLVIEWER_INCLUDE_DIR}) - include_directories(.) - include_directories(${Gudhi_Path}) + set( QT_USE_QTXML TRUE ) + set( QT_USE_QTMAIN TRUE ) + set( QT_USE_QTSCRIPT TRUE ) + set( QT_USE_QTOPENGL TRUE ) + SET(Boost_USE_STATIC_LIBS ON) + SET(Boost_USE_MULTITHREAD OFF) + INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) + LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) + + include(${QT_USE_FILE}) + include(${CGAL_USE_FILE}) + include_directories (${QGLVIEWER_INCLUDE_DIR}) + include_directories(.) - # qt : ui file, created wih Qt Designer ############### - set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui") - qt4_wrap_ui( uis - gui/main_window.ui - gui/MenuEdgeContraction.ui - gui/KNearestNeighborsMenu.ui - gui/UniformNeighborsMenu.ui - gui/PersistenceMenu.ui - ) + # qt : ui file, created wih Qt Designer ############### + set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui") + qt4_wrap_ui( uis + gui/main_window.ui + gui/MenuEdgeContraction.ui + gui/KNearestNeighborsMenu.ui + gui/UniformNeighborsMenu.ui + gui/PersistenceMenu.ui + ) - set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui") - qt4_automoc( - gui/MainWindow.cpp - gui/Menu_k_nearest_neighbors.cpp - gui/Menu_uniform_neighbors.cpp - gui/Menu_edge_contraction.cpp - gui/Menu_persistence.cpp - ) + set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gui") + qt4_automoc( + gui/MainWindow.cpp + gui/Menu_k_nearest_neighbors.cpp + gui/Menu_uniform_neighbors.cpp + gui/Menu_edge_contraction.cpp + gui/Menu_persistence.cpp + ) - set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/view") - qt4_automoc(view/Viewer_instructor.cpp - view/Viewer.cpp - ) - ##################################################################### + set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/view") + qt4_automoc(view/Viewer_instructor.cpp + view/Viewer.cpp + ) + ##################################################################### - add_executable ( GudhUI - gui/gudhui.cpp - gui/MainWindow.cpp - gui/Menu_k_nearest_neighbors.cpp - gui/Menu_uniform_neighbors.cpp - gui/Menu_edge_contraction.cpp - gui/Menu_persistence.cpp - view/Viewer_instructor.cpp - view/Viewer.cpp - ${uis} - ) + add_executable ( GudhUI + gui/gudhui.cpp + gui/MainWindow.cpp + gui/Menu_k_nearest_neighbors.cpp + gui/Menu_uniform_neighbors.cpp + gui/Menu_edge_contraction.cpp + gui/Menu_persistence.cpp + view/Viewer_instructor.cpp + view/Viewer.cpp + ${uis} + ) - target_link_libraries( GudhUI ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ) - target_link_libraries( GudhUI ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) + target_link_libraries( GudhUI ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ) + target_link_libraries( GudhUI ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) else() message(STATUS "NOTICE: This demo requires CGAL, the QGLViewer, OpenGL and Qt4, and will not be compiled.") diff --git a/src/GudhUI/model/Model.h b/src/GudhUI/model/Model.h index 6ac971d0..87545989 100644 --- a/src/GudhUI/model/Model.h +++ b/src/GudhUI/model/Model.h @@ -72,8 +72,6 @@ class Model{ public: Complex complex_; typedef Complex::Vertex_handle Vertex_handle; - typedef Complex::CVI CVI; - Model():complex_(){ } @@ -317,7 +315,7 @@ private: void run_chomp(){ save_complex_in_file_for_chomp(); std::cout << "Call CHOMP library\n"; - system("../src/utils/homsimpl chomp.sim"); + system("utils/homsimpl chomp.sim"); } void save_complex_in_file_for_chomp(){ diff --git a/src/GudhUI/view/Viewer.h b/src/GudhUI/view/Viewer.h index 5639aa56..5639aa56 100755..100644 --- a/src/GudhUI/view/Viewer.h +++ b/src/GudhUI/view/Viewer.h diff --git a/src/GudhUI/view/Viewer_instructor.h b/src/GudhUI/view/Viewer_instructor.h index 9a2a236b..9a2a236b 100755..100644 --- a/src/GudhUI/view/Viewer_instructor.h +++ b/src/GudhUI/view/Viewer_instructor.h diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index 3697a419..9487cce6 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -9,7 +9,6 @@ if (NOT MSVC) add_executable(rips_persistence rips_persistence.cpp) target_link_libraries(rips_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) - add_test(rips_persistence_2 ${CMAKE_CURRENT_BINARY_DIR}/rips_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 2 -m 100) add_test(rips_persistence_3 ${CMAKE_CURRENT_BINARY_DIR}/rips_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 3 -m 100) add_executable(persistence_from_file persistence_from_file.cpp) @@ -23,14 +22,14 @@ if (NOT MSVC) add_executable(rips_multifield_persistence rips_multifield_persistence.cpp ) target_link_libraries(rips_multifield_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) - add_test(rips_multifield_persistence_2_3 ${CMAKE_CURRENT_BINARY_DIR}/rips_multifield_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 3 -m 100) add_test(rips_multifield_persistence_2_71 ${CMAKE_CURRENT_BINARY_DIR}/rips_multifield_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 71 -m 100) add_executable ( performance_rips_persistence performance_rips_persistence.cpp ) target_link_libraries(performance_rips_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) if(CGAL_FOUND) - add_definitions(-DDEBUG_TRACES) + # uncomment to display debug traces + # add_definitions(-DDEBUG_TRACES) add_executable(alpha_shapes_persistence alpha_shapes_persistence.cpp) target_link_libraries(alpha_shapes_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) add_test(alpha_shapes_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_shapes_persistence ${CMAKE_SOURCE_DIR}/data/points/bunny_5000 2 0.5) diff --git a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp index 2505897e..297a8f98 100644 --- a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp +++ b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp @@ -70,8 +70,6 @@ int main (int argc, char * argv[]) st.insert_graph(prox_graph); // insert the proximity graph in the simplex tree st.expansion( dim_max ); // expand the graph until dimension dim_max - std::cout << "st=" << st << std::endl; - // Sort the simplices in the order of the filtration st.initialize_filtration(); diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h index c42e4be4..b0d68f09 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h @@ -238,8 +238,8 @@ class Persistent_cohomology { transverse_idx_(), // key -> row persistent_pairs_(), interval_length_policy(&cpx, 0), - column_pool_(new boost::object_pool<Column>()), // memory pools for the CAM - cell_pool_(new boost::object_pool<Cell>()) { + column_pool_(), // memory pools for the CAM + cell_pool_() { Simplex_key idx_fil = 0; for (auto & sh : cpx_->filtration_simplex_range()) { cpx_->assign_key(sh, idx_fil); @@ -273,9 +273,6 @@ class Persistent_cohomology { transverse_ref.second.row_->clear(); delete transverse_ref.second.row_; } -// Clear the memory pools - delete column_pool_; - delete cell_pool_; } private: @@ -528,8 +525,8 @@ class Persistent_cohomology { Arith_element charac) { Simplex_key key = cpx_->key(sigma); // Create a column containing only one cell, - Column * new_col = column_pool_->construct(Column(key)); - Cell * new_cell = cell_pool_->construct(Cell(key, x, new_col)); + Column * new_col = column_pool_.construct(Column(key)); + Cell * new_cell = cell_pool_.construct(Cell(key, x, new_col)); new_col->col_.push_back(*new_cell); // and insert it in the matrix, in constant time thanks to the hint cam_.end(). // Indeed *new_col has the biggest lexicographic value because key is the @@ -585,7 +582,7 @@ class Persistent_cohomology { if (curr_col->col_.empty()) { // If the column is null ds_repr_[curr_col->class_key_] = NULL; - column_pool_->free(curr_col); // delete curr_col; + column_pool_.destroy(curr_col); // delete curr_col; } else { // Find whether the column obtained is already in the CAM result_insert_cam = cam_.insert(*curr_col); @@ -602,7 +599,7 @@ class Persistent_cohomology { Simplex_key key_tmp = dsets_.find_set(curr_col->class_key_); ds_repr_[key_tmp] = &(*(result_insert_cam.first)); result_insert_cam.first->class_key_ = key_tmp; - column_pool_->free(curr_col); // delete curr_col; + column_pool_.destroy(curr_col); // delete curr_col; } } } else { @@ -634,7 +631,7 @@ class Persistent_cohomology { ++target_it; } else { if (target_it->key_ > other_it->first) { - Cell * cell_tmp = cell_pool_->construct(Cell(other_it->first // key + Cell * cell_tmp = cell_pool_.construct(Cell(other_it->first // key , coeff_field_.additive_identity(), &target)); cell_tmp->coefficient_ = coeff_field_.plus_times_equal(cell_tmp->coefficient_, other_it->second, w); @@ -652,8 +649,7 @@ class Persistent_cohomology { Cell * tmp_cell_ptr = &(*tmp_it); target.col_.erase(tmp_it); // removed from column - coeff_field_.clear_coefficient(tmp_cell_ptr->coefficient_); - cell_pool_->free(tmp_cell_ptr); // delete from memory + cell_pool_.destroy(tmp_cell_ptr); // delete from memory } else { ++target_it; ++other_it; @@ -662,7 +658,7 @@ class Persistent_cohomology { } } while (other_it != other.end()) { - Cell * cell_tmp = cell_pool_->construct(Cell(other_it->first, coeff_field_.additive_identity(), &target)); + Cell * cell_tmp = cell_pool_.construct(Cell(other_it->first, coeff_field_.additive_identity(), &target)); cell_tmp->coefficient_ = coeff_field_.plus_times_equal(cell_tmp->coefficient_, other_it->second, w); target.col_.insert(target.col_.end(), *cell_tmp); @@ -767,8 +763,8 @@ class Persistent_cohomology { std::list<Persistent_interval> persistent_pairs_; length_interval interval_length_policy; - boost::object_pool<Column> * column_pool_; - boost::object_pool<Cell> * cell_pool_; + boost::object_pool<Column> column_pool_; + boost::object_pool<Cell> cell_pool_; }; /** @} */ // end defgroup persistent_cohomology diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h index 5d0c9f9f..2349cdac 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h @@ -76,9 +76,6 @@ class Field_Zp { return plus_times_equal(0, y, (Element)w); } - void clear_coefficient(Element x) { - } - Element plus_equal(const Element& x, const Element& y) { return plus_times_equal(x, y, (Element)1); } diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h index b43bb16e..c6fd5282 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h @@ -77,6 +77,7 @@ class Multi_field { mpz_nextprime(tmp_prime, tmp_prime); curr_prime = mpz_get_ui(tmp_prime); } + mpz_clear(tmp_prime); // set m to primorial(bound_prime) prod_characteristics_ = 1; for (auto p : primes_) { @@ -102,10 +103,6 @@ class Multi_field { } } - void clear_coefficient(Element & x) { - mpz_clear(x.get_mpz_t()); - } - /** \brief Returns the additive idendity \f$0_{\Bbbk}\f$ of the field.*/ const Element& additive_identity() const { return add_id_all; diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt index 9dc19251..ed63a6ac 100644 --- a/src/Persistent_cohomology/test/CMakeLists.txt +++ b/src/Persistent_cohomology/test/CMakeLists.txt @@ -1,29 +1,39 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHITestSimplexTree) +project(GUDHIPersistentCohomologyUT) -if(NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --coverage") +if (GCOVR_PATH) + # for gcovr to make coverage reports - Corbera Jenkins plugin + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage") +endif() +if (GPROF_PATH) + # for gprof to make coverage reports - Jenkins + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg") endif() -add_executable ( persistent_cohomology_unit_test persistent_cohomology_unit_test.cpp ) -target_link_libraries(persistent_cohomology_unit_test ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( PersistentCohomologyUT persistent_cohomology_unit_test.cpp ) +target_link_libraries(PersistentCohomologyUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) # Unitary tests -add_test(persistent_cohomology_unit_test ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_unit_test.txt) +add_test(NAME PersistentCohomologyUT + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/PersistentCohomologyUT + ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_unit_test.txt + # XML format for Jenkins xUnit plugin + --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/PersistentCohomologyUT.xml --log_level=test_suite --report_level=no) if(GMPXX_FOUND AND GMP_FOUND) - add_executable ( persistent_cohomology_unit_test_multi_field persistent_cohomology_unit_test_multi_field.cpp ) - target_link_libraries(persistent_cohomology_unit_test_multi_field ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) + add_executable ( PersistentCohomologyMultiFieldUT persistent_cohomology_unit_test_multi_field.cpp ) + target_link_libraries(PersistentCohomologyMultiFieldUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) - # Unitary tests - add_test(persistent_cohomology_unit_test_multi_field ${CMAKE_CURRENT_BINARY_DIR}/persistent_cohomology_unit_test_multi_field ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt) -endif() + # Unitary tests + add_test(NAME PersistentCohomologyMultiFieldUT + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/PersistentCohomologyMultiFieldUT + ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt + # XML format for Jenkins xUnit plugin + --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/PersistentCohomologyMultiFieldUT.xml --log_level=test_suite --report_level=no) -if (LCOV_PATH) - # Lcov code coverage of unitary test - add_test(src/Persistent_cohomology/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Persistent_cohomology) endif() -cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Persistent_cohomology/include/gudhi") diff --git a/src/Persistent_cohomology/test/README b/src/Persistent_cohomology/test/README index ddceac63..6c64b5fe 100644 --- a/src/Persistent_cohomology/test/README +++ b/src/Persistent_cohomology/test/README @@ -1,7 +1,9 @@ To compile: *********** +cd /path-to-gudhi/ cmake . +cd /path-to-test/ make To launch with details: @@ -9,13 +11,13 @@ To launch with details: SINGLE FIELD ------------ -./persistent_cohomology_unit_test simplex_tree_file_for_unit_test.txt --report_level=detailed --log_level=all +./PersistentCohomologyUT simplex_tree_file_for_unit_test.txt --report_level=detailed --log_level=all ==> echo $? returns 0 in case of success (non-zero otherwise) MULTI FIELD ----------- -./persistent_cohomology_unit_test_multi_field simplex_tree_file_for_multi_field_unit_test.txt --report_level=detailed --log_level=all +./PersistentCohomologyMultiFieldUT simplex_tree_file_for_multi_field_unit_test.txt --report_level=detailed --log_level=all ==> echo $? returns 0 in case of success (non-zero otherwise) diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp index 1e7a74a7..55bc7066 100644 --- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp +++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test.cpp @@ -1,4 +1,4 @@ -#define BOOST_TEST_MODULE const_string test +#define BOOST_TEST_MODULE persistent_cohomology test #include <boost/test/included/unit_test.hpp> #include <boost/system/error_code.hpp> #include <boost/chrono/thread_clock.hpp> @@ -22,8 +22,7 @@ using namespace boost::unit_test; typedef Simplex_tree<> typeST; std::string test_rips_persistence(int coefficient, int min_persistence) { - // Check file name is given as parameter from CMakeLists.txt - BOOST_CHECK(framework::master_test_suite().argc >= 2); + // file name is given as parameter from CMakeLists.txt const std::string inputFile(framework::master_test_suite().argv[1]); std::ifstream simplex_tree_stream; diff --git a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp index e88add3a..18a4725e 100644 --- a/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp +++ b/src/Persistent_cohomology/test/persistent_cohomology_unit_test_multi_field.cpp @@ -1,4 +1,4 @@ -#define BOOST_TEST_MODULE const_string test +#define BOOST_TEST_MODULE persistent_cohomology_multi_field test #include <boost/test/included/unit_test.hpp> #include <boost/system/error_code.hpp> #include <boost/chrono/thread_clock.hpp> @@ -23,8 +23,7 @@ using namespace boost::unit_test; typedef Simplex_tree<> typeST; std::string test_rips_persistence(int min_coefficient, int max_coefficient, int min_persistence) { - // Check file name is given as parameter from CMakeLists.txt - BOOST_CHECK(framework::master_test_suite().argc >= 2); + // file name is given as parameter from CMakeLists.txt const std::string inputFile(framework::master_test_suite().argv[1]); std::ifstream simplex_tree_stream; @@ -38,9 +37,9 @@ std::string test_rips_persistence(int min_coefficient, int max_coefficient, int << " - filtration= " << st.filtration() << std::endl; // Check - BOOST_CHECK(st.num_simplices() == 6142604); + BOOST_CHECK(st.num_simplices() == 58); BOOST_CHECK(st.dimension() == 3); - BOOST_CHECK(st.filtration() == 0.249999); + BOOST_CHECK(st.filtration() == 0.4); // Sort the simplices in the order of the filtration st.initialize_filtration(); @@ -48,9 +47,9 @@ std::string test_rips_persistence(int min_coefficient, int max_coefficient, int // Compute the persistence diagram of the complex Persistent_cohomology<Simplex_tree<>, Multi_field> pcoh(st); - pcoh.init_coefficients(min_coefficient, max_coefficient); // initializes the coefficient field for homology + pcoh.init_coefficients(min_coefficient, max_coefficient); // initializes the coefficient field for homology // Check infinite rips - pcoh.compute_persistent_cohomology(min_persistence); // Minimal lifetime of homology feature to be recorded. + pcoh.compute_persistent_cohomology(min_persistence); // Minimal lifetime of homology feature to be recorded. std::ostringstream ossRips; pcoh.output_diagram(ossRips); @@ -60,68 +59,54 @@ std::string test_rips_persistence(int min_coefficient, int max_coefficient, int } void test_rips_persistence_in_dimension(int min_dimension, int max_dimension) { - std::string value0(" 0 0 inf"); - std::string value1(" 1 0.0702103 inf"); - std::string value2("2 1 0.0702103 inf"); - std::string value3("2 2 0.159992 inf"); + // there are 2 discontinued ensembles + std::string value0(" 0 0.25 inf"); + std::string value1(" 1 0.4 inf"); + // And a big hole - cut in 2 pieces after 0.3 + std::string value2(" 0 0.2 0.3"); + + // For dim <= 1 => + std::string value3(" 1 0.25 inf"); + std::string value4(" 2 0.25 inf"); + std::string value5(" 1 0.3 inf"); + std::string value6(" 2 0.3 inf"); + std::string value7(" 2 0.4 inf"); std::cout << "********************************************************************" << std::endl; std::cout << "TEST OF RIPS_PERSISTENT_COHOMOLOGY_MULTI_FIELD MIN_DIM=" << min_dimension << " MAX_DIM=" << max_dimension << " MIN_PERS=0" << std::endl; - std::string str_rips_persistence = test_rips_persistence(min_dimension, max_dimension, 1); - - BOOST_CHECK(str_rips_persistence.find(value0) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value1) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value2) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value3) != std::string::npos); // Check found - std::cout << "str_rips_persistence=" << str_rips_persistence << std::endl; - - std::cout << "********************************************************************" << std::endl; - std::cout << "TEST OF RIPS_PERSISTENT_COHOMOLOGY_MULTI_FIELD DIM=" << min_dimension << " MAX_DIM=" << max_dimension << " MIN_PERS=2" << std::endl; - - str_rips_persistence = test_rips_persistence(min_dimension, max_dimension, 2); - - BOOST_CHECK(str_rips_persistence.find(value0) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value1) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value2) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value3) != std::string::npos); // Check found + std::string str_rips_persistence = test_rips_persistence(min_dimension, max_dimension, static_cast<Filtration_value> (0.0)); std::cout << "str_rips_persistence=" << str_rips_persistence << std::endl; - std::cout << "********************************************************************" << std::endl; - std::cout << "TEST OF RIPS_PERSISTENT_COHOMOLOGY_MULTI_FIELD DIM=" << min_dimension << " MAX_DIM=" << max_dimension << " MIN_PERS=3" << std::endl; - - str_rips_persistence = test_rips_persistence(min_dimension, max_dimension, 3); - BOOST_CHECK(str_rips_persistence.find(value0) != std::string::npos); // Check found BOOST_CHECK(str_rips_persistence.find(value1) != std::string::npos); // Check found BOOST_CHECK(str_rips_persistence.find(value2) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value3) != std::string::npos); // Check found - std::cout << "str_rips_persistence=" << str_rips_persistence << std::endl; - std::cout << "********************************************************************" << std::endl; - std::cout << "TEST OF RIPS_PERSISTENT_COHOMOLOGY_MULTI_FIELD DIM=" << min_dimension << " MAX_DIM=" << max_dimension << " MIN_PERS=Inf" << std::endl; + if ((min_dimension < 2) && (max_dimension < 2)) { + BOOST_CHECK(str_rips_persistence.find(value3) != std::string::npos); // Check found + BOOST_CHECK(str_rips_persistence.find(value4) != std::string::npos); // Check found + BOOST_CHECK(str_rips_persistence.find(value5) != std::string::npos); // Check found + BOOST_CHECK(str_rips_persistence.find(value6) != std::string::npos); // Check found + BOOST_CHECK(str_rips_persistence.find(value7) != std::string::npos); // Check found + } else { + BOOST_CHECK(str_rips_persistence.find(value3) == std::string::npos); // Check not found + BOOST_CHECK(str_rips_persistence.find(value4) == std::string::npos); // Check not found + BOOST_CHECK(str_rips_persistence.find(value5) == std::string::npos); // Check not found + BOOST_CHECK(str_rips_persistence.find(value6) == std::string::npos); // Check not found + BOOST_CHECK(str_rips_persistence.find(value7) == std::string::npos); // Check not found + } - str_rips_persistence = test_rips_persistence(min_dimension, max_dimension, std::numeric_limits<int>::max()); - - BOOST_CHECK(str_rips_persistence.find(value0) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value1) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value2) != std::string::npos); // Check found - BOOST_CHECK(str_rips_persistence.find(value3) != std::string::npos); // Check found - std::cout << "str_rips_persistence=" << str_rips_persistence << std::endl; } -BOOST_AUTO_TEST_CASE( rips_persistent_cohomology_multi_field_dim_1_2 ) -{ - test_rips_persistence_in_dimension(1, 2); +BOOST_AUTO_TEST_CASE(rips_persistent_cohomology_multi_field_dim_1_2) { + test_rips_persistence_in_dimension(0, 1); } -BOOST_AUTO_TEST_CASE( rips_persistent_cohomology_multi_field_dim_2_3 ) -{ - test_rips_persistence_in_dimension(2, 3); +BOOST_AUTO_TEST_CASE(rips_persistent_cohomology_multi_field_dim_2_3) { + test_rips_persistence_in_dimension(1, 3); } -BOOST_AUTO_TEST_CASE( rips_persistent_cohomology_multi_field_dim_1_5 ) -{ +BOOST_AUTO_TEST_CASE(rips_persistent_cohomology_multi_field_dim_1_5) { test_rips_persistence_in_dimension(1, 5); } diff --git a/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt b/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt new file mode 100644 index 00000000..ed2c0c3d --- /dev/null +++ b/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt @@ -0,0 +1,58 @@ +0 0 0.2 +0 3 0.2 +1 3 0 0.2 +0 6 0.2 +0 11 0.2 +1 11 6 0.2 +0 13 0.25 +0 14 0.25 +1 14 13 0.25 +0 15 0.25 +1 15 13 0.25 +1 15 14 0.25 +2 15 14 13 0.25 +0 1 0.3 +1 1 0 0.3 +0 2 0.3 +1 2 0 0.3 +1 2 1 0.3 +2 2 1 0 0.3 +0 4 0.3 +1 4 3 0.3 +0 5 0.3 +1 5 3 0.3 +1 5 4 0.3 +2 5 4 3 0.3 +0 9 0.3 +0 10 0.3 +1 10 2 0.3 +1 10 9 0.3 +1 11 9 0.3 +1 11 10 0.3 +2 11 10 9 0.3 +0 12 0.3 +1 12 2 0.3 +1 12 10 0.3 +2 12 10 2 0.3 +1 6 0 0.4 +1 6 1 0.4 +2 6 1 0 0.4 +0 7 0.4 +1 7 0 0.4 +1 7 1 0.4 +2 7 1 0 0.4 +1 7 6 0.4 +2 7 6 0 0.4 +2 7 6 1 0.4 +3 7 6 1 0 0.4 +0 8 0.4 +1 8 4 0.4 +1 8 5 0.4 +2 8 5 4 0.4 +1 9 4 0.4 +1 9 5 0.4 +2 9 5 4 0.4 +1 9 8 0.4 +2 9 8 4 0.4 +2 9 8 5 0.4 +3 9 8 5 4 0.4 diff --git a/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt.REMOVED.git-id b/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt.REMOVED.git-id deleted file mode 100644 index 2dd38515..00000000 --- a/src/Persistent_cohomology/test/simplex_tree_file_for_multi_field_unit_test.txt.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -ce87199d425b05f51c74cbf635870bfa5abbc7a1
\ No newline at end of file diff --git a/src/Simplex_tree/example/simple_simplex_tree.cpp b/src/Simplex_tree/example/simple_simplex_tree.cpp index bde224f1..6d20e43e 100644 --- a/src/Simplex_tree/example/simple_simplex_tree.cpp +++ b/src/Simplex_tree/example/simple_simplex_tree.cpp @@ -28,7 +28,6 @@ using namespace Gudhi; typedef std::vector< Vertex_handle > typeVectorVertex; -typedef std::pair<typeVectorVertex, Filtration_value> typeSimplex; typedef std::pair< Simplex_tree<>::Simplex_handle, bool > typePairSimplexBool; int main(int argc, char * const argv[]) { @@ -58,9 +57,8 @@ int main(int argc, char * const argv[]) { std::cout << " * INSERT 0" << std::endl; typeVectorVertex firstSimplexVector; firstSimplexVector.push_back(FIRST_VERTEX_HANDLE); - typeSimplex firstSimplex = std::make_pair(firstSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); typePairSimplexBool returnValue = - simplexTree.insert_simplex(firstSimplex.first, firstSimplex.second); + simplexTree.insert_simplex(firstSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + 0 INSERTED" << std::endl; @@ -74,9 +72,8 @@ int main(int argc, char * const argv[]) { std::cout << " * INSERT 1" << std::endl; typeVectorVertex secondSimplexVector; secondSimplexVector.push_back(SECOND_VERTEX_HANDLE); - typeSimplex secondSimplex = std::make_pair(secondSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(secondSimplex.first, secondSimplex.second); + simplexTree.insert_simplex(secondSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + 1 INSERTED" << std::endl; @@ -91,9 +88,8 @@ int main(int argc, char * const argv[]) { typeVectorVertex thirdSimplexVector; thirdSimplexVector.push_back(FIRST_VERTEX_HANDLE); thirdSimplexVector.push_back(SECOND_VERTEX_HANDLE); - typeSimplex thirdSimplex = std::make_pair(thirdSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(thirdSimplex.first, thirdSimplex.second); + simplexTree.insert_simplex(thirdSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + (0,1) INSERTED" << std::endl; @@ -107,9 +103,8 @@ int main(int argc, char * const argv[]) { std::cout << " * INSERT 2" << std::endl; typeVectorVertex fourthSimplexVector; fourthSimplexVector.push_back(THIRD_VERTEX_HANDLE); - typeSimplex fourthSimplex = std::make_pair(fourthSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(fourthSimplex.first, fourthSimplex.second); + simplexTree.insert_simplex(fourthSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + 2 INSERTED" << std::endl; @@ -124,9 +119,8 @@ int main(int argc, char * const argv[]) { typeVectorVertex fifthSimplexVector; fifthSimplexVector.push_back(THIRD_VERTEX_HANDLE); fifthSimplexVector.push_back(FIRST_VERTEX_HANDLE); - typeSimplex fifthSimplex = std::make_pair(fifthSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(fifthSimplex.first, fifthSimplex.second); + simplexTree.insert_simplex(fifthSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + (2,0) INSERTED" << std::endl; @@ -141,9 +135,8 @@ int main(int argc, char * const argv[]) { typeVectorVertex sixthSimplexVector; sixthSimplexVector.push_back(THIRD_VERTEX_HANDLE); sixthSimplexVector.push_back(SECOND_VERTEX_HANDLE); - typeSimplex sixthSimplex = std::make_pair(sixthSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(sixthSimplex.first, sixthSimplex.second); + simplexTree.insert_simplex(sixthSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + (2,1) INSERTED" << std::endl; @@ -159,9 +152,8 @@ int main(int argc, char * const argv[]) { seventhSimplexVector.push_back(THIRD_VERTEX_HANDLE); seventhSimplexVector.push_back(SECOND_VERTEX_HANDLE); seventhSimplexVector.push_back(FIRST_VERTEX_HANDLE); - typeSimplex seventhSimplex = std::make_pair(seventhSimplexVector, Filtration_value(THIRD_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(seventhSimplex.first, seventhSimplex.second); + simplexTree.insert_simplex(seventhSimplexVector, Filtration_value(THIRD_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + (2,1,0) INSERTED" << std::endl; @@ -175,9 +167,8 @@ int main(int argc, char * const argv[]) { std::cout << " * INSERT 3" << std::endl; typeVectorVertex eighthSimplexVector; eighthSimplexVector.push_back(FOURTH_VERTEX_HANDLE); - typeSimplex eighthSimplex = std::make_pair(eighthSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(eighthSimplex.first, eighthSimplex.second); + simplexTree.insert_simplex(eighthSimplexVector, Filtration_value(FIRST_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + 3 INSERTED" << std::endl; @@ -192,9 +183,8 @@ int main(int argc, char * const argv[]) { typeVectorVertex ninethSimplexVector; ninethSimplexVector.push_back(FOURTH_VERTEX_HANDLE); ninethSimplexVector.push_back(FIRST_VERTEX_HANDLE); - typeSimplex ninethSimplex = std::make_pair(ninethSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(ninethSimplex.first, ninethSimplex.second); + simplexTree.insert_simplex(ninethSimplexVector, Filtration_value(SECOND_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + (3,0) INSERTED" << std::endl; @@ -208,9 +198,8 @@ int main(int argc, char * const argv[]) { std::cout << " * INSERT 0 (already inserted)" << std::endl; typeVectorVertex tenthSimplexVector; tenthSimplexVector.push_back(FIRST_VERTEX_HANDLE); - typeSimplex tenthSimplex = std::make_pair(tenthSimplexVector, Filtration_value(FOURTH_FILTRATION_VALUE)); // With a different filtration value returnValue = - simplexTree.insert_simplex(tenthSimplex.first, tenthSimplex.second); + simplexTree.insert_simplex(tenthSimplexVector, Filtration_value(FOURTH_FILTRATION_VALUE)); // With a different filtration value if (returnValue.second == true) { std::cout << " + 0 INSERTED" << std::endl; @@ -226,9 +215,8 @@ int main(int argc, char * const argv[]) { eleventhSimplexVector.push_back(THIRD_VERTEX_HANDLE); eleventhSimplexVector.push_back(SECOND_VERTEX_HANDLE); eleventhSimplexVector.push_back(FIRST_VERTEX_HANDLE); - typeSimplex eleventhSimplex = std::make_pair(eleventhSimplexVector, Filtration_value(FOURTH_FILTRATION_VALUE)); returnValue = - simplexTree.insert_simplex(eleventhSimplex.first, eleventhSimplex.second); + simplexTree.insert_simplex(eleventhSimplexVector, Filtration_value(FOURTH_FILTRATION_VALUE)); if (returnValue.second == true) { std::cout << " + (2,1,0) INSERTED" << std::endl; diff --git a/src/Simplex_tree/test/CMakeLists.txt b/src/Simplex_tree/test/CMakeLists.txt index 02ef9d8b..b6a1c0b6 100644 --- a/src/Simplex_tree/test/CMakeLists.txt +++ b/src/Simplex_tree/test/CMakeLists.txt @@ -1,21 +1,25 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHITestSimplexTree) +project(GUDHISimplexTreeUT) -if(NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --coverage") +if (GCOVR_PATH) + # for gcovr to make coverage reports - Corbera Jenkins plugin + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage") +endif() +if (GPROF_PATH) + # for gprof to make coverage reports - Jenkins + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg") endif() -add_executable ( simplex_tree_unit_test simplex_tree_unit_test.cpp ) -target_link_libraries(simplex_tree_unit_test ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +add_executable ( SimplexTreeUT simplex_tree_unit_test.cpp ) +target_link_libraries(SimplexTreeUT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) # Unitary tests -add_test(simplex_tree_unit_test ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_unit_test) - -if (LCOV_PATH) - # Lcov code coverage of unitary test - add_test(src/Simplex_tree/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Simplex_tree) -endif() +add_test(NAME SimplexTreeUT + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/SimplexTreeUT + # XML format for Jenkins xUnit plugin + --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/SimplexTreeUT.xml --log_level=test_suite --report_level=no) -cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Simplex_tree/include/gudhi") diff --git a/src/Simplex_tree/test/README b/src/Simplex_tree/test/README index 620bcd5f..21c3d871 100644 --- a/src/Simplex_tree/test/README +++ b/src/Simplex_tree/test/README @@ -1,12 +1,14 @@ To compile: *********** +cd /path-to-gudhi/ cmake . +cd /path-to-test/ make To launch with details: *********************** -./simplex_tree_unit_test --report_level=detailed --log_level=all +./SimplexTreeUT --report_level=detailed --log_level=all ==> echo $? returns 0 in case of success (non-zero otherwise) diff --git a/src/Simplex_tree/test/simplex_tree_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_unit_test.cpp index c0cfced1..6b0a1f3d 100644 --- a/src/Simplex_tree/test/simplex_tree_unit_test.cpp +++ b/src/Simplex_tree/test/simplex_tree_unit_test.cpp @@ -1,4 +1,4 @@ -#define BOOST_TEST_MODULE const_string test +#define BOOST_TEST_MODULE simplex_tree test #include <boost/test/included/unit_test.hpp> #include <boost/system/error_code.hpp> #include <boost/chrono/thread_clock.hpp> diff --git a/src/Skeleton_blocker/test/CMakeLists.txt b/src/Skeleton_blocker/test/CMakeLists.txt index c69bfec7..e62600a2 100644 --- a/src/Skeleton_blocker/test/CMakeLists.txt +++ b/src/Skeleton_blocker/test/CMakeLists.txt @@ -1,12 +1,17 @@ cmake_minimum_required(VERSION 2.6) project(GUDHIskbl) -if(NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} --coverage") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} --coverage") +if (GCOVR_PATH) + # for gcovr to make coverage reports - Corbera Jenkins plugin + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage") +endif() +if (GPROF_PATH) + # for gprof to make coverage reports - Jenkins + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg") endif() add_executable(TestSkeletonBlockerComplex TestSkeletonBlockerComplex.cpp) @@ -17,10 +22,3 @@ add_test(TestSkeletonBlockerComplex ${CMAKE_CURRENT_BINARY_DIR}/TestSkeletonBloc add_test(TestSimplifiable ${CMAKE_CURRENT_BINARY_DIR}/TestSimplifiable) add_test(TestGeometricComplex ${CMAKE_CURRENT_BINARY_DIR}/TestGeometricComplex) - -if (LCOV_PATH) - # Lcov code coverage of unitary test - add_test(src/Skeleton_blocker/lcov/coverage.log ${CMAKE_SOURCE_DIR}/scripts/check_code_coverage.sh ${CMAKE_SOURCE_DIR}/src/Skeleton_blocker) -endif() - -cpplint_add_tests("${CMAKE_SOURCE_DIR}/src/Skeleton_blocker/include/gudhi") diff --git a/src/cmake/modules/FindQGLViewer.cmake b/src/cmake/modules/FindQGLViewer.cmake new file mode 100644 index 00000000..65723d67 --- /dev/null +++ b/src/cmake/modules/FindQGLViewer.cmake @@ -0,0 +1,61 @@ +# - Try to find QGLViewer +# Once done this will define +# +# QGLVIEWER_FOUND - system has QGLViewer +# QGLVIEWER_INCLUDE_DIR - the QGLViewer include directory +# QGLVIEWER_LIBRARIES - Link these to use QGLViewer +# QGLVIEWER_DEFINITIONS - Compiler switches required for using QGLViewer +# + +find_path(QGLVIEWER_INCLUDE_DIR + NAMES QGLViewer/qglviewer.h + PATHS /usr/include + /usr/local/include + ENV QGLVIEWERROOT + ) + +find_library(QGLVIEWER_LIBRARY_RELEASE + NAMES qglviewer-qt4 qglviewer QGLViewer QGLViewer2 + PATHS /usr/lib + /usr/local/lib + ENV QGLVIEWERROOT + ENV LD_LIBRARY_PATH + ENV LIBRARY_PATH + PATH_SUFFIXES QGLViewer QGLViewer/release + ) + +find_library(QGLVIEWER_LIBRARY_DEBUG + NAMES dqglviewer dQGLViewer dQGLViewer2 QGLViewerd2 + PATHS /usr/lib + /usr/local/lib + ENV QGLVIEWERROOT + ENV LD_LIBRARY_PATH + ENV LIBRARY_PATH + PATH_SUFFIXES QGLViewer QGLViewer/debug + ) + +if(QGLVIEWER_LIBRARY_RELEASE) + if(QGLVIEWER_LIBRARY_DEBUG) + set(QGLVIEWER_LIBRARIES_ optimized ${QGLVIEWER_LIBRARY_RELEASE} debug ${QGLVIEWER_LIBRARY_DEBUG}) + else() + set(QGLVIEWER_LIBRARIES_ ${QGLVIEWER_LIBRARY_RELEASE}) + endif() + + set(QGLVIEWER_LIBRARIES ${QGLVIEWER_LIBRARIES_} CACHE FILEPATH "The QGLViewer library") + +endif() + +IF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES) + SET(QGLVIEWER_FOUND TRUE) +ENDIF(QGLVIEWER_INCLUDE_DIR AND QGLVIEWER_LIBRARIES) + +IF(QGLVIEWER_FOUND) + IF(NOT QGLViewer_FIND_QUIETLY) + MESSAGE(STATUS "Found QGLViewer: ${QGLVIEWER_LIBRARIES}") + ENDIF(NOT QGLViewer_FIND_QUIETLY) +ELSE(QGLVIEWER_FOUND) + IF(QGLViewer_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find QGLViewer") + ENDIF(QGLViewer_FIND_REQUIRED) +ENDIF(QGLVIEWER_FOUND) + diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 83908905..315aa0ac 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -6,7 +6,8 @@ The Gudhi library (Geometric Understanding in Higher Dimensions) is a generic C++ library for topological analysis of high-dimensional data whose goal is to provide robust, efficient, flexible and easy to use implementations of -state-of-the-art algorithms and data structures for computational topology. +state-of-the-art algorithms and data structures for computational topology. +This library is part of the <a href="https://project.inria.fr/gudhi/">Gudhi project</a>. The current release of the library allows to use several data-structures for simplicial complexes : simplex tree, Hasse diagram or skeleton-blocker. Several operations can then be done on top of these @@ -17,48 +18,52 @@ We refer to \cite gudhilibrary_ICMS14 for a detailed description of the design of the library. +\section installation Gudhi installation + +As Gudhi is a header only library, there is no need to install the library. + +Examples of Gudhi headers inclusion can be found in \ref demos. + \section compiling Compiling -The library uses c++11 and requires Boost with version 1.48.0 or more recent : http://www.boost.org/. -It is a multiplaform library and compiles on Linux, Mac OSX and Visual Studio 2013. +The library uses c++11 and requires <a href="http://www.boost.org/">Boost</a> with version 1.48.0 or more recent. +It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2013. \subsection gmp GMP: The multi-field persistent homology algorithm requires GMP which is a free library for arbitrary-precision -arithmetic, operating on signed integers, rational numbers, and floating point numbers -The following examples require The GNU Multiple Precision Arithmetic Library (GMP) http://gmplib.org/ +arithmetic, operating on signed integers, rational numbers, and floating point numbers. + +The following examples require the <a href="http://gmplib.org/">GNU Multiple Precision Arithmetic Library</a> (GMP) and will not be built if GMP is not installed: - Persistent_cohomology/rips_multifield_persistence - Simplex_tree/simplex_tree_from_alpha_shapes_3 -Having GMP version 4.2 or higher installed is recommended. This library can be obtained from http://gmplib.org/ +Having GMP version 4.2 or higher installed is recommended. \subsection cgal CGAL: CGAL is a C++ library which provides easy access to efficient and reliable geometric algorithms. -The following example requires CGAL https://www.cgal.org/ and will not be built if CGAL is not installed: +The following example requires the <a href="http://www.cgal.org/">Computational Geometry Algorithms Library</a> (CGAL) +and will not be built if CGAL is not installed: - Simplex_tree/simplex_tree_from_alpha_shapes_3 Having CGAL version 4.4 or higher installed is recommended. The procedure to install this library according to your operating system is detailed here http://doc.cgal.org/latest/Manual/installation.html -\section demos Demos and Examples +\subsection demos Demos and examples -To build the library, run the following in a terminal: +To build the demos and libraries, run the following commands in a terminal: \verbatim cd /path-to-gudhi/ mkdir build cd build/ -cmake -DCMAKE_BUILD_TYPE=Release .. +cmake .. make \endverbatim - - - - \details \copyright GNU General Public License v3. |