From acdc965eb6c1dd14508bcd0e50025bb4f01319f8 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 23 Sep 2020 10:11:45 +0200 Subject: Add Gudhi/math.h for pi --- src/common/include/gudhi/math.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/common/include/gudhi/math.h (limited to 'src/common') diff --git a/src/common/include/gudhi/math.h b/src/common/include/gudhi/math.h new file mode 100644 index 00000000..f367bac2 --- /dev/null +++ b/src/common/include/gudhi/math.h @@ -0,0 +1,23 @@ +/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. + * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. + * Author(s): Vincent Rouvreau + * + * Copyright (C) 2020 Inria + * + * Modification(s): + * - YYYY/MM Author: Description of the modification + */ + +#ifndef MATH_H_ +#define MATH_H_ + +#include + +namespace Gudhi { + +// In wait of C++20 std::numbers::pi with #include +static constexpr double PI = boost::math::constants::pi(); + +} // namespace Gudhi + +#endif // MATH_H_ -- cgit v1.2.3 From 5db457afb8e3214bdd83bef51198b65e53267a8c Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 23 Sep 2020 10:12:22 +0200 Subject: Add coxeter on main page --- ...manifold_tracing_on_custom_function_example.png | Bin 0 -> 419483 bytes src/common/doc/main_page.md | 28 ++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/Coxeter_triangulation/doc/manifold_tracing_on_custom_function_example.png (limited to 'src/common') diff --git a/src/Coxeter_triangulation/doc/manifold_tracing_on_custom_function_example.png b/src/Coxeter_triangulation/doc/manifold_tracing_on_custom_function_example.png new file mode 100644 index 00000000..1edbadf5 Binary files /dev/null and b/src/Coxeter_triangulation/doc/manifold_tracing_on_custom_function_example.png differ diff --git a/src/common/doc/main_page.md b/src/common/doc/main_page.md index e19af537..c58b6994 100644 --- a/src/common/doc/main_page.md +++ b/src/common/doc/main_page.md @@ -135,7 +135,7 @@ -## Filtrations and reconstructions {#FiltrationsReconstructions} +## Filtrations ### Alpha complex @@ -298,6 +298,32 @@
+## Manifold reconstructions +### Coxeter triangulation + + + + + + + + + + +
+ \image html "manifold_tracing_on_custom_function_example.png" + + Coxeter triangulation module is designed to provide tools for constructing a piecewise-linear approximation of an + \f$m\f$-dimensional smooth manifold embedded in \f$ \mathbb{R}^d \f$ using an ambient triangulation. + + Author: Siargey Kachanovich
+ Introduced in: GUDHI 3.4.0
+ Copyright: MIT [(LGPL v3)](../../licensing/)
+ Requires: \ref cgal ≥ 4.11.0 +
+ User manual: \ref coxeter_triangulation +
+ ### Tangential complex -- cgit v1.2.3 From 29fa56b6768d7314fcddf39d7681aa6a82417b4e Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Wed, 21 Apr 2021 10:08:19 +0200 Subject: cell complex is only for coxeter. eigen is required for coxeter, not cgal --- src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h | 5 +++++ src/Coxeter_triangulation/include/gudhi/Cell_complex.h | 10 +++------- src/common/doc/main_page.md | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/common') diff --git a/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h b/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h index 3316bd81..99239e3a 100644 --- a/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h +++ b/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h @@ -166,6 +166,8 @@ The base function classes above can be composed or modified into new functions u The type of \f$T\f$ is required to be a model of the concept \ref Gudhi::coxeter_triangulation::TriangulationForManifoldTracing "TriangulationForManifoldTracing". +It is also possible to implement your own function as detailed in this \ref exampleswithcustomfunction. + \section cellcomplex Cell complex construction The output of the manifold tracing algorithm can be transformed into the Hasse diagram of a cell complex that @@ -194,6 +196,9 @@ triangulation. \li The method \ref Gudhi::coxeter_triangulation::Cell_complex::cell_point_map() "cell_point_map()" returns a map from the vertex cells in the cell complex to their Cartesian coordinates. +The use and interfaces of this \ref Gudhi::coxeter_triangulation::Cell_complex "Cell_complex" is limited to the +Coxeter_triangulation implementation. + \section example Examples \subsection examplewithoutboundaries Basic example without boundaries diff --git a/src/Coxeter_triangulation/include/gudhi/Cell_complex.h b/src/Coxeter_triangulation/include/gudhi/Cell_complex.h index b386e369..219f525b 100644 --- a/src/Coxeter_triangulation/include/gudhi/Cell_complex.h +++ b/src/Coxeter_triangulation/include/gudhi/Cell_complex.h @@ -25,18 +25,14 @@ namespace Gudhi { namespace coxeter_triangulation { -/** - * \ingroup coxeter_triangulation - */ - /** \class Cell_complex * \brief A class that constructs the cell complex from the output provided by the class - * Gudhi::Manifold_tracing. + * \ref Gudhi::coxeter_triangulation::Manifold_tracing. + * + * The use and interfaces of this cell complex is limited to the \ref coxeter_triangulation implementation. * * \tparam Out_simplex_map_ The type of a map from a simplex type that is a * model of SimplexInCoxeterTriangulation to Eigen::VectorXd. - * - * \ingroup coxeter_triangulation */ template class Cell_complex { diff --git a/src/common/doc/main_page.md b/src/common/doc/main_page.md index c58b6994..17354179 100644 --- a/src/common/doc/main_page.md +++ b/src/common/doc/main_page.md @@ -314,7 +314,7 @@ Author: Siargey Kachanovich
Introduced in: GUDHI 3.4.0
Copyright: MIT [(LGPL v3)](../../licensing/)
- Requires: \ref cgal ≥ 4.11.0 + Requires: \ref eigen ≥ 3.1.0
-- cgit v1.2.3 From 1d7011f32573bb617894a3f263e2537c1f3a8649 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Thu, 22 Apr 2021 09:28:45 +0200 Subject: Add examples in doc and removes TBB link as not required by coxeter --- src/Coxeter_triangulation/example/CMakeLists.txt | 9 --------- src/Coxeter_triangulation/test/CMakeLists.txt | 3 --- src/common/doc/examples.h | 3 +++ src/common/doc/installation.h | 8 ++++++++ 4 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/common') diff --git a/src/Coxeter_triangulation/example/CMakeLists.txt b/src/Coxeter_triangulation/example/CMakeLists.txt index 840e24e4..7f81c599 100644 --- a/src/Coxeter_triangulation/example/CMakeLists.txt +++ b/src/Coxeter_triangulation/example/CMakeLists.txt @@ -5,24 +5,15 @@ if (NOT EIGEN3_VERSION VERSION_LESS 3.1.0) if (NOT CGAL_VERSION VERSION_LESS 4.11.0) add_executable ( Coxeter_triangulation_manifold_tracing_flat_torus_with_boundary_example manifold_tracing_flat_torus_with_boundary.cpp ) target_link_libraries(Coxeter_triangulation_manifold_tracing_flat_torus_with_boundary_example ${CGAL_LIBRARY}) - if (TBB_FOUND) - target_link_libraries(Coxeter_triangulation_manifold_tracing_flat_torus_with_boundary_example ${TBB_LIBRARIES}) - endif() add_test(NAME Coxeter_triangulation_manifold_tracing_flat_torus_with_boundary_example COMMAND $) endif() add_executable ( Coxeter_triangulation_manifold_tracing_custom_function_example manifold_tracing_custom_function.cpp ) - if (TBB_FOUND) - target_link_libraries(Coxeter_triangulation_manifold_tracing_custom_function_example ${TBB_LIBRARIES}) - endif() add_test(NAME Coxeter_triangulation_manifold_tracing_custom_function_example COMMAND $) add_executable ( Coxeter_triangulation_cell_complex_from_basic_circle_manifold_example cell_complex_from_basic_circle_manifold.cpp ) - if (TBB_FOUND) - target_link_libraries(Coxeter_triangulation_cell_complex_from_basic_circle_manifold_example ${TBB_LIBRARIES}) - endif() add_test(NAME Coxeter_triangulation_cell_complex_from_basic_circle_manifold_example COMMAND $) endif() \ No newline at end of file diff --git a/src/Coxeter_triangulation/test/CMakeLists.txt b/src/Coxeter_triangulation/test/CMakeLists.txt index 3da2410f..74ded91e 100644 --- a/src/Coxeter_triangulation/test/CMakeLists.txt +++ b/src/Coxeter_triangulation/test/CMakeLists.txt @@ -26,8 +26,5 @@ if (NOT EIGEN3_VERSION VERSION_LESS 3.1.0) gudhi_add_boost_test(Coxeter_triangulation_manifold_tracing_test) add_executable ( Coxeter_triangulation_cell_complex_test cell_complex_test.cpp ) - if (TBB_FOUND) - target_link_libraries(Coxeter_triangulation_cell_complex_test ${TBB_LIBRARIES}) - endif() gudhi_add_boost_test(Coxeter_triangulation_cell_complex_test) endif() \ No newline at end of file diff --git a/src/common/doc/examples.h b/src/common/doc/examples.h index 474f8699..a8548f6a 100644 --- a/src/common/doc/examples.h +++ b/src/common/doc/examples.h @@ -92,5 +92,8 @@ * @example Persistence_representations/persistence_landscapes/create_landscapes.cpp * @example Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp * @example Persistence_representations/persistence_landscapes/plot_landscapes.cpp + * @example Coxeter_triangulation/cell_complex_from_basic_circle_manifold.cpp + * @example Coxeter_triangulation/manifold_tracing_custom_function.cpp + * @example Coxeter_triangulation/manifold_tracing_flat_torus_with_boundary.cpp */ diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h index c2e63a24..c0e36a59 100644 --- a/src/common/doc/installation.h +++ b/src/common/doc/installation.h @@ -125,6 +125,8 @@ make doxygen * Alpha_complex/Weighted_alpha_complex_3d_from_points.cpp * \li * Alpha_complex/alpha_complex_3d_persistence.cpp + * \li + * Coxeter_triangulation/manifold_tracing_flat_torus_with_boundary.cpp * * \subsection eigen Eigen * Some GUDHI modules (cf. \ref main_page "modules list"), and few examples require @@ -169,6 +171,12 @@ make doxygen * Witness_complex/example_witness_complex_off.cpp * \li * Witness_complex/example_witness_complex_sphere.cpp + * \li + * Coxeter_triangulation/cell_complex_from_basic_circle_manifold.cpp + * \li + * Coxeter_triangulation/manifold_tracing_custom_function.cpp + * \li + * Coxeter_triangulation/manifold_tracing_flat_torus_with_boundary.cpp * * \subsection tbb Threading Building Blocks * Intel® TBB lets you easily write parallel -- cgit v1.2.3 From 3a06eff2f6345133270ddc50b625139761c06df6 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Mon, 7 Jun 2021 17:59:27 +0200 Subject: Use boost pi and do not declare a gudhi one. cf. PR #480 --- .../gudhi/Functions/random_orthogonal_matrix.h | 6 +++--- src/common/include/gudhi/math.h | 23 ---------------------- 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 src/common/include/gudhi/math.h (limited to 'src/common') diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h b/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h index fbc1c895..6a896e94 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h @@ -15,8 +15,6 @@ #include // for std::cos, std::sin #include // for std::uniform_real_distribution, std::random_device -#include - #include #include #include @@ -24,6 +22,8 @@ #include #include +#include // for PI value + namespace Gudhi { namespace coxeter_triangulation { @@ -44,7 +44,7 @@ Eigen::MatrixXd random_orthogonal_matrix(std::size_t d) { if (d == 1) return Eigen::VectorXd::Constant(1, 1.0); if (d == 2) { // 0. < alpha < 2 Pi - std::uniform_real_distribution unif(0., 2 * Gudhi::PI); + std::uniform_real_distribution unif(0., 2 * boost::math::constants::pi()); std::random_device rand_dev; std::mt19937 rand_engine(rand_dev()); double alpha = unif(rand_engine); diff --git a/src/common/include/gudhi/math.h b/src/common/include/gudhi/math.h deleted file mode 100644 index f367bac2..00000000 --- a/src/common/include/gudhi/math.h +++ /dev/null @@ -1,23 +0,0 @@ -/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. - * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. - * Author(s): Vincent Rouvreau - * - * Copyright (C) 2020 Inria - * - * Modification(s): - * - YYYY/MM Author: Description of the modification - */ - -#ifndef MATH_H_ -#define MATH_H_ - -#include - -namespace Gudhi { - -// In wait of C++20 std::numbers::pi with #include -static constexpr double PI = boost::math::constants::pi(); - -} // namespace Gudhi - -#endif // MATH_H_ -- cgit v1.2.3