From be7555abfb97f02c37de96736f7a0993d4d47f03 Mon Sep 17 00:00:00 2001
From: ROUVREAU Vincent
Date: Tue, 22 Sep 2020 18:12:31 +0200
Subject: clang-format files
---
.../concept/FunctionForImplicitManifold.h | 12 +-
.../concept/IntersectionOracle.h | 49 +-
.../concept/SimplexInCoxeterTriangulation.h | 21 +-
.../concept/TriangulationForManifoldTracing.h | 17 +-
.../doc/intro_coxeter_triangulation.h | 39 +-
.../example/manifold_tracing_custom_function.cpp | 35 +-
.../manifold_tracing_flat_torus_with_boundary.cpp | 25 +-
.../include/gudhi/Cell_complex.h | 178 +++----
.../gudhi/Cell_complex/Hasse_diagram_cell.h | 509 ++++++++++-----------
.../include/gudhi/Coxeter_triangulation.h | 38 +-
.../include/gudhi/Freudenthal_triangulation.h | 129 +++---
.../include/gudhi/Functions/Cartesian_product.h | 82 ++--
.../include/gudhi/Functions/Constant_function.h | 26 +-
.../include/gudhi/Functions/Embed_in_Rd.h | 37 +-
.../include/gudhi/Functions/Function.h | 8 +-
.../include/gudhi/Functions/Function_Sm_in_Rd.h | 78 ++--
.../gudhi/Functions/Function_affine_plane_in_Rd.h | 57 +--
.../include/gudhi/Functions/Function_chair_in_R3.h | 43 +-
.../include/gudhi/Functions/Function_iron_in_R3.h | 32 +-
.../Function_lemniscate_revolution_in_R3.h | 47 +-
.../gudhi/Functions/Function_moment_curve_in_Rd.h | 43 +-
.../include/gudhi/Functions/Function_torus_in_R3.h | 36 +-
.../Functions/Function_whitney_umbrella_in_R3.h | 41 +-
.../gudhi/Functions/Linear_transformation.h | 29 +-
.../include/gudhi/Functions/Negation.h | 26 +-
.../include/gudhi/Functions/PL_approximation.h | 59 +--
.../include/gudhi/Functions/Translate.h | 30 +-
.../gudhi/Functions/random_orthogonal_matrix.h | 35 +-
.../include/gudhi/IO/Mesh_medit.h | 12 +-
.../gudhi/IO/build_mesh_from_cell_complex.h | 127 +++--
.../include/gudhi/IO/output_debug_traces_to_html.h | 390 +++++++---------
.../include/gudhi/IO/output_meshes_to_medit.h | 147 +++---
.../gudhi/Implicit_manifold_intersection_oracle.h | 152 +++---
.../include/gudhi/Manifold_tracing.h | 148 +++---
.../include/gudhi/Permutahedral_representation.h | 138 ++----
.../Combination_iterator.h | 60 +--
.../Integer_combination_iterator.h | 61 +--
.../Ordered_set_partition_iterator.h | 56 +--
.../Permutahedral_representation_iterators.h | 185 ++++----
.../Permutation_iterator.h | 73 ++-
.../Set_partition_iterator.h | 81 ++--
.../Simplex_comparator.h | 36 +-
.../Permutahedral_representation/Size_range.h | 40 +-
.../face_from_indices.h | 59 ++-
.../include/gudhi/Query_result.h | 6 +-
.../test/cell_complex_test.cpp | 19 +-
.../test/freud_triang_test.cpp | 55 ++-
src/Coxeter_triangulation/test/function_test.cpp | 43 +-
.../test/manifold_tracing_test.cpp | 28 +-
src/Coxeter_triangulation/test/oracle_test.cpp | 16 +-
src/Coxeter_triangulation/test/perm_rep_test.cpp | 23 +-
51 files changed, 1593 insertions(+), 2123 deletions(-)
diff --git a/src/Coxeter_triangulation/concept/FunctionForImplicitManifold.h b/src/Coxeter_triangulation/concept/FunctionForImplicitManifold.h
index 15d74860..210d804e 100644
--- a/src/Coxeter_triangulation/concept/FunctionForImplicitManifold.h
+++ b/src/Coxeter_triangulation/concept/FunctionForImplicitManifold.h
@@ -11,16 +11,19 @@
#ifndef CONCEPT_COXETER_TRIANGULATION_FUNCTION_FOR_IMPLICIT_MANIFOLD_H_
#define CONCEPT_COXETER_TRIANGULATION_FUNCTION_FOR_IMPLICIT_MANIFOLD_H_
+#include // for std::size_t
+
+#include
+
namespace Gudhi {
namespace coxeter_triangulation {
-/** \brief The concept FunctionForImplicitManifold describes the requirements
+/** \brief The concept FunctionForImplicitManifold describes the requirements
* for a type to implement an implicit function class used for example in Manifold_tracing.
*/
struct FunctionForImplicitManifold {
-
- /** \brief Value of the function at a specified point 'p'.
+ /** \brief Value of the function at a specified point 'p'.
* @param[in] p The input point given by its Cartesian coordinates.
* Its size needs to be equal to amb_d().
*/
@@ -28,7 +31,7 @@ struct FunctionForImplicitManifold {
/** \brief Returns the domain (ambient) dimension. */
std::size_t amb_d() const;
-
+
/** \brief Returns the codomain dimension. */
std::size_t cod_d() const;
@@ -40,5 +43,4 @@ struct FunctionForImplicitManifold {
} // namespace Gudhi
-
#endif
diff --git a/src/Coxeter_triangulation/concept/IntersectionOracle.h b/src/Coxeter_triangulation/concept/IntersectionOracle.h
index 1427460b..e4e397fa 100644
--- a/src/Coxeter_triangulation/concept/IntersectionOracle.h
+++ b/src/Coxeter_triangulation/concept/IntersectionOracle.h
@@ -11,19 +11,22 @@
#ifndef CONCEPT_COXETER_TRIANGULATION_INTERSECTION_ORACLE_H_
#define CONCEPT_COXETER_TRIANGULATION_INTERSECTION_ORACLE_H_
+#include // for std::size_t
+
+#include
+
namespace Gudhi {
namespace coxeter_triangulation {
-/** \brief The concept IntersectionOracle describes the requirements
+/** \brief The concept IntersectionOracle describes the requirements
* for a type to implement an intersection oracle class used for example in Manifold_tracing.
*
*/
struct IntersectionOracle {
-
/** \brief Returns the domain (ambient) dimension of the underlying manifold. */
std::size_t amb_d() const;
-
+
/** \brief Returns the codomain dimension of the underlying manifold. */
std::size_t cod_d() const;
@@ -32,48 +35,45 @@ struct IntersectionOracle {
* \details The returned structure Query_result contains the boolean value
* that is true only if the intersection point of the query simplex and
* the relative interior of the manifold exists, the intersection point
- * and the face of the query simplex that contains
+ * and the face of the query simplex that contains
* the intersection point.
- *
+ *
* \tparam Simplex_handle The class of the query simplex.
* Needs to be a model of the concept SimplexInCoxeterTriangulation.
* \tparam Triangulation The class of the triangulation.
* Needs to be a model of the concept TriangulationForManifoldTracing.
- *
+ *
* @param[in] simplex The query simplex. The dimension of the simplex
- * should be the same as the codimension of the manifold
+ * should be the same as the codimension of the manifold
* (the codomain dimension of the function).
- * @param[in] triangulation The ambient triangulation. The dimension of
- * the triangulation should be the same as the ambient dimension of the manifold
+ * @param[in] triangulation The ambient triangulation. The dimension of
+ * the triangulation should be the same as the ambient dimension of the manifold
* (the domain dimension of the function).
*/
- template
- Query_result intersects(const Simplex_handle& simplex,
- const Triangulation& triangulation) const;
+ template
+ Query_result intersects(const Simplex_handle& simplex, const Triangulation& triangulation) const;
/** \brief Intersection query with the boundary of the manifold.
- *
+ *
* \details The returned structure Query_result contains the boolean value
* that is true only if the intersection point of the query simplex and
* the boundary of the manifold exists, the intersection point
- * and the face of the query simplex that contains
+ * and the face of the query simplex that contains
* the intersection point.
- *
+ *
* \tparam Simplex_handle The class of the query simplex.
* Needs to be a model of the concept SimplexInCoxeterTriangulation.
* \tparam Triangulation The class of the triangulation.
* Needs to be a model of the concept TriangulationForManifoldTracing.
*
* @param[in] simplex The query simplex. The dimension of the simplex
- * should be the same as the codimension of the boundary of the manifold
+ * should be the same as the codimension of the boundary of the manifold
* (the codomain dimension of the function + 1).
- * @param[in] triangulation The ambient triangulation. The dimension of
- * the triangulation should be the same as the ambient dimension of the manifold
+ * @param[in] triangulation The ambient triangulation. The dimension of
+ * the triangulation should be the same as the ambient dimension of the manifold
* (the domain dimension of the function).
*/
- template
+ template
Query_result intersects_boundary(const Simplex_handle& simplex,
const Triangulation& triangulation) const;
@@ -84,24 +84,21 @@ struct IntersectionOracle {
* @param p The input point. Needs to have the same dimension as the ambient
* dimension of the manifold (the domain dimension of the function).
* @param triangulation The ambient triangulation. Needs to have the same
- * dimension as the ambient dimension of the manifold
+ * dimension as the ambient dimension of the manifold
* (the domain dimension of the function).
*/
template
- bool lies_in_domain(const Eigen::VectorXd& p,
- const Triangulation& triangulation) const {
+ bool lies_in_domain(const Eigen::VectorXd& p, const Triangulation& triangulation) const {
Eigen::VectorXd pl_p = make_pl_approximation(domain_fun_, triangulation)(p);
return pl_p(0) < 0;
}
/** \brief Returns the function that defines the interior of the manifold */
const Function_& function() const;
-
};
} // namespace coxeter_triangulation
} // namespace Gudhi
-
#endif
diff --git a/src/Coxeter_triangulation/concept/SimplexInCoxeterTriangulation.h b/src/Coxeter_triangulation/concept/SimplexInCoxeterTriangulation.h
index bb2451ff..dac8e66d 100644
--- a/src/Coxeter_triangulation/concept/SimplexInCoxeterTriangulation.h
+++ b/src/Coxeter_triangulation/concept/SimplexInCoxeterTriangulation.h
@@ -11,19 +11,22 @@
#ifndef CONCEPT_COXETER_TRIANGULATION_SIMPLEX_IN_COXETER_TRIANGULATION_H_
#define CONCEPT_COXETER_TRIANGULATION_SIMPLEX_IN_COXETER_TRIANGULATION_H_
+#include // for std::size_t
+
+#include
+
namespace Gudhi {
namespace coxeter_triangulation {
-/** \brief The concept SimplexInCoxeterTriangulation describes the requirements
+/** \brief The concept SimplexInCoxeterTriangulation describes the requirements
* for a type to implement a representation of simplices in Freudenthal_triangulation
* or in Coxeter_triangulation.
*/
struct SimplexInCoxeterTriangulation {
-
/** \brief Type of the vertex. */
typedef Vertex_ Vertex;
-
+
/** \brief Type of the ordered partition. */
typedef Ordered_set_partition_ OrderedSetPartition;
@@ -32,13 +35,13 @@ struct SimplexInCoxeterTriangulation {
/** \brief Type of a range of vertices, each of type Vertex. */
typedef Vertex_range;
-
+
/** \brief Returns a range of vertices of the simplex.
*/
Vertex_range vertex_range() const;
- /** \brief Type of a range of faces, each of type that
- * is a model of the concept SimplexInCoxeterTriangulation.
+ /** \brief Type of a range of faces, each of type that
+ * is a model of the concept SimplexInCoxeterTriangulation.
*/
typedef Face_range;
@@ -52,8 +55,8 @@ struct SimplexInCoxeterTriangulation {
*/
Face_range facet_range() const;
- /** \brief Type of a range of cofaces, each of type that
- * is a model of the concept SimplexInCoxeterTriangulation.
+ /** \brief Type of a range of cofaces, each of type that
+ * is a model of the concept SimplexInCoxeterTriangulation.
*/
typedef Coface_range;
@@ -69,12 +72,10 @@ struct SimplexInCoxeterTriangulation {
/** \brief Returns true, if the simplex is a face of other simplex. */
bool is_face_of(const Permutahedral_representation& other) const;
-
};
} // namespace coxeter_triangulation
} // namespace Gudhi
-
#endif
diff --git a/src/Coxeter_triangulation/concept/TriangulationForManifoldTracing.h b/src/Coxeter_triangulation/concept/TriangulationForManifoldTracing.h
index 4f3d4411..2b5d568c 100644
--- a/src/Coxeter_triangulation/concept/TriangulationForManifoldTracing.h
+++ b/src/Coxeter_triangulation/concept/TriangulationForManifoldTracing.h
@@ -11,23 +11,24 @@
#ifndef CONCEPT_COXETER_TRIANGULATION_TRIANGULATION_FOR_MANIFOLD_TRACING_H_
#define CONCEPT_COXETER_TRIANGULATION_TRIANGULATION_FOR_MANIFOLD_TRACING_H_
+#include
+
namespace Gudhi {
namespace coxeter_triangulation {
-/** \brief The concept TriangulationForManifoldTracing describes the requirements
+/** \brief The concept TriangulationForManifoldTracing describes the requirements
* for a type to implement a triangulation class used for example in Manifold_tracing.
*/
struct TriangulationForManifoldTracing {
-
- /** \brief Type of the simplices in the triangulation.
+ /** \brief Type of the simplices in the triangulation.
* Needs to be a model of the concept SimplexInCoxeterTriangulation. */
typedef Simplex_handle;
- /** \brief Type of the vertices in the triangulation.
+ /** \brief Type of the vertices in the triangulation.
* Needs to be a random-access range of integer values. */
typedef Vertex_handle;
-
+
/** \brief Returns the permutahedral representation of the simplex in the
* triangulation that contains a given query point 'p'.
* \tparam Point_d A class that represents a point in d-dimensional Euclidean space.
@@ -37,21 +38,19 @@ struct TriangulationForManifoldTracing {
template
Simplex_handle locate_point(const Point_d& point) const;
- /** \brief Returns the Cartesian coordinates of the given vertex 'v'.
+ /** \brief Returns the Cartesian coordinates of the given vertex 'v'.
* @param[in] v The input vertex.
*/
Eigen::VectorXd cartesian_coordinates(const Vertex_handle& v) const;
- /** \brief Returns the Cartesian coordinates of the barycenter of a given simplex 's'.
+ /** \brief Returns the Cartesian coordinates of the barycenter of a given simplex 's'.
* @param[in] s The input simplex given by permutahedral representation.
*/
Eigen::VectorXd barycenter(const Simplex_handle& s) const;
-
};
} // namespace coxeter_triangulation
} // namespace Gudhi
-
#endif
diff --git a/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h b/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h
index c883d904..5eb0cb22 100644
--- a/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h
+++ b/src/Coxeter_triangulation/doc/intro_coxeter_triangulation.h
@@ -13,7 +13,7 @@
// needs namespaces for Doxygen to link on classes
namespace Gudhi {
-namespace tangential_complex {
+namespace coxeter_triangulation {
/** \defgroup coxeter_triangulation Coxeter triangulation
@@ -42,13 +42,11 @@ manifold.
There are two methods that execute the manifold tracing algorithm: the method
\ref Gudhi::coxeter_triangulation::Manifold_tracing::manifold_tracing_algorithm() "Manifold_tracing::manifold_tracing_algorithm(seed_points, triangulation, oracle, out_simplex_map)"
for manifolds without boundary and
-\ref Gudhi::coxeter_triangulation::Manifold_tracing::manifold_tracing_algorithm() "Manifold_tracing::manifold_tracing_algorithm(seed_points, triangulation, oracle, interior_simplex_map, boundary_simplex_map)"
-for manifolds with boundary.
-The algorithm functions as follows.
-It starts at the specified seed points and inserts a \f$(d-m)\f$-dimensional simplices nearby each seed point that
-intersect the manifold into the output.
-Starting from this simplex, the algorithm propagates the search for other \f$(d-m)\f$-dimensional simplices that
-intersect the manifold by marching from a simplex to neighbouring simplices via their common cofaces.
+\ref Gudhi::coxeter_triangulation::Manifold_tracing::manifold_tracing_algorithm() "Manifold_tracing::manifold_tracing_algorithm(seed_points, triangulation, oracle, interior_simplex_map,boundary_simplex_map)"
+for manifolds with boundary. The algorithm functions as follows. It starts at the specified seed points and inserts a
+\f$(d-m)\f$-dimensional simplices nearby each seed point that intersect the manifold into the output. Starting from
+this simplex, the algorithm propagates the search for other \f$(d-m)\f$-dimensional simplices that intersect the
+manifold by marching from a simplex to neighbouring simplices via their common cofaces.
This class \ref Gudhi::coxeter_triangulation::Manifold_tracing "Manifold_tracing" has one template parameter
`Triangulation_` which specifies the ambient triangulation which is used by the algorithm.
@@ -59,16 +57,15 @@ The module also provides two static methods:
\ref Gudhi::coxeter_triangulation::manifold_tracing_algorithm() "manifold_tracing_algorithm(seed_points, triangulation, oracle, out_simplex_map)"
for manifolds without boundary and
\ref manifold_tracing_algorithm() "manifold_tracing_algorithm(seed_points, triangulation, oracle, interior_simplex_map, boundary_simplex_map)"
-for manifolds with boundary.
-For these static methods it is not necessary to specify any template arguments.
+for manifolds with boundary. For these static methods it is not necessary to specify any template arguments.
\section ambienttriangulations Ambient triangulations
The ambient triangulations supported by the manifold tracing algorithm have to be models of the concept
-\ref Gudhi::coxeter_triangulation::TriangulationForManifoldTracing "TriangulationForManifoldTracing".
+\ref Gudhi::coxeter_triangulation::TriangulationForManifoldTracing "TriangulationForManifoldTracing".
This module offers two such models: the class
\ref Gudhi::coxeter_triangulation::Freudenthal_triangulation "Freudenthal_triangulation" and the derived class
-\ref Gudhi::coxeter_triangulation::Coxeter_triangulation "Coxeter_triangulation".
+\ref Gudhi::coxeter_triangulation::Coxeter_triangulation "Coxeter_triangulation".
Both these classes encode affine transformations of the so-called Freudenthal-Kuhn triangulation of \f$\mathbb{R}^d\f$.
The Freudenthal-Kuhn triangulation of \f$\mathbb{R}^d\f$ is defined as the simplicial subdivision of the unit cubic
@@ -77,13 +74,13 @@ Each simplex is encoded using the permutahedral representation, which consists o
positions the simplex in a specific cube in the cubical partition and an ordered partition \f$\omega\f$ of the set
\f$\{1,\ldots,d+1\}\f$, which positions the simplex in the simplicial subdivision of the cube.
The default constructor
-\ref Gudhi::coxeter_triangulation::Freudenthal_triangulation::Freudenthal_triangulation(std::size_t) "Freudenthal_triangulation(d)"
-the Freudenthal-Kuhn triangulation of \f$\mathbb{R}^d\f$.
-The class \ref Gudhi::coxeter_triangulation::Freudenthal_triangulation "Freudenthal_triangulation" can also encode any
-affine transformation of the Freudenthal-Kuhn triangulation of \f$\mathbb{R}^d\f$ using an invertible matrix
-\f$\Lambda\f$ and an offset vector \f$b\f$ that can be specified in the constructor and which can be changed using the
-methods change_matrix and change_offset.
-The class \ref Gudhi::coxeter_triangulation::Coxeter_triangulation "Coxeter_triangulation" is derived from
+\ref Gudhi::coxeter_triangulation::Freudenthal_triangulation::Freudenthal_triangulation(std::size_t)
+"Freudenthal_triangulation(d)" the Freudenthal-Kuhn triangulation of \f$\mathbb{R}^d\f$. The class
+\ref Gudhi::coxeter_triangulation::Freudenthal_triangulation "Freudenthal_triangulation" can also encode any affine
+transformation of the Freudenthal-Kuhn triangulation of \f$\mathbb{R}^d\f$ using an invertible matrix \f$\Lambda\f$ and
+an offset vector \f$b\f$ that can be specified in the constructor and which can be changed using the methods
+change_matrix and change_offset. The class
+\ref Gudhi::coxeter_triangulation::Coxeter_triangulation "Coxeter_triangulation" is derived from
\ref Gudhi::coxeter_triangulation::Freudenthal_triangulation "Freudenthal_triangulation" and its default constructor
\ref Gudhi::coxeter_triangulation::Coxeter_triangulation::Coxeter_triangulation(std::size_t) "Coxeter_triangulation(d)"
builds a Coxeter triangulation of type \f$\tilde{A}_d\f$, which has the best simplex quality of all linear
@@ -108,8 +105,8 @@ The function \f$F\f$ is given by a class which is a model of the concept
\ref Gudhi::coxeter_triangulation::FunctionForImplicitManifold "FunctionForImplicitManifold".
There are multiple function classes that are already implemented in this module.
-\li \ref Gudhi::coxeter_triangulation::Constant_function(std::size_t, std::size_t, Eigen::VectorXd) "Constant_function(d,k,v)"
- defines a constant function \f$F\f$ such that for all \f$x \in \mathbb{R}^d\f$, we have
+\li \ref Gudhi::coxeter_triangulation::Constant_function(std::size_t, std::size_t, Eigen::VectorXd)
+"Constant_function(d,k,v)" defines a constant function \f$F\f$ such that for all \f$x \in \mathbb{R}^d\f$, we have
\f$F(x) = v \in \mathbb{R}^k\f$.
The class Constant_function does not define an implicit manifold, but is useful as the domain function when defining
boundaryless implicit manifolds.
diff --git a/src/Coxeter_triangulation/example/manifold_tracing_custom_function.cpp b/src/Coxeter_triangulation/example/manifold_tracing_custom_function.cpp
index 95f63b4f..7e3d95a4 100644
--- a/src/Coxeter_triangulation/example/manifold_tracing_custom_function.cpp
+++ b/src/Coxeter_triangulation/example/manifold_tracing_custom_function.cpp
@@ -20,41 +20,34 @@ using namespace Gudhi::coxeter_triangulation;
* The embedding consists of restricting the manifold to the affine subspace z = 1.
*/
struct Function_surface_on_CP2_in_R4 : public Function {
-
virtual Eigen::VectorXd operator()(const Eigen::VectorXd& p) const override {
// The real and imaginary parts of the variables x and y
double xr = p(0), xi = p(1), yr = p(2), yi = p(3);
Eigen::VectorXd result(cod_d());
-
+
// Squares and cubes of real and imaginary parts used in the computations
- double
- xr2 = xr*xr, xi2 = xi*xi, yr2 = yr*yr, yi2 = yi*yi,
- xr3 = xr2*xr, xi3 = xi2*xi, yr3 = yr2*yr, yi3 = yi2*yi;
+ double xr2 = xr * xr, xi2 = xi * xi, yr2 = yr * yr, yi2 = yi * yi, xr3 = xr2 * xr, xi3 = xi2 * xi, yr3 = yr2 * yr,
+ yi3 = yi2 * yi;
// The first coordinate of the output is Re(x^3*y + y^3 + x)
- result(0) =
- xr3*yr - 3*xr*xi2*yr - 3*xr2*xi*yi + xi3*yi
- + yr3 - 3*yr*yi2 + xr;
+ result(0) = xr3 * yr - 3 * xr * xi2 * yr - 3 * xr2 * xi * yi + xi3 * yi + yr3 - 3 * yr * yi2 + xr;
// The second coordinate of the output is Im(x^3*y + y^3 + x)
- result(1) =
- 3*xr2*xi*yr + xr3*yi - 3*xr*xi2*yi - xi3*yr
- + 3*yr2*yi - yi3 + xi;
+ result(1) = 3 * xr2 * xi * yr + xr3 * yi - 3 * xr * xi2 * yi - xi3 * yr + 3 * yr2 * yi - yi3 + xi;
return result;
}
- virtual std::size_t amb_d() const override {return 4;};
- virtual std::size_t cod_d() const override {return 2;};
+ virtual std::size_t amb_d() const override { return 4; };
+ virtual std::size_t cod_d() const override { return 2; };
virtual Eigen::VectorXd seed() const override {
Eigen::VectorXd result = Eigen::VectorXd::Zero(4);
return result;
}
- Function_surface_on_CP2_in_R4() {}
+ Function_surface_on_CP2_in_R4() {}
};
int main(int argc, char** argv) {
-
// The function for the (non-compact) manifold
Function_surface_on_CP2_in_R4 fun;
@@ -74,24 +67,22 @@ int main(int argc, char** argv) {
Coxeter_triangulation<> cox_tr(oracle.amb_d());
cox_tr.change_offset(Eigen::VectorXd::Random(oracle.amb_d()));
cox_tr.change_matrix(lambda * cox_tr.matrix());
-
+
// Manifold tracing algorithm
using MT = Manifold_tracing >;
using Out_simplex_map = typename MT::Out_simplex_map;
std::vector seed_points(1, seed);
Out_simplex_map interior_simplex_map, boundary_simplex_map;
manifold_tracing_algorithm(seed_points, cox_tr, oracle, interior_simplex_map, boundary_simplex_map);
-
+
// Constructing the cell complex
std::size_t intr_d = oracle.amb_d() - oracle.cod_d();
Cell_complex cell_complex(intr_d);
cell_complex.construct_complex(interior_simplex_map, boundary_simplex_map);
// Output the cell complex to a file readable by medit
- output_meshes_to_medit(3,
- "manifold_on_CP2_with_boundary",
- build_mesh_from_cell_complex(cell_complex,
- Configuration(true, true, true, 1, 5, 3),
- Configuration(true, true, true, 2, 13, 14)));
+ output_meshes_to_medit(3, "manifold_on_CP2_with_boundary",
+ build_mesh_from_cell_complex(cell_complex, Configuration(true, true, true, 1, 5, 3),
+ Configuration(true, true, true, 2, 13, 14)));
return 0;
}
diff --git a/src/Coxeter_triangulation/example/manifold_tracing_flat_torus_with_boundary.cpp b/src/Coxeter_triangulation/example/manifold_tracing_flat_torus_with_boundary.cpp
index c83fdd5d..2260e692 100644
--- a/src/Coxeter_triangulation/example/manifold_tracing_flat_torus_with_boundary.cpp
+++ b/src/Coxeter_triangulation/example/manifold_tracing_flat_torus_with_boundary.cpp
@@ -1,7 +1,7 @@
// workaround for the annoying boost message in boost 1.69
#define BOOST_PENDING_INTEGER_LOG2_HPP
#include
-// end workaround
+// end workaround
#include
@@ -21,7 +21,6 @@
using namespace Gudhi::coxeter_triangulation;
int main(int argc, char** argv) {
-
// Creating a circle S1 in R2 of specified radius
double radius = 1.0;
Function_Sm_in_Rd fun_circle(radius, 1);
@@ -34,14 +33,14 @@ int main(int argc, char** argv) {
auto fun_flat_torus_rotated = make_linear_transformation(fun_flat_torus, matrix);
// Computing the seed of the function fun_flat_torus
- Eigen::VectorXd seed = fun_flat_torus_rotated.seed();
-
- // Defining a domain function that defines the boundary, which is a hyperplane passing by the origin and orthogonal to x.
+ Eigen::VectorXd seed = fun_flat_torus_rotated.seed();
+
+ // Defining a domain function that defines the boundary, which is a hyperplane passing by the origin and orthogonal to
+ // x.
Eigen::MatrixXd normal_matrix = Eigen::MatrixXd::Zero(4, 1);
- for (std::size_t i = 0; i < 4; i++)
- normal_matrix(i,0) = -seed(i);
- Function_affine_plane_in_Rd fun_bound(normal_matrix, -seed/2);
-
+ for (std::size_t i = 0; i < 4; i++) normal_matrix(i, 0) = -seed(i);
+ Function_affine_plane_in_Rd fun_bound(normal_matrix, -seed / 2);
+
// Defining the intersection oracle
auto oracle = make_oracle(fun_flat_torus_rotated, fun_bound);
@@ -65,11 +64,9 @@ int main(int argc, char** argv) {
cell_complex.construct_complex(interior_simplex_map, boundary_simplex_map);
// Output the cell complex to a file readable by medit
- output_meshes_to_medit(3,
- "flat_torus_with_boundary",
- build_mesh_from_cell_complex(cell_complex,
- Configuration(true, true, true, 1, 5, 3),
- Configuration(true, true, true, 2, 13, 14)));
+ output_meshes_to_medit(3, "flat_torus_with_boundary",
+ build_mesh_from_cell_complex(cell_complex, Configuration(true, true, true, 1, 5, 3),
+ Configuration(true, true, true, 2, 13, 14)));
return 0;
}
diff --git a/src/Coxeter_triangulation/include/gudhi/Cell_complex.h b/src/Coxeter_triangulation/include/gudhi/Cell_complex.h
index 3bc60a50..9cac58d9 100644
--- a/src/Coxeter_triangulation/include/gudhi/Cell_complex.h
+++ b/src/Coxeter_triangulation/include/gudhi/Cell_complex.h
@@ -11,14 +11,14 @@
#ifndef CELL_COMPLEX_H_
#define CELL_COMPLEX_H_
-#include
+#include
#include
#include
\n";
- ofs << " "
- << "Deleting " << simplex_format(cc_info.trigger_, false) << "
\n";
+ ofs << " The simplex " << simplex_format(cc_info.simplex_, false)
+ << " is a face of the simplex " << simplex_format(cc_info.trigger_, false) << "!
\n";
+ ofs << "
\n";
+ for (const std::string post_face : cc_info.post_faces_)
+ ofs << " - "
+ << "Post deleting " << simplex_format(post_face, false) << "
\n";
+ ofs << "
\n";
+ ofs << " \n";
+ ofs << " "
+ << "Deleting " << simplex_format(cc_info.trigger_, false) << "
\n";
}
// for (const std::string& fac: cc_info.cofaces_)
// ofs << " Checking if " << simplex_format(cc_info.simplex_, false)
// << " is a coface of " << simplex_format(fac, false) << "\n";
if (cc_info.status_ == CC_detail_info::Result_type::coface) {
- ofs << " The simplex "
- << simplex_format(cc_info.simplex_, false) << " is a coface of the simplex "
- << simplex_format(cc_info.trigger_, false) << "!
\n";
+ ofs << "
The simplex " << simplex_format(cc_info.simplex_, false)
+ << " is a coface of the simplex " << simplex_format(cc_info.trigger_, false) << "!
\n";
}
if (cc_info.status_ == CC_detail_info::Result_type::inserted) {
- ofs << "
Successfully inserted "
- << simplex_format(cc_info.simplex_, false) << "!
\n";
+ ofs << "
Successfully inserted "
+ << simplex_format(cc_info.simplex_, false) << "!
\n";
}
ofs << " \n";
ofs << "
\n";
@@ -436,113 +409,101 @@ void write_cc(std::ofstream& ofs) {
ofs << " Summary for boundary simplices
\n";
ofs << " Go to interior
\n";
ofs << " \n";
- for (const CC_summary_info& cc_info: cc_boundary_summary_lists[i])
- ofs << " - "
- << simplex_format(cc_info.face_, true)
- << " cell =" << cc_info.cell_ << "
\n";
+ for (const CC_summary_info& cc_info : cc_boundary_summary_lists[i])
+ ofs << " - "
+ << simplex_format(cc_info.face_, true) << " cell =" << cc_info.cell_ << "
\n";
ofs << "
\n";
ofs << " Prejoin state of the boundary cells of dimension " << i << "
\n";
auto prejoin_it = cc_boundary_prejoin_lists[i].begin();
while (prejoin_it != cc_boundary_prejoin_lists[i].end()) {
- std::size_t j = prejoin_it->dimension_;
- ofs << " " << j << "-dimensional ambient simplices
\n";
- ofs << " \n";
- for (; prejoin_it->dimension_ == j; ++prejoin_it) {
- ofs << " - " << simplex_format(prejoin_it->simplex_, true)
- << " join = " << simplex_format(prejoin_it->join_, true)
- << " boundary:\n"
- << "
\n";
- for (const auto& face: prejoin_it->faces_)
- ofs << " - " << simplex_format(face) << "
";
- ofs << "
\n";
- switch (prejoin_it->status_) {
- case (CC_prejoin_info::Result_type::join_single):
- ofs << " Deleted "
- << simplex_format(prejoin_it->simplex_, true)
- << " as it has a single face.
";
- break;
- case (CC_prejoin_info::Result_type::join_is_face):
- ofs << " Deleted "
- << simplex_format(prejoin_it->simplex_, true)
- << " as its join " << simplex_format(prejoin_it->join_, true)
- << " is one of the faces.
";
- break;
- case (CC_prejoin_info::Result_type::join_different):
- ofs << " Deleted " << simplex_format(prejoin_it->simplex_, true)
- << " and replaced by its join " << simplex_format(prejoin_it->join_, true)
- << ".
";
- break;
- case (CC_prejoin_info::Result_type::join_same):
- ofs << " Kept " << simplex_format(prejoin_it->simplex_, true)
- << ".
";
- }
- ofs << " ";
- }
- ofs << "
\n";
+ std::size_t j = prejoin_it->dimension_;
+ ofs << " " << j << "-dimensional ambient simplices
\n";
+ ofs << " \n";
+ for (; prejoin_it->dimension_ == j; ++prejoin_it) {
+ ofs << " - " << simplex_format(prejoin_it->simplex_, true)
+ << " join = " << simplex_format(prejoin_it->join_, true) << " boundary:\n"
+ << "
\n";
+ for (const auto& face : prejoin_it->faces_) ofs << " - " << simplex_format(face) << "
";
+ ofs << "
\n";
+ switch (prejoin_it->status_) {
+ case (CC_prejoin_info::Result_type::join_single):
+ ofs << " Deleted " << simplex_format(prejoin_it->simplex_, true)
+ << " as it has a single face.
";
+ break;
+ case (CC_prejoin_info::Result_type::join_is_face):
+ ofs << " Deleted " << simplex_format(prejoin_it->simplex_, true)
+ << " as its join " << simplex_format(prejoin_it->join_, true) << " is one of the faces.
";
+ break;
+ case (CC_prejoin_info::Result_type::join_different):
+ ofs << " Deleted " << simplex_format(prejoin_it->simplex_, true)
+ << " and replaced by its join " << simplex_format(prejoin_it->join_, true) << ".
";
+ break;
+ case (CC_prejoin_info::Result_type::join_same):
+ ofs << " Kept " << simplex_format(prejoin_it->simplex_, true)
+ << ".
";
+ }
+ ofs << " ";
+ }
+ ofs << "
\n";
}
}
if (i < cc_boundary_detail_lists.size()) {
ofs << " Details for boundary simplices
\n"
- << " \n";
- for (const CC_detail_info& cc_info: cc_boundary_detail_lists[i]) {
- if (cc_info.status_ == CC_detail_info::Result_type::join_single) {
- ofs << " - Simplex "
- << simplex_format(cc_info.simplex_, true) << " has only one face ("
- << simplex_format(cc_info.trigger_, true) << ") and is deleted.";
- continue;
- }
- if (cc_info.status_ == CC_detail_info::Result_type::join_single) {
- ofs << "
- The join of the simplex "
- << simplex_format(cc_info.simplex_, true) << " is one of its faces ("
- << simplex_format(cc_info.trigger_, true) << "), hence it is is deleted.";
- continue;
- }
- ofs << "
- Insert_simplex called on " << simplex_format(cc_info.simplex_, true);
- ofs << "
\n";
- // for (const std::string& cof: cc_info.faces_)
- // ofs << " - Checking if " << simplex_format(cc_info.simplex_, true)
- // << " is a face of " << simplex_format(cof, true) << "\n";
- ofs << "
\n";
- ofs << " \n";
- if (cc_info.status_ == CC_detail_info::Result_type::self) {
- ofs << " The simplex "
- << simplex_format(cc_info.simplex_, true)
- << " already exists in the cell complex!
\n";
- }
- if (cc_info.status_ == CC_detail_info::Result_type::face) {
- ofs << " The simplex "
- << simplex_format(cc_info.simplex_, true) << " is a face of the simplex "
- << simplex_format(cc_info.trigger_, true) << "!
\n";
- ofs << "
\n";
- for (const std::string post_face: cc_info.post_faces_)
- ofs << " - Post deleting " << simplex_format(post_face, true)
- << "
\n";
- ofs << "
\n";
- ofs << " \n";
- ofs << " Deleting " << simplex_format(cc_info.trigger_, true) << "
\n";
- }
- // for (const std::string& fac: cc_info.cofaces_)
- // ofs << " - Checking if " << simplex_format(cc_info.simplex_, true)
- // << " is a coface of " << simplex_format(fac, true) << "\n";
- ofs << "
\n";
- ofs << " \n";
- if (cc_info.status_ == CC_detail_info::Result_type::coface) {
- ofs << " The simplex "
- << simplex_format(cc_info.simplex_, true) << " is a coface of the simplex "
- << simplex_format(cc_info.trigger_, true) << "!
\n";
- }
- if (cc_info.status_ == CC_detail_info::Result_type::inserted) {
- ofs << "
Successfully inserted "
- << simplex_format(cc_info.simplex_, true) << "!
\n";
- }
+ << "
\n";
+ for (const CC_detail_info& cc_info : cc_boundary_detail_lists[i]) {
+ if (cc_info.status_ == CC_detail_info::Result_type::join_single) {
+ ofs << " - Simplex " << simplex_format(cc_info.simplex_, true) << " has only one face ("
+ << simplex_format(cc_info.trigger_, true) << ") and is deleted.";
+ continue;
+ }
+ if (cc_info.status_ == CC_detail_info::Result_type::join_single) {
+ ofs << "
- The join of the simplex " << simplex_format(cc_info.simplex_, true) << " is one of its faces ("
+ << simplex_format(cc_info.trigger_, true) << "), hence it is is deleted.";
+ continue;
+ }
+ ofs << "
- Insert_simplex called on " << simplex_format(cc_info.simplex_, true);
+ ofs << "
\n";
+ // for (const std::string& cof: cc_info.faces_)
+ // ofs << " - Checking if " << simplex_format(cc_info.simplex_, true)
+ // << " is a face of " << simplex_format(cof, true) << "\n";
+ ofs << "
\n";
+ ofs << " \n";
+ if (cc_info.status_ == CC_detail_info::Result_type::self) {
+ ofs << " The simplex " << simplex_format(cc_info.simplex_, true)
+ << " already exists in the cell complex!
\n";
+ }
+ if (cc_info.status_ == CC_detail_info::Result_type::face) {
+ ofs << " The simplex " << simplex_format(cc_info.simplex_, true)
+ << " is a face of the simplex " << simplex_format(cc_info.trigger_, true) << "!
\n";
+ ofs << "
\n";
+ for (const std::string post_face : cc_info.post_faces_)
+ ofs << " - Post deleting "
+ << simplex_format(post_face, true) << "
\n";
+ ofs << "
\n";
+ ofs << " \n";
+ ofs << " Deleting "
+ << simplex_format(cc_info.trigger_, true) << "
\n";
+ }
+ // for (const std::string& fac: cc_info.cofaces_)
+ // ofs << " - Checking if " << simplex_format(cc_info.simplex_, true)
+ // << " is a coface of " << simplex_format(fac, true) << "\n";
+ ofs << "
\n";
+ ofs << " \n";
+ if (cc_info.status_ == CC_detail_info::Result_type::coface) {
+ ofs << " The simplex "
+ << simplex_format(cc_info.simplex_, true) << " is a coface of the simplex "
+ << simplex_format(cc_info.trigger_, true) << "!
\n";
+ }
+ if (cc_info.status_ == CC_detail_info::Result_type::inserted) {
+ ofs << "
Successfully inserted "
+ << simplex_format(cc_info.simplex_, true) << "!
\n";
+ }
}
ofs << "
\n";
}
- }
+ }
ofs << " \n";
}
@@ -551,14 +512,12 @@ void write_visu(std::ofstream& ofs) {
<< " Visualization details debug trace
\n";
// std::vector > vs_maps(cc_interior_summary_lists.size());
std::map vs_map;
- for (const auto& sv_pair: simplex_vlist_map)
- vs_map.emplace(std::make_pair(sv_pair.second, sv_pair.first));
+ for (const auto& sv_pair : simplex_vlist_map) vs_map.emplace(std::make_pair(sv_pair.second, sv_pair.first));
ofs << " \n";
- for (const auto& vs_pair: vs_map) {
+ for (const auto& vs_pair : vs_map) {
std::string w_simplex = vs_pair.second.substr(1);
bool is_boundary = vs_pair.second[0] == 'B';
- ofs << " - " << vs_pair.first << ": "
- << simplex_format(w_simplex, is_boundary) << "
\n";
+ ofs << " - " << vs_pair.first << ": " << simplex_format(w_simplex, is_boundary) << "
\n";
}
ofs << "
\n";
ofs << " \n";
@@ -574,16 +533,15 @@ void write_to_html(std::string file_name) {
ofs << " Debug traces for " << file_name << "
\n";
write_mt(ofs);
write_cc(ofs);
- write_visu(ofs);
+ write_visu(ofs);
ofs << " \n";
ofs << "