From f891467fe38d7757aa3d92705ca99e847cdd68d9 Mon Sep 17 00:00:00 2001 From: skachano Date: Fri, 18 Nov 2016 16:07:44 +0000 Subject: Modified doc git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1760 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d4e7410ecfdd7ae8867ce3e95e69e1e83948b579 --- src/common/doc/main_page.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 21cf6925..0b5588da 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -337,7 +337,9 @@ make \endverbatim * @example Skeleton_blocker/Skeleton_blocker_from_simplices.cpp * @example Skeleton_blocker/Skeleton_blocker_iteration.cpp * @example Skeleton_blocker/Skeleton_blocker_link.cpp - * @example Witness_complex/witness_complex_from_file.cpp - * @example Witness_complex/witness_complex_sphere.cpp + * @example Witness_complex/example_strong_witness_persistence.cpp + * @example Witness_complex/example_witness_complex_off.cpp + * @example Witness_complex/example_witness_complex_persistence.cpp + * @example Witness_complex/example_witness_complex_sphere.cpp */ -- cgit v1.2.3 From fc7c627592b44a147e0b213733c953f6a9a4755f Mon Sep 17 00:00:00 2001 From: skachano Date: Mon, 30 Jan 2017 12:10:46 +0000 Subject: Added a new example with strong and modified the example list git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2024 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d49228f33f30b022677bd9d3d3da06ab3214e9f3 --- src/Witness_complex/example/CMakeLists.txt | 1 + src/common/doc/main_page.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src/common') diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index 2bae07d9..320f3fba 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -6,6 +6,7 @@ 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 ) + add_executable( Witness_complex_example_strong_off example_strong_witness_complex_off.cpp ) add_executable ( Witness_complex_example_sphere example_witness_complex_sphere.cpp ) add_executable ( Witness_complex_example_witness_persistence example_witness_complex_persistence.cpp ) diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 9fed4106..5fb75002 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -386,6 +386,8 @@ make \endverbatim * @example Skeleton_blocker/Skeleton_blocker_link.cpp * @example Tangential_complex/example_basic.cpp * @example Tangential_complex/example_with_perturb.cpp + * @example Witness_complex/example_nearest_landmark_table.cpp + * @example Witness_complex/example_strong_witness_complex_off.cpp * @example Witness_complex/example_strong_witness_persistence.cpp * @example Witness_complex/example_witness_complex_off.cpp * @example Witness_complex/example_witness_complex_persistence.cpp -- cgit v1.2.3 From 5709f808d1a3cf0960cccd4c91a2ffde44a5867b Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 28 Feb 2017 10:14:41 +0000 Subject: Move -DBOOST_ALL_DYN_LINK from persistence to global CMakeLists.txt (also required by witness) Add CGAL and Eigen3 required by Witness in main page Add examples to be tested for Witness git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2115 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 33fbdf3e970c35635ae2738c1ace801f077ec750 --- CMakeLists.txt | 2 + src/CMakeLists.txt | 2 + .../concept/SimplicialComplexForWitness.h | 100 +++++++++++++++++++++ .../concept/Simplicial_complex_for_witness.h | 100 --------------------- src/Witness_complex/example/CMakeLists.txt | 10 ++- src/common/doc/main_page.h | 2 + 6 files changed, 115 insertions(+), 101 deletions(-) create mode 100644 src/Witness_complex/concept/SimplicialComplexForWitness.h delete mode 100644 src/Witness_complex/concept/Simplicial_complex_for_witness.h (limited to 'src/common') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1346f5d9..a71ad829 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,8 @@ else() add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) # BOOST ISSUE with Libraries name resolution under Windows add_definitions(-DBOOST_ALL_NO_LIB) + # problem with Visual Studio link on Boost program_options + add_definitions( -DBOOST_ALL_DYN_LINK ) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb349052..5430f9f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -90,6 +90,8 @@ else() add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) # BOOST ISSUE with Libraries name resolution under Windows add_definitions(-DBOOST_ALL_NO_LIB) + # problem with Visual Studio link on Boost program_options + add_definitions( -DBOOST_ALL_DYN_LINK ) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) diff --git a/src/Witness_complex/concept/SimplicialComplexForWitness.h b/src/Witness_complex/concept/SimplicialComplexForWitness.h new file mode 100644 index 00000000..d78cc83f --- /dev/null +++ b/src/Witness_complex/concept/SimplicialComplexForWitness.h @@ -0,0 +1,100 @@ +/* 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) 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 + * 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 CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ +#define CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ + +namespace Gudhi { + +namespace witness_complex { + +/** \brief The concept SimplicialComplexForWitness describes the requirements + * for a type to implement a simplicial complex, + * used for example to build a Witness_complex or Strong_witness_complex. + */ +struct SimplicialComplexForWitness { + /** Handle to specify a simplex. */ + typedef unspecified Simplex_handle; + // /** Handle to specify a vertex. Must be a non-negative integer. */ + // typedef unspecified Vertex_handle; + + /** \brief Returns a Simplex_hanlde that is different from all simplex handles + * of the simplices. */ + Simplex_handle null_simplex(); + + /** Returns the number of vertices in the simplicial complex + */ + std::size_t num_vertices(); + + /** \brief Return type of an insertion of a simplex + */ + typedef unspecified Insertion_result_type; + + /** \brief Inserts a simplex with vertices from a given range + * 'vertex_range' in the simplicial complex. + * The function is only used in Witness_complex class + * and by construction, it is not necessary to check if + * the faces are in the simplicial complex before insertion. + * The simplex is given the filtration value 'filtration'. + * Filtration_value should be convertible from double. + * The return type is not used. + * */ + template< typedef Input_vertex_range > + Insertion_result_type insert_simplex(Input_vertex_range const & vertex_range, Filtration_value filtration); + + /** \brief Inserts a simplex and all its faces + * with vertices from a given range + * 'vertex_range' in the simplicial complex. + * The function is only used in Strong_witness_complex class. + * All inserted simplices are given the filtration + * value 'filtration'. + * Filtration_value should be convertible from double. + * The return type is not used. + */ + + template< typedef Input_vertex_range, + typedef Filtration_value> + Insertion_result_type insert_simplex_and_subfaces(Input_vertex_range const & vertex_range, Filtration_value filtration); + + /** \brief Finds a simplex with vertices given by a range + * + * If a simplex exists, its Simplex_handle is returned. + * Otherwise null_simplex() is returned. */ + template< typedef Input_vertex_range > + Simplex_handle find(Input_vertex_range const & vertex_range); + + /** \brief Sets the dimension of the simplicial complex to + * 'dimension'. + */ + void set_dimension(int dimension); + + /** \brief Returns the filtration of the simplex given by + * the simplex handle 'sh'. + */ + double filtration(Simplex_handle sh); +}; + +} // namespace witness_complex + +} // namespace Gudhi + +#endif // CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ diff --git a/src/Witness_complex/concept/Simplicial_complex_for_witness.h b/src/Witness_complex/concept/Simplicial_complex_for_witness.h deleted file mode 100644 index d78cc83f..00000000 --- a/src/Witness_complex/concept/Simplicial_complex_for_witness.h +++ /dev/null @@ -1,100 +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) 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 - * 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 CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ -#define CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ - -namespace Gudhi { - -namespace witness_complex { - -/** \brief The concept SimplicialComplexForWitness describes the requirements - * for a type to implement a simplicial complex, - * used for example to build a Witness_complex or Strong_witness_complex. - */ -struct SimplicialComplexForWitness { - /** Handle to specify a simplex. */ - typedef unspecified Simplex_handle; - // /** Handle to specify a vertex. Must be a non-negative integer. */ - // typedef unspecified Vertex_handle; - - /** \brief Returns a Simplex_hanlde that is different from all simplex handles - * of the simplices. */ - Simplex_handle null_simplex(); - - /** Returns the number of vertices in the simplicial complex - */ - std::size_t num_vertices(); - - /** \brief Return type of an insertion of a simplex - */ - typedef unspecified Insertion_result_type; - - /** \brief Inserts a simplex with vertices from a given range - * 'vertex_range' in the simplicial complex. - * The function is only used in Witness_complex class - * and by construction, it is not necessary to check if - * the faces are in the simplicial complex before insertion. - * The simplex is given the filtration value 'filtration'. - * Filtration_value should be convertible from double. - * The return type is not used. - * */ - template< typedef Input_vertex_range > - Insertion_result_type insert_simplex(Input_vertex_range const & vertex_range, Filtration_value filtration); - - /** \brief Inserts a simplex and all its faces - * with vertices from a given range - * 'vertex_range' in the simplicial complex. - * The function is only used in Strong_witness_complex class. - * All inserted simplices are given the filtration - * value 'filtration'. - * Filtration_value should be convertible from double. - * The return type is not used. - */ - - template< typedef Input_vertex_range, - typedef Filtration_value> - Insertion_result_type insert_simplex_and_subfaces(Input_vertex_range const & vertex_range, Filtration_value filtration); - - /** \brief Finds a simplex with vertices given by a range - * - * If a simplex exists, its Simplex_handle is returned. - * Otherwise null_simplex() is returned. */ - template< typedef Input_vertex_range > - Simplex_handle find(Input_vertex_range const & vertex_range); - - /** \brief Sets the dimension of the simplicial complex to - * 'dimension'. - */ - void set_dimension(int dimension); - - /** \brief Returns the filtration of the simplex given by - * the simplex handle 'sh'. - */ - double filtration(Simplex_handle sh); -}; - -} // namespace witness_complex - -} // namespace Gudhi - -#endif // CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index 320f3fba..c18d59d2 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -22,12 +22,20 @@ if(CGAL_FOUND) target_link_libraries(Witness_complex_example_nearest_landmark_table ${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_test_torus_persistence + add_test(Witness_complex_strong_test_torus_persistence ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_witness_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5) + add_test(Witness_complex_test_nearest_landmark_table Witness_complex_example_nearest_landmark_table) endif(EIGEN3_FOUND) endif (NOT CGAL_VERSION VERSION_LESS 4.6.0) endif() diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 116aba09..e6323628 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -120,6 +120,7 @@ Author: Clément Jamin
Introduced in: GUDHI 1.4.0
Copyright: GPL v3
+ Requires: \ref cgal ≥ 4.8.0 and \ref eigen3 A Tangential Delaunay complex is a simplicial complex @@ -139,6 +140,7 @@ Author: Siargey Kachanovich
Introduced in: GUDHI 1.3.0
Copyright: GPL v3
+ Requires: \ref cgal ≥ 4.6.0 and \ref eigen3 Witness complex \f$ Wit(W,L) \f$ is a simplicial complex defined on two sets of points in \f$\mathbb{R}^D\f$. -- cgit v1.2.3 From 8de27e00ad080e6616928641baf704cfbe318976 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Wed, 1 Mar 2017 06:13:11 +0000 Subject: Only Euclidean version of Witness requires CGAL and Eigen3 git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2123 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ca4c8174eb5dc4787113659f5289104af2515bcd --- src/Witness_complex/example/CMakeLists.txt | 9 ++++++--- src/common/doc/main_page.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index c18d59d2..2691479d 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -1,7 +1,13 @@ cmake_minimum_required(VERSION 2.6) project(Witness_complex_examples) +add_executable ( Witness_complex_example_nearest_landmark_table example_nearest_landmark_table.cpp ) +if (TBB_FOUND) + target_link_libraries(Witness_complex_example_nearest_landmark_table ${TBB_LIBRARIES}) +endif() +add_test(Witness_complex_test_nearest_landmark_table Witness_complex_example_nearest_landmark_table) +# 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) @@ -15,11 +21,9 @@ if(CGAL_FOUND) add_executable ( Witness_complex_example_strong_witness_persistence example_strong_witness_persistence.cpp ) target_link_libraries(Witness_complex_example_strong_witness_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY}) - add_executable ( Witness_complex_example_nearest_landmark_table example_nearest_landmark_table.cpp ) if (TBB_FOUND) target_link_libraries(Witness_complex_example_witness_persistence ${TBB_LIBRARIES}) target_link_libraries(Witness_complex_example_strong_witness_persistence ${TBB_LIBRARIES}) - target_link_libraries(Witness_complex_example_nearest_landmark_table ${TBB_LIBRARIES}) endif() add_test(Witness_complex_off_test_torus @@ -35,7 +39,6 @@ if(CGAL_FOUND) add_test(Witness_complex_strong_test_torus_persistence ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_example_strong_witness_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off -l 20 -a 0.5) - add_test(Witness_complex_test_nearest_landmark_table Witness_complex_example_nearest_landmark_table) endif(EIGEN3_FOUND) endif (NOT CGAL_VERSION VERSION_LESS 4.6.0) endif() diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index e6323628..5ca0a6bc 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -140,7 +140,7 @@ Author: Siargey Kachanovich
Introduced in: GUDHI 1.3.0
Copyright: GPL v3
- Requires: \ref cgal ≥ 4.6.0 and \ref eigen3 + Euclidean version requires: \ref cgal ≥ 4.6.0 and \ref eigen3 Witness complex \f$ Wit(W,L) \f$ is a simplicial complex defined on two sets of points in \f$\mathbb{R}^D\f$. -- cgit v1.2.3