From e0041b766b647f3906b52f861e97edba1f089312 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Tue, 22 Sep 2020 16:43:54 +0200 Subject: include what you use --- .../include/gudhi/Cell_complex.h | 85 ++++++----- .../gudhi/Cell_complex/Hasse_diagram_cell.h | 17 +-- .../include/gudhi/Coxeter_triangulation.h | 25 ++-- .../include/gudhi/Freudenthal_triangulation.h | 52 +++---- .../include/gudhi/Functions/Cartesian_product.h | 6 +- .../include/gudhi/Functions/Constant_function.h | 6 +- .../include/gudhi/Functions/Embed_in_Rd.h | 6 +- .../include/gudhi/Functions/Function_Sm_in_Rd.h | 5 +- .../gudhi/Functions/Function_affine_plane_in_Rd.h | 5 +- .../include/gudhi/Functions/Function_chair_in_R3.h | 4 +- .../include/gudhi/Functions/Function_iron_in_R3.h | 6 +- .../Function_lemniscate_revolution_in_R3.h | 10 +- .../gudhi/Functions/Function_moment_curve_in_Rd.h | 5 +- .../include/gudhi/Functions/Function_torus_in_R3.h | 6 +- .../Functions/Function_whitney_umbrella_in_R3.h | 5 + .../gudhi/Functions/Linear_transformation.h | 5 +- .../include/gudhi/Functions/Negation.h | 7 +- .../include/gudhi/Functions/PL_approximation.h | 5 +- .../include/gudhi/Functions/Translate.h | 5 +- .../gudhi/Functions/random_orthogonal_matrix.h | 17 ++- .../include/gudhi/IO/Mesh_medit.h | 5 + .../gudhi/IO/build_mesh_from_cell_complex.h | 83 ++++++----- .../include/gudhi/IO/output_meshes_to_medit.h | 9 +- .../gudhi/Implicit_manifold_intersection_oracle.h | 42 +++--- .../include/gudhi/Manifold_tracing.h | 160 ++++++++++----------- .../include/gudhi/Permutahedral_representation.h | 41 +++--- .../Combination_iterator.h | 2 +- .../Integer_combination_iterator.h | 13 +- .../Ordered_set_partition_iterator.h | 25 ++-- .../Permutahedral_representation_iterators.h | 81 +++++------ .../Permutation_iterator.h | 22 +-- .../Set_partition_iterator.h | 29 ++-- .../Permutahedral_representation/Size_range.h | 16 +-- .../face_from_indices.h | 8 +- 34 files changed, 436 insertions(+), 382 deletions(-) (limited to 'src/Coxeter_triangulation/include/gudhi') diff --git a/src/Coxeter_triangulation/include/gudhi/Cell_complex.h b/src/Coxeter_triangulation/include/gudhi/Cell_complex.h index 03d5b288..3bc60a50 100644 --- a/src/Coxeter_triangulation/include/gudhi/Cell_complex.h +++ b/src/Coxeter_triangulation/include/gudhi/Cell_complex.h @@ -13,10 +13,11 @@ #include -#include -#include -#include // for Hasse_diagram_persistence.h +#include +#include +#include // for std::make_pair +#include #include // for Hasse_cell namespace Gudhi { @@ -43,40 +44,36 @@ public: /** \brief Type of a simplex in the ambient triangulation. * Is a model of the concept SimplexInCoxeterTriangulation. */ - typedef typename Out_simplex_map_::key_type Simplex_handle; + using Simplex_handle = typename Out_simplex_map_::key_type; /** \brief Type of a cell in the cell complex. * Always is Gudhi::Hasse_cell from the Hasse diagram module. * The additional information is the boolean that is true if and only if the cell lies * on the boundary. */ - typedef Gudhi::Hasse_diagram::Hasse_diagram_cell Hasse_cell; + using Hasse_cell = Gudhi::Hasse_diagram::Hasse_diagram_cell; /** \brief Type of a map from permutahedral representations of simplices in the * ambient triangulation to the corresponding cells in the cell complex of some * specific dimension. */ - typedef std::map > Simplex_cell_map; + using Simplex_cell_map = std::map >; /** \brief Type of a vector of maps from permutahedral representations of simplices in the * ambient triangulation to the corresponding cells in the cell complex of various dimensions. */ - typedef std::vector Simplex_cell_maps; + using Simplex_cell_maps = std::vector; /** \brief Type of a map from cells in the cell complex to the permutahedral representations * of the corresponding simplices in the ambient triangulation. */ - typedef std::map Cell_simplex_map; + using Cell_simplex_map = std::map; /** \brief Type of a map from vertex cells in the cell complex to the permutahedral representations * of their Cartesian coordinates. */ - typedef std::map Cell_point_map; + using Cell_point_map = std::map; private: - Hasse_cell* insert_cell(const Simplex_handle& simplex, - std::size_t cell_d, - bool is_boundary) { + Hasse_cell* insert_cell(const Simplex_handle& simplex, std::size_t cell_d, bool is_boundary) { Simplex_cell_maps& simplex_cell_maps = (is_boundary? boundary_simplex_cell_maps_ : interior_simplex_cell_maps_); #ifdef GUDHI_COX_OUTPUT_TO_HTML @@ -110,27 +107,27 @@ private: const Simplex_handle& simplex = sc_pair.first; Hasse_cell* cell = sc_pair.second; for (Simplex_handle coface: simplex.coface_range(cod_d_ + cell_d)) { - Hasse_cell* new_cell = insert_cell(coface, cell_d, false); - new_cell->get_boundary().emplace_back(std::make_pair(cell, 1)); + Hasse_cell* new_cell = insert_cell(coface, cell_d, false); + new_cell->get_boundary().emplace_back(std::make_pair(cell, 1)); } } if (is_manifold_with_boundary) { for (auto& sc_pair: boundary_simplex_cell_maps_[cell_d - 1]) { - const Simplex_handle& simplex = sc_pair.first; - Hasse_cell* cell = sc_pair.second; - if (cell_d != intr_d_) - for (Simplex_handle coface: simplex.coface_range(cod_d_ + cell_d + 1)) { - Hasse_cell* new_cell = insert_cell(coface, cell_d, true); - new_cell->get_boundary().emplace_back(std::make_pair(cell, 1)); - } - auto map_it = interior_simplex_cell_maps_[cell_d].find(simplex); - if (map_it == interior_simplex_cell_maps_[cell_d].end()) - std::cerr << "Cell_complex::expand_level error: A boundary cell does not have an interior counterpart.\n"; - else { - Hasse_cell* i_cell = map_it->second; - i_cell->get_boundary().emplace_back(std::make_pair(cell, 1)); - } + const Simplex_handle& simplex = sc_pair.first; + Hasse_cell* cell = sc_pair.second; + if (cell_d != intr_d_) + for (Simplex_handle coface: simplex.coface_range(cod_d_ + cell_d + 1)) { + Hasse_cell* new_cell = insert_cell(coface, cell_d, true); + new_cell->get_boundary().emplace_back(std::make_pair(cell, 1)); + } + auto map_it = interior_simplex_cell_maps_[cell_d].find(simplex); + if (map_it == interior_simplex_cell_maps_[cell_d].end()) + std::cerr << "Cell_complex::expand_level error: A boundary cell does not have an interior counterpart.\n"; + else { + Hasse_cell* i_cell = map_it->second; + i_cell->get_boundary().emplace_back(std::make_pair(cell, 1)); + } } } } @@ -148,15 +145,15 @@ private: cell_point_map_.emplace(std::make_pair(new_cell, point)); } for (std::size_t cell_d = 1; - cell_d < interior_simplex_cell_maps_.size() && - !interior_simplex_cell_maps_[cell_d - 1].empty(); - ++cell_d) { + cell_d < interior_simplex_cell_maps_.size() && + !interior_simplex_cell_maps_[cell_d - 1].empty(); + ++cell_d) { expand_level(cell_d); } } void construct_complex_(const Out_simplex_map_& interior_simplex_map, - const Out_simplex_map_& boundary_simplex_map) { + const Out_simplex_map_& boundary_simplex_map) { #ifdef GUDHI_COX_OUTPUT_TO_HTML cc_interior_summary_lists.resize(interior_simplex_cell_maps_.size()); cc_interior_prejoin_lists.resize(interior_simplex_cell_maps_.size()); @@ -185,17 +182,17 @@ private: #endif for (std::size_t cell_d = 1; - cell_d < interior_simplex_cell_maps_.size() && - !interior_simplex_cell_maps_[cell_d - 1].empty(); - ++cell_d) { + cell_d < interior_simplex_cell_maps_.size() && + !interior_simplex_cell_maps_[cell_d - 1].empty(); + ++cell_d) { expand_level(cell_d); #ifdef GUDHI_COX_OUTPUT_TO_HTML for (const auto& sc_pair: interior_simplex_cell_maps_[cell_d]) - cc_interior_summary_lists[cell_d].push_back(CC_summary_info(sc_pair)); + cc_interior_summary_lists[cell_d].push_back(CC_summary_info(sc_pair)); if (cell_d < boundary_simplex_cell_maps_.size()) - for (const auto& sc_pair: boundary_simplex_cell_maps_[cell_d]) - cc_boundary_summary_lists[cell_d].push_back(CC_summary_info(sc_pair)); + for (const auto& sc_pair: boundary_simplex_cell_maps_[cell_d]) + cc_boundary_summary_lists[cell_d].push_back(CC_summary_info(sc_pair)); #endif } } @@ -230,7 +227,7 @@ public: * \param[in] limit_dimension The dimension of the constructed skeleton. */ void construct_complex(const Out_simplex_map_& out_simplex_map, - std::size_t limit_dimension) { + std::size_t limit_dimension) { interior_simplex_cell_maps_.resize(limit_dimension + 1); if (!out_simplex_map.empty()) cod_d_ = out_simplex_map.begin()->first.dimension(); @@ -250,7 +247,7 @@ public: * to the intersection points. */ void construct_complex(const Out_simplex_map_& interior_simplex_map, - const Out_simplex_map_& boundary_simplex_map) { + const Out_simplex_map_& boundary_simplex_map) { interior_simplex_cell_maps_.resize(intr_d_ + 1); boundary_simplex_cell_maps_.resize(intr_d_); if (!interior_simplex_map.empty()) @@ -273,8 +270,8 @@ public: * \param[in] limit_dimension The dimension of the constructed skeleton. */ void construct_complex(const Out_simplex_map_& interior_simplex_map, - const Out_simplex_map_& boundary_simplex_map, - std::size_t limit_dimension) { + const Out_simplex_map_& boundary_simplex_map, + std::size_t limit_dimension) { interior_simplex_cell_maps_.resize(limit_dimension + 1); boundary_simplex_cell_maps_.resize(limit_dimension); if (!interior_simplex_map.empty()) diff --git a/src/Coxeter_triangulation/include/gudhi/Cell_complex/Hasse_diagram_cell.h b/src/Coxeter_triangulation/include/gudhi/Cell_complex/Hasse_diagram_cell.h index e751f002..a59026fa 100644 --- a/src/Coxeter_triangulation/include/gudhi/Cell_complex/Hasse_diagram_cell.h +++ b/src/Coxeter_triangulation/include/gudhi/Cell_complex/Hasse_diagram_cell.h @@ -8,21 +8,14 @@ * - YYYY/MM Author: Description of the modification */ -#include -#include -#include -#include -#include -#include -#include -#include - - - - #ifndef HASSE_DIAGRAM_CELL_H #define HASSE_DIAGRAM_CELL_H +#include +#include // for std::pair +#include +#include +#include // for std::is_same namespace Gudhi { namespace Hasse_diagram { diff --git a/src/Coxeter_triangulation/include/gudhi/Coxeter_triangulation.h b/src/Coxeter_triangulation/include/gudhi/Coxeter_triangulation.h index 1110c850..19ceb007 100644 --- a/src/Coxeter_triangulation/include/gudhi/Coxeter_triangulation.h +++ b/src/Coxeter_triangulation/include/gudhi/Coxeter_triangulation.h @@ -11,9 +11,8 @@ #ifndef COXETER_TRIANGULATION_H_ #define COXETER_TRIANGULATION_H_ -#include -#include -#include //iota +#include +#include // for std::sqrt #include #include @@ -42,10 +41,9 @@ namespace coxeter_triangulation { * Needs to be a model of SimplexInCoxeterTriangulation. */ template , std::vector > > > + = Permutahedral_representation, std::vector > > > class Coxeter_triangulation : public Freudenthal_triangulation { - - typedef Eigen::MatrixXd Matrix; + using Matrix = Eigen::MatrixXd; Matrix root_matrix(unsigned d) { Matrix cartan(d,d); @@ -58,8 +56,8 @@ class Coxeter_triangulation : public Freudenthal_triangulation i+1) - cartan(i,j) = 0; + if (j+1 < i || j > i+1) + cartan(i,j) = 0; Eigen::SelfAdjointEigenSolver saes(cartan); Eigen::VectorXd sqrt_diag(d); for (unsigned i = 0; i < d; ++i) @@ -68,16 +66,15 @@ class Coxeter_triangulation : public Freudenthal_triangulation -#include -#include //iota +#include +#include // for std::sort +#include // for std::floor +#include // for std::iota +#include // for std::size_t #include #include @@ -40,21 +42,19 @@ namespace coxeter_triangulation { * Needs to be a model of SimplexInCoxeterTriangulation. */ template , std::vector > > > + = Permutahedral_representation, std::vector > > > class Freudenthal_triangulation { - - typedef Eigen::MatrixXd Matrix; - typedef Eigen::VectorXd Vector; - typedef Eigen::SparseMatrix SparseMatrix; - typedef Eigen::Triplet Triplet; + using Matrix = Eigen::MatrixXd; + using Vector = Eigen::VectorXd; + using SparseMatrix = Eigen::SparseMatrix; + using Triplet = Eigen::Triplet; -public: - + public: /** \brief Type of the simplices in the triangulation. */ - typedef Permutahedral_representation_ Simplex_handle; + using Simplex_handle = Permutahedral_representation_; /** \brief Type of the vertices in the triangulation. */ - typedef typename Permutahedral_representation_::Vertex Vertex_handle; + using Vertex_handle = typename Permutahedral_representation_::Vertex; /** \brief Constructor of the Freudenthal-Kuhn triangulation of a given dimension. @@ -155,37 +155,37 @@ public: std::vector z; if (is_freudenthal) { for (std::size_t i = 0; i < d; i++) { - double x_i = scale * point[i]; - int y_i = std::floor(x_i); - output.vertex().push_back(y_i); - z.push_back(x_i - y_i); + double x_i = scale * point[i]; + int y_i = std::floor(x_i); + output.vertex().push_back(y_i); + z.push_back(x_i - y_i); } } else { Eigen::VectorXd p_vect(d); for (std::size_t i = 0; i < d; i++) - p_vect(i) = point[i]; + p_vect(i) = point[i]; Eigen::VectorXd x_vect = colpivhouseholderqr_.solve(p_vect - offset_); for (std::size_t i = 0; i < d; i++) { - double x_i = scale * x_vect(i); - int y_i = std::floor(x_i); - output.vertex().push_back(y_i); - z.push_back(x_i - y_i); + double x_i = scale * x_vect(i); + int y_i = std::floor(x_i); + output.vertex().push_back(y_i); + z.push_back(x_i - y_i); } } z.push_back(0); Part indices(d+1); std::iota(indices.begin(), indices.end(), 0); std::sort(indices.begin(), - indices.end(), - [&z](std::size_t i1, std::size_t i2) {return z[i1] > z[i2];}); + indices.end(), + [&z](std::size_t i1, std::size_t i2) {return z[i1] > z[i2];}); output.partition().push_back(Part(1, indices[0])); for (std::size_t i = 1; i <= d; ++i) if (z[indices[i-1]] > z[indices[i]] + error) - output.partition().push_back(Part(1, indices[i])); + output.partition().push_back(Part(1, indices[i])); else - output.partition().back().push_back(indices[i]); + output.partition().back().push_back(indices[i]); return output; } diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Cartesian_product.h b/src/Coxeter_triangulation/include/gudhi/Functions/Cartesian_product.h index cda966f8..0a6f264d 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Cartesian_product.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Cartesian_product.h @@ -13,9 +13,11 @@ #include #include -#include +#include // for std::enable_if +#include // for std::size_t #include + #include namespace Gudhi { @@ -139,7 +141,7 @@ struct Cartesian_product : public Function { cod_d_ = get_cod_d(function_tuple_); } -private: + private: std::tuple function_tuple_; std::size_t amb_d_, cod_d_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Constant_function.h b/src/Coxeter_triangulation/include/gudhi/Functions/Constant_function.h index e5b78b04..c03a2a24 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Constant_function.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Constant_function.h @@ -11,7 +11,10 @@ #ifndef FUNCTIONS_CONSTANT_FUNCTION_H_ #define FUNCTIONS_CONSTANT_FUNCTION_H_ +#include // for std::size_t + #include + #include namespace Gudhi { @@ -57,7 +60,8 @@ struct Constant_function : public Function { */ Constant_function(std::size_t d, std::size_t k, const Eigen::VectorXd& value) : d_(d), k_(k), value_(value) {} - + + private: std::size_t d_, k_; Eigen::VectorXd value_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Embed_in_Rd.h b/src/Coxeter_triangulation/include/gudhi/Functions/Embed_in_Rd.h index 230c89d8..5ebeac75 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Embed_in_Rd.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Embed_in_Rd.h @@ -11,10 +11,10 @@ #ifndef FUNCTIONS_EMBED_IN_RD_H_ #define FUNCTIONS_EMBED_IN_RD_H_ -#include -#include +#include // for std::size_t #include + #include @@ -76,6 +76,8 @@ struct Embed_in_Rd : public Function { Embed_in_Rd(const Function_& function, std::size_t d) : fun_(function), d_(d) { } + + private: Function_ fun_; std::size_t d_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_Sm_in_Rd.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_Sm_in_Rd.h index f3ae577a..7ebb7fc8 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_Sm_in_Rd.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_Sm_in_Rd.h @@ -11,7 +11,10 @@ #ifndef FUNCTIONS_FUNCTION_SM_IN_RD_H_ #define FUNCTIONS_FUNCTION_SM_IN_RD_H_ +#include // for std::size_t + #include + #include namespace Gudhi { @@ -115,7 +118,7 @@ struct Function_Sm_in_Rd: public Function { : Function_Sm_in_Rd(rhs.r_, rhs.m_, rhs.d_, rhs.center_) {} -protected: + private: std::size_t m_, k_, d_; double r_; Eigen::VectorXd center_; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_affine_plane_in_Rd.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_affine_plane_in_Rd.h index 75fb9322..1e950d4e 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_affine_plane_in_Rd.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_affine_plane_in_Rd.h @@ -11,7 +11,10 @@ #ifndef FUNCTIONS_FUNCTION_AFFINE_PLANE_IN_RD_H_ #define FUNCTIONS_FUNCTION_AFFINE_PLANE_IN_RD_H_ +#include // for std::size_t + #include + #include namespace Gudhi { @@ -85,7 +88,7 @@ struct Function_affine_plane_in_Rd : public Function { normal_matrix_.colwise().normalize(); } -protected: +private: Eigen::MatrixXd normal_matrix_; std::size_t d_, k_, m_; Eigen::VectorXd off_; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_chair_in_R3.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_chair_in_R3.h index 1649ef9c..fe16d37b 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_chair_in_R3.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_chair_in_R3.h @@ -11,9 +11,11 @@ #ifndef FUNCTIONS_FUNCTION_CHAIR_IN_R3_H_ #define FUNCTIONS_FUNCTION_CHAIR_IN_R3_H_ -#include +#include // for std::size_t +#include // for std::pow #include + #include namespace Gudhi { diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_iron_in_R3.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_iron_in_R3.h index 8a438bf4..fa5e4e66 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_iron_in_R3.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_iron_in_R3.h @@ -11,7 +11,11 @@ #ifndef FUNCTIONS_FUNCTION_IRON_IN_R3_H_ #define FUNCTIONS_FUNCTION_IRON_IN_R3_H_ +#include // for std::size_t +#include // for std::pow + #include + #include namespace Gudhi { @@ -59,7 +63,7 @@ struct Function_iron_in_R3 : public Function { Function_iron_in_R3(Eigen::Vector3d off = Eigen::Vector3d::Zero()) : off_(off) {} -protected: + private: Eigen::Vector3d off_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_lemniscate_revolution_in_R3.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_lemniscate_revolution_in_R3.h index 4f08614f..b715932b 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_lemniscate_revolution_in_R3.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_lemniscate_revolution_in_R3.h @@ -11,7 +11,11 @@ #ifndef FUNCTIONS_FUNCTION_LEMNISCATE_REVOLUTION_IN_R3_H_ #define FUNCTIONS_FUNCTION_LEMNISCATE_REVOLUTION_IN_R3_H_ +#include // for std::size_t +#include // for std::sqrt + #include + #include namespace Gudhi { @@ -51,7 +55,7 @@ struct Function_lemniscate_revolution_in_R3 : public Function { * See the method seed2() for the other point. */ virtual Eigen::VectorXd seed() const override { - Eigen::Vector3d result(sqrt(2*a_)+off_[0], off_[1], off_[2]); + Eigen::Vector3d result(std::sqrt(2*a_)+off_[0], off_[1], off_[2]); return result; } @@ -60,7 +64,7 @@ struct Function_lemniscate_revolution_in_R3 : public Function { * See the method seed() for the other point. */ Eigen::VectorXd seed2() const { - Eigen::Vector3d result(-sqrt(2*a_)+off_[0], off_[1], off_[2]); + Eigen::Vector3d result(-std::sqrt(2*a_)+off_[0], off_[1], off_[2]); return result; } @@ -75,7 +79,7 @@ struct Function_lemniscate_revolution_in_R3 : public Function { Eigen::Vector3d off = Eigen::Vector3d::Zero()) : a_(a), off_(off) {} -protected: + private: double a_; Eigen::Vector3d off_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_moment_curve_in_Rd.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_moment_curve_in_Rd.h index f7588225..eecbc914 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_moment_curve_in_Rd.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_moment_curve_in_Rd.h @@ -11,7 +11,10 @@ #ifndef FUNCTIONS_FUNCTION_MOMENT_CURVE_IN_RD_H_ #define FUNCTIONS_FUNCTION_MOMENT_CURVE_IN_RD_H_ +#include // for std::size_t + #include + #include namespace Gudhi { @@ -73,7 +76,7 @@ struct Function_moment_curve_in_Rd : public Function { Eigen::VectorXd& offset) : m_(1), k_(d-1), d_(d), r_(r), off_(offset) {} -protected: + private: std::size_t m_, k_, d_; double r_; Eigen::VectorXd off_; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_torus_in_R3.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_torus_in_R3.h index af0675b0..c756c1a6 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_torus_in_R3.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_torus_in_R3.h @@ -11,7 +11,11 @@ #ifndef FUNCTIONS_FUNCTION_TORUS_IN_R3_H_ #define FUNCTIONS_FUNCTION_TORUS_IN_R3_H_ +#include // for std::size_t +#include // for std::sqrt + #include + #include namespace Gudhi { @@ -62,7 +66,7 @@ struct Function_torus_in_R3 : public Function { Eigen::Vector3d off = Eigen::Vector3d::Zero()) : R_(R), r_(r), off_(off) {} -protected: + private: double R_, r_; Eigen::Vector3d off_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Function_whitney_umbrella_in_R3.h b/src/Coxeter_triangulation/include/gudhi/Functions/Function_whitney_umbrella_in_R3.h index 3c729878..09306561 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Function_whitney_umbrella_in_R3.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Function_whitney_umbrella_in_R3.h @@ -11,7 +11,10 @@ #ifndef FUNCTIONS_FUNCTION_WHITNEY_UMBRELLA_IN_R3_H_ #define FUNCTIONS_FUNCTION_WHITNEY_UMBRELLA_IN_R3_H_ +#include // for std::size_t + #include + #include namespace Gudhi { @@ -69,6 +72,8 @@ struct Function_whitney_umbrella_in_R3 : public Function { */ Function_whitney_umbrella_in_R3(Eigen::Vector3d off = Eigen::Vector3d::Zero()) : off_(off) {} + + private: Eigen::Vector3d off_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Linear_transformation.h b/src/Coxeter_triangulation/include/gudhi/Functions/Linear_transformation.h index 7d36cf84..a5d17fe0 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Linear_transformation.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Linear_transformation.h @@ -11,9 +11,10 @@ #ifndef FUNCTIONS_LINEAR_TRANSFORMATION_H_ #define FUNCTIONS_LINEAR_TRANSFORMATION_H_ -#include +#include // for std::size_t #include + #include namespace Gudhi { @@ -65,7 +66,7 @@ struct Linear_transformation : public Function { fun_(function), matrix_(matrix) { } -private: + private: Function_ fun_; Eigen::MatrixXd matrix_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Negation.h b/src/Coxeter_triangulation/include/gudhi/Functions/Negation.h index e3ddecdb..3439dbad 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Negation.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Negation.h @@ -11,9 +11,10 @@ #ifndef FUNCTIONS_NEGATION_H_ #define FUNCTIONS_NEGATION_H_ -#include +#include // for std::size_t #include + #include namespace Gudhi { @@ -62,6 +63,8 @@ struct Negation : public Function { Negation(const Function_& function) : fun_(function) { } + + private: Function_ fun_; }; @@ -78,7 +81,7 @@ struct Negation : public Function { * \ingroup coxeter_triangulation */ template -Negation negation(const Function_& function) { +Negation negation(const Function_& function) { return Negation(function); } diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/PL_approximation.h b/src/Coxeter_triangulation/include/gudhi/Functions/PL_approximation.h index abfad697..ab2b9294 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/PL_approximation.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/PL_approximation.h @@ -11,9 +11,10 @@ #ifndef FUNCTIONS_PL_APPROXIMATION_H_ #define FUNCTIONS_PL_APPROXIMATION_H_ -#include +#include // for std::size_t #include + #include namespace Gudhi { @@ -90,7 +91,7 @@ struct PL_approximation : public Function { PL_approximation(const Function_& function, const Triangulation_& triangulation) : fun_(function), tr_(triangulation) {} -private: + private: Function_ fun_; Triangulation_ tr_; }; diff --git a/src/Coxeter_triangulation/include/gudhi/Functions/Translate.h b/src/Coxeter_triangulation/include/gudhi/Functions/Translate.h index 90f09a0b..b3f53fe0 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/Translate.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/Translate.h @@ -11,9 +11,10 @@ #ifndef FUNCTIONS_TRANSLATE_H_ #define FUNCTIONS_TRANSLATE_H_ -#include +#include // for std::size_t #include + #include namespace Gudhi { @@ -65,6 +66,8 @@ struct Translate : public Function { Translate(const Function_& function, const Eigen::VectorXd& off) : fun_(function), off_(off) { } + + private: Function_ fun_; Eigen::VectorXd off_; }; 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 e1bbaea3..34fc1a67 100644 --- a/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h +++ b/src/Coxeter_triangulation/include/gudhi/Functions/random_orthogonal_matrix.h @@ -11,8 +11,11 @@ #ifndef FUNCTIONS_RANDOM_ORTHOGONAL_MATRIX_H_ #define FUNCTIONS_RANDOM_ORTHOGONAL_MATRIX_H_ -#include -#include +#include // for std::size_t +#include // for std::cos, std::sin +#include // for std::uniform_real_distribution, std::random_device + +#include #include #include @@ -41,10 +44,14 @@ Eigen::MatrixXd random_orthogonal_matrix(std::size_t d) { if (d == 1) return Eigen::VectorXd::Constant(1, 1.0); if (d == 2) { - double X = 2 * 3.14159265358; - double alpha = static_cast (rand()) / (static_cast (RAND_MAX/X)); + // 0. < alpha < 2 Pi + std::uniform_real_distribution unif(0., 2 * Gudhi::PI); + std::random_device rand_dev; + std::mt19937 rand_engine(rand_dev()); + double alpha = unif(rand_engine); + Eigen::Matrix2d rot; - rot << cos(alpha), -sin(alpha), sin(alpha), cos(alpha); + rot << std::cos(alpha), -std::sin(alpha), std::sin(alpha), cos(alpha); return rot; } Eigen::MatrixXd low_dim_rot = random_orthogonal_matrix(d-1); diff --git a/src/Coxeter_triangulation/include/gudhi/IO/Mesh_medit.h b/src/Coxeter_triangulation/include/gudhi/IO/Mesh_medit.h index 2cceeac1..28276bf7 100644 --- a/src/Coxeter_triangulation/include/gudhi/IO/Mesh_medit.h +++ b/src/Coxeter_triangulation/include/gudhi/IO/Mesh_medit.h @@ -15,6 +15,11 @@ namespace Gudhi { namespace coxeter_triangulation { +#include + +#include +#include // for std::pair + /* \class Mesh_medit * \brief Structure to store a mesh that can be output in Medit .mesh file format * using the output_meshes_to_medit method. diff --git a/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h b/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h index a96d12ba..abe6cdbf 100644 --- a/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h +++ b/src/Coxeter_triangulation/include/gudhi/IO/build_mesh_from_cell_complex.h @@ -13,34 +13,42 @@ #include +#include + +#include // for std::size_t +#include +#include +#include +#include // for std::make_pair +#include // for std::min + namespace Gudhi { namespace coxeter_triangulation { struct Configuration { + Configuration(bool t_edges, bool t_triangles, bool t_tetrahedra, + std::size_t r_edges, std::size_t r_triangles, std::size_t r_tetrahedra) + : toggle_edges(t_edges), toggle_triangles(t_triangles), toggle_tetrahedra(t_tetrahedra), + ref_edges(r_edges), ref_triangles(r_triangles), ref_tetrahedra(r_tetrahedra) {} + + Configuration() {} + bool toggle_edges = true, toggle_triangles = true, toggle_tetrahedra = true; std::size_t ref_edges = 1, ref_triangles = 1, ref_tetrahedra = 1; - - Configuration(bool t_edges, bool t_triangles, bool t_tetrahedra, - std::size_t r_edges, std::size_t r_triangles, std::size_t r_tetrahedra) - : toggle_edges(t_edges), toggle_triangles(t_triangles), toggle_tetrahedra(t_tetrahedra), - ref_edges(r_edges), ref_triangles(r_triangles), ref_tetrahedra(r_tetrahedra) {} - - Configuration() {} }; -template +template void populate_mesh(Mesh_medit& output, - Simplex_cell_map& sc_map, - Configuration configuration, - std::size_t amb_d, - std::map vi_map) { + Simplex_cell_map& sc_map, + Configuration configuration, + std::size_t amb_d, + std::map vi_map) { using Mesh_element_vertices = Mesh_medit::Mesh_elements::value_type::first_type; std::map ci_map; std::size_t index = vi_map.size() + 1; // current size of output.vertex_points @@ -50,16 +58,16 @@ void populate_mesh(Mesh_medit& output, std::set vertex_indices; Hasse_cell* cell = sc_pair.second; for (const auto& ei_pair: cell->get_boundary()) - for (const auto& vi_pair: ei_pair.first->get_boundary()) - vertex_indices.emplace(vi_map[vi_pair.first]); + for (const auto& vi_pair: ei_pair.first->get_boundary()) + vertex_indices.emplace(vi_map[vi_pair.first]); for (const std::size_t& v: vertex_indices) - barycenter += output.vertex_points[v-1]; + barycenter += output.vertex_points[v-1]; ci_map.emplace(std::make_pair(cell, index++)); output.vertex_points.emplace_back((1./vertex_indices.size()) * barycenter); #ifdef GUDHI_COX_OUTPUT_TO_HTML std::string vlist = " (" + std::to_string(index-1) + ")"; for (const std::size_t& v: vertex_indices) - vlist += " " + std::to_string(v); + vlist += " " + std::to_string(v); cell_vlist_map.emplace(std::make_pair(to_string(cell), vlist)); #endif } @@ -69,12 +77,12 @@ void populate_mesh(Mesh_medit& output, Hasse_cell* edge_cell = sc_map.second; Mesh_element_vertices edge; for (const auto& vi_pair: edge_cell->get_boundary()) - edge.push_back(vi_map[vi_pair.first]); + edge.push_back(vi_map[vi_pair.first]); output.edges.emplace_back(std::make_pair(edge, configuration.ref_edges)); #ifdef GUDHI_COX_OUTPUT_TO_HTML std::string vlist; for (const std::size_t& v: edge) - vlist += " " + std::to_string(v); + vlist += " " + std::to_string(v); cell_vlist_map.emplace(std::make_pair(to_string(edge_cell), vlist)); #endif } @@ -82,10 +90,10 @@ void populate_mesh(Mesh_medit& output, if (configuration.toggle_triangles && sc_map.size() >= 3) for (const auto& sc_pair: sc_map[2]) { for (const auto& ei_pair: sc_pair.second->get_boundary()) { - Mesh_element_vertices triangle(1, ci_map[sc_pair.second]); - for (const auto& vi_pair: ei_pair.first->get_boundary()) - triangle.push_back(vi_map[vi_pair.first]); - output.triangles.emplace_back(std::make_pair(triangle, configuration.ref_triangles)); + Mesh_element_vertices triangle(1, ci_map[sc_pair.second]); + for (const auto& vi_pair: ei_pair.first->get_boundary()) + triangle.push_back(vi_map[vi_pair.first]); + output.triangles.emplace_back(std::make_pair(triangle, configuration.ref_triangles)); } } @@ -95,34 +103,34 @@ void populate_mesh(Mesh_medit& output, std::set vertex_indices; Hasse_cell* cell = sc_pair.second; for (const auto& ci_pair: cell->get_boundary()) - for (const auto& ei_pair: ci_pair.first->get_boundary()) - for (const auto& vi_pair: ei_pair.first->get_boundary()) - vertex_indices.emplace(vi_map[vi_pair.first]); - for (const std::size_t& v: vertex_indices) - barycenter += output.vertex_points[v-1]; + for (const auto& ei_pair: ci_pair.first->get_boundary()) + for (const auto& vi_pair: ei_pair.first->get_boundary()) + vertex_indices.emplace(vi_map[vi_pair.first]); + for (const std::size_t& v: vertex_indices) + barycenter += output.vertex_points[v-1]; output.vertex_points.emplace_back((1./vertex_indices.size()) * barycenter); #ifdef GUDHI_COX_OUTPUT_TO_HTML std::string vlist = " (" + std::to_string(index) + ")"; for (const std::size_t& v: vertex_indices) - vlist += " " + std::to_string(v); + vlist += " " + std::to_string(v); cell_vlist_map.emplace(std::make_pair(to_string(cell), vlist)); #endif for (const auto& ci_pair: cell->get_boundary()) - for (const auto& ei_pair: ci_pair.first->get_boundary()) { - Mesh_element_vertices tetrahedron = {index, ci_map[sc_pair.second]}; - for (const auto& vi_pair: ei_pair.first->get_boundary()) - tetrahedron.push_back(vi_map[vi_pair.first]); - output.tetrahedra.emplace_back(std::make_pair(tetrahedron, configuration.ref_tetrahedra)); - } + for (const auto& ei_pair: ci_pair.first->get_boundary()) { + Mesh_element_vertices tetrahedron = {index, ci_map[sc_pair.second]}; + for (const auto& vi_pair: ei_pair.first->get_boundary()) + tetrahedron.push_back(vi_map[vi_pair.first]); + output.tetrahedra.emplace_back(std::make_pair(tetrahedron, configuration.ref_tetrahedra)); + } index++; } } template Mesh_medit build_mesh_from_cell_complex(const Cell_complex& cell_complex, - Configuration i_configuration = Configuration(), - Configuration b_configuration = Configuration()) { + Configuration i_configuration = Configuration(), + Configuration b_configuration = Configuration()) { using Hasse_cell = typename Cell_complex::Hasse_cell; Mesh_medit output; std::map vi_map; // one for vertices, other for 2d-cells @@ -142,7 +150,6 @@ Mesh_medit build_mesh_from_cell_complex(const Cell_complex& cell_complex, output.vertex_points.push_back(cp_pair.second); output.vertex_points.back().conservativeResize(amb_d); } - populate_mesh(output, cell_complex.interior_simplex_cell_maps(), i_configuration, amb_d, vi_map); #ifdef GUDHI_COX_OUTPUT_TO_HTML diff --git a/src/Coxeter_triangulation/include/gudhi/IO/output_meshes_to_medit.h b/src/Coxeter_triangulation/include/gudhi/IO/output_meshes_to_medit.h index b40593ba..850736e9 100644 --- a/src/Coxeter_triangulation/include/gudhi/IO/output_meshes_to_medit.h +++ b/src/Coxeter_triangulation/include/gudhi/IO/output_meshes_to_medit.h @@ -12,8 +12,15 @@ #define IO_OUTPUT_MESHES_TO_MEDIT_H_ #include + #include -#include + +#include // for std::size_t +#include // for std::ofstream +#include +#include // for std::enable_if +#include // for std::get +#include // for std::make_pair namespace Gudhi { diff --git a/src/Coxeter_triangulation/include/gudhi/Implicit_manifold_intersection_oracle.h b/src/Coxeter_triangulation/include/gudhi/Implicit_manifold_intersection_oracle.h index d3f371a6..51d84274 100644 --- a/src/Coxeter_triangulation/include/gudhi/Implicit_manifold_intersection_oracle.h +++ b/src/Coxeter_triangulation/include/gudhi/Implicit_manifold_intersection_oracle.h @@ -37,15 +37,15 @@ namespace coxeter_triangulation { * \ingroup coxeter_triangulation */ template + class Domain_function_ = Constant_function> class Implicit_manifold_intersection_oracle { /* Computes the affine coordinates of the intersection point of the implicit manifold * and the affine hull of the simplex. */ template + class Triangulation> Eigen::VectorXd compute_lambda(const Simplex_handle& simplex, - const Triangulation& triangulation) const { + const Triangulation& triangulation) const { std::size_t cod_d = this->cod_d(); Eigen::MatrixXd matrix(cod_d + 1, cod_d + 1); for (std::size_t i = 0; i < cod_d + 1; ++i) @@ -54,7 +54,7 @@ class Implicit_manifold_intersection_oracle { for (auto v: simplex.vertex_range()) { Eigen::VectorXd v_coords = fun_(triangulation.cartesian_coordinates(v)); for (std::size_t i = 1; i < cod_d + 1; ++i) - matrix(i, j) = v_coords(i-1); + matrix(i, j) = v_coords(i-1); j++; } Eigen::VectorXd z(cod_d + 1); @@ -68,9 +68,9 @@ class Implicit_manifold_intersection_oracle { /* Computes the affine coordinates of the intersection point of the boundary * of the implicit manifold and the affine hull of the simplex. */ template + class Triangulation> Eigen::VectorXd compute_boundary_lambda(const Simplex_handle& simplex, - const Triangulation& triangulation) const { + const Triangulation& triangulation) const { std::size_t cod_d = this->cod_d(); Eigen::MatrixXd matrix(cod_d + 2, cod_d + 2); for (std::size_t i = 0; i < cod_d + 2; ++i) @@ -79,7 +79,7 @@ class Implicit_manifold_intersection_oracle { for (auto v: simplex.vertex_range()) { Eigen::VectorXd v_coords = fun_(triangulation.cartesian_coordinates(v)); for (std::size_t i = 1; i < cod_d + 1; ++i) - matrix(i, j) = v_coords(i-1); + matrix(i, j) = v_coords(i-1); Eigen::VectorXd bv_coords = domain_fun_(triangulation.cartesian_coordinates(v)); matrix(cod_d + 1, j) = bv_coords(0); j++; @@ -94,17 +94,17 @@ class Implicit_manifold_intersection_oracle { /* Computes the intersection result for a given simplex in a triangulation. */ template + class Triangulation> Query_result intersection_result(const Eigen::VectorXd& lambda, - const Simplex_handle& simplex, - const Triangulation& triangulation) const { + const Simplex_handle& simplex, + const Triangulation& triangulation) const { using QR = Query_result; std::size_t amb_d = triangulation.dimension(); std::size_t cod_d = simplex.dimension(); for (std::size_t i = 0; i < (std::size_t)lambda.size(); ++i) if (lambda(i) < 0 || lambda(i) > 1) - return QR({Eigen::VectorXd(), false}); + return QR({Eigen::VectorXd(), false}); Eigen::MatrixXd vertex_matrix(cod_d + 1, amb_d); auto v_range = simplex.vertex_range(); @@ -112,7 +112,7 @@ class Implicit_manifold_intersection_oracle { for (std::size_t i = 0; i < cod_d + 1 && v_it != v_range.end(); ++v_it, ++i) { Eigen::VectorXd v_coords = triangulation.cartesian_coordinates(*v_it); for (std::size_t j = 0; j < amb_d; ++j) - vertex_matrix(i, j) = v_coords(j); + vertex_matrix(i, j) = v_coords(j); } Eigen::VectorXd intersection = lambda.transpose()*vertex_matrix; return QR({intersection, true}); @@ -151,9 +151,9 @@ public: * (the domain dimension of the function). */ template + class Triangulation> Query_result intersects(const Simplex_handle& simplex, - const Triangulation& triangulation) const { + const Triangulation& triangulation) const { Eigen::VectorXd lambda = compute_lambda(simplex, triangulation); return intersection_result(lambda, simplex, triangulation); } @@ -179,9 +179,9 @@ public: * (the domain dimension of the function). */ template + class Triangulation> Query_result intersects_boundary(const Simplex_handle& simplex, - const Triangulation& triangulation) const { + const Triangulation& triangulation) const { Eigen::VectorXd lambda = compute_boundary_lambda(simplex, triangulation); return intersection_result(lambda, simplex, triangulation); } @@ -199,7 +199,7 @@ public: */ template bool lies_in_domain(const Eigen::VectorXd& p, - const Triangulation& triangulation) const { + const Triangulation& triangulation) const { Eigen::VectorXd pl_p = make_pl_approximation(domain_fun_, triangulation)(p); return pl_p(0) < 0; } @@ -218,7 +218,7 @@ public: * manifold with boundary. */ Implicit_manifold_intersection_oracle(const Function_& function, - const Domain_function_& domain_function) + const Domain_function_& domain_function) : fun_(function), domain_fun_(domain_function) {} /** \brief Constructs an intersection oracle for an implicit manifold @@ -249,12 +249,12 @@ private: * \ingroup coxeter_triangulation */ template + class Domain_function_> Implicit_manifold_intersection_oracle make_oracle(const Function_& function, - const Domain_function_& domain_function){ + const Domain_function_& domain_function){ return Implicit_manifold_intersection_oracle(function, - domain_function); + domain_function); } diff --git a/src/Coxeter_triangulation/include/gudhi/Manifold_tracing.h b/src/Coxeter_triangulation/include/gudhi/Manifold_tracing.h index bbd86eb9..25b664eb 100644 --- a/src/Coxeter_triangulation/include/gudhi/Manifold_tracing.h +++ b/src/Coxeter_triangulation/include/gudhi/Manifold_tracing.h @@ -76,26 +76,26 @@ public: * are the intersection points. */ template + class Intersection_oracle> void manifold_tracing_algorithm(const Point_range& seed_points, - const Triangulation_& triangulation, - const Intersection_oracle& oracle, - Out_simplex_map& out_simplex_map) { + const Triangulation_& triangulation, + const Intersection_oracle& oracle, + Out_simplex_map& out_simplex_map) { std::size_t cod_d = oracle.cod_d(); std::queue queue; for (const auto& p: seed_points) { Simplex_handle full_simplex = triangulation.locate_point(p); for (Simplex_handle face: full_simplex.face_range(cod_d)) { - Query_result qr = oracle.intersects(face, triangulation); - if (qr.success && - out_simplex_map.emplace(std::make_pair(face, qr.intersection)).second) { + Query_result qr = oracle.intersects(face, triangulation); + if (qr.success && + out_simplex_map.emplace(std::make_pair(face, qr.intersection)).second) { #ifdef GUDHI_COX_OUTPUT_TO_HTML - mt_seed_inserted_list.push_back(MT_inserted_info(qr, face, false)); + mt_seed_inserted_list.push_back(MT_inserted_info(qr, face, false)); #endif - queue.emplace(face); - break; - } + queue.emplace(face); + break; + } } } @@ -104,12 +104,12 @@ public: Simplex_handle s = queue.front(); queue.pop(); for (auto cof: s.coface_range(cod_d+1)) { - for (auto face: cof.face_range(cod_d)) { - Query_result qr = oracle.intersects(face, triangulation); - if (qr.success && - out_simplex_map.emplace(std::make_pair(face, qr.intersection)).second) - queue.emplace(face); - } + for (auto face: cof.face_range(cod_d)) { + Query_result qr = oracle.intersects(face, triangulation); + if (qr.success && + out_simplex_map.emplace(std::make_pair(face, qr.intersection)).second) + queue.emplace(face); + } } } } @@ -139,39 +139,39 @@ public: * and the mapped values are the intersection points. */ template + class Intersection_oracle> void manifold_tracing_algorithm(const Point_range& seed_points, - const Triangulation_& triangulation, - const Intersection_oracle& oracle, - Out_simplex_map& interior_simplex_map, - Out_simplex_map& boundary_simplex_map) { + const Triangulation_& triangulation, + const Intersection_oracle& oracle, + Out_simplex_map& interior_simplex_map, + Out_simplex_map& boundary_simplex_map) { std::size_t cod_d = oracle.cod_d(); std::queue queue; for (const auto& p: seed_points) { Simplex_handle full_simplex = triangulation.locate_point(p); for (Simplex_handle face: full_simplex.face_range(cod_d)) { - auto qr = oracle.intersects(face, triangulation); + auto qr = oracle.intersects(face, triangulation); #ifdef GUDHI_COX_OUTPUT_TO_HTML - mt_seed_inserted_list.push_back(MT_inserted_info(qr, face, false)); -#endif - if (qr.success) { - if (oracle.lies_in_domain(qr.intersection, triangulation)) { - if (interior_simplex_map.emplace(std::make_pair(face, qr.intersection)).second) - queue.emplace(face); - } - else { - for (Simplex_handle cof: face.coface_range(cod_d+1)) { - auto qrb = oracle.intersects_boundary(cof, triangulation); + mt_seed_inserted_list.push_back(MT_inserted_info(qr, face, false)); +#endif + if (qr.success) { + if (oracle.lies_in_domain(qr.intersection, triangulation)) { + if (interior_simplex_map.emplace(std::make_pair(face, qr.intersection)).second) + queue.emplace(face); + } + else { + for (Simplex_handle cof: face.coface_range(cod_d+1)) { + auto qrb = oracle.intersects_boundary(cof, triangulation); #ifdef GUDHI_COX_OUTPUT_TO_HTML - mt_seed_inserted_list.push_back(MT_inserted_info(qrb, cof, true)); -#endif - if (qrb.success) - boundary_simplex_map.emplace(cof, qrb.intersection); - } - } - // break; - } + mt_seed_inserted_list.push_back(MT_inserted_info(qrb, cof, true)); +#endif + if (qrb.success) + boundary_simplex_map.emplace(cof, qrb.intersection); + } + } + // break; + } } } @@ -179,27 +179,27 @@ public: Simplex_handle s = queue.front(); queue.pop(); for (auto cof: s.coface_range(cod_d+1)) { - for (auto face: cof.face_range(cod_d)) { - auto qr = oracle.intersects(face, triangulation); + for (auto face: cof.face_range(cod_d)) { + auto qr = oracle.intersects(face, triangulation); #ifdef GUDHI_COX_OUTPUT_TO_HTML - mt_inserted_list.push_back(MT_inserted_info(qr, face, false)); -#endif - if (qr.success) { - if (oracle.lies_in_domain(qr.intersection, triangulation)) { - if (interior_simplex_map.emplace(face, qr.intersection).second) - queue.emplace(face); - } - else { - auto qrb = oracle.intersects_boundary(cof, triangulation); + mt_inserted_list.push_back(MT_inserted_info(qr, face, false)); +#endif + if (qr.success) { + if (oracle.lies_in_domain(qr.intersection, triangulation)) { + if (interior_simplex_map.emplace(face, qr.intersection).second) + queue.emplace(face); + } + else { + auto qrb = oracle.intersects_boundary(cof, triangulation); #ifdef GUDHI_COX_OUTPUT_TO_HTML - mt_inserted_list.push_back(MT_inserted_info(qrb, cof, true)); -#endif - // assert (qrb.success); // always a success - if (qrb.success) - boundary_simplex_map.emplace(cof, qrb.intersection); - } - } - } + mt_inserted_list.push_back(MT_inserted_info(qrb, cof, true)); +#endif + // assert (qrb.success); // always a success + if (qrb.success) + boundary_simplex_map.emplace(cof, qrb.intersection); + } + } + } } } } @@ -237,18 +237,18 @@ public: * \ingroup coxeter_triangulation */ template + class Triangulation, + class Intersection_oracle, + class Out_simplex_map> void manifold_tracing_algorithm(const Point_range& seed_points, - const Triangulation& triangulation, - const Intersection_oracle& oracle, - Out_simplex_map& out_simplex_map) { + const Triangulation& triangulation, + const Intersection_oracle& oracle, + Out_simplex_map& out_simplex_map) { Manifold_tracing mt; mt.manifold_tracing_algorithm(seed_points, - triangulation, - oracle, - out_simplex_map); + triangulation, + oracle, + out_simplex_map); } /** @@ -281,20 +281,20 @@ void manifold_tracing_algorithm(const Point_range& seed_points, * \ingroup coxeter_triangulation */ template + class Triangulation, + class Intersection_oracle, + class Out_simplex_map> void manifold_tracing_algorithm(const Point_range& seed_points, - const Triangulation& triangulation, - const Intersection_oracle& oracle, - Out_simplex_map& interior_simplex_map, - Out_simplex_map& boundary_simplex_map) { + const Triangulation& triangulation, + const Intersection_oracle& oracle, + Out_simplex_map& interior_simplex_map, + Out_simplex_map& boundary_simplex_map) { Manifold_tracing mt; mt.manifold_tracing_algorithm(seed_points, - triangulation, - oracle, - interior_simplex_map, - boundary_simplex_map); + triangulation, + oracle, + interior_simplex_map, + boundary_simplex_map); } diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation.h index 303011a2..b1f57b08 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation.h @@ -13,8 +13,7 @@ #include -#include -#include +#include // for std::make_pair namespace Gudhi { @@ -36,7 +35,7 @@ namespace coxeter_triangulation { * random-access ranges. */ template + class Ordered_set_partition_> class Permutahedral_representation { typedef Permutahedral_representation Self; @@ -100,7 +99,7 @@ public: return false; for (std::size_t k = 0; k < partition_.size(); ++k) if (partition_[k] != other.partition_[k]) - return false; + return false; return true; } @@ -118,7 +117,7 @@ public: */ Vertex_range vertex_range() const { return Vertex_range(Vertex_iterator(*this), - Vertex_iterator()); + Vertex_iterator()); } typedef Gudhi::coxeter_triangulation::Face_iterator Face_iterator; @@ -128,7 +127,7 @@ public: */ Face_range face_range(std::size_t value_dim) const { return Face_range(Face_iterator(*this, value_dim), - Face_iterator()); + Face_iterator()); } /** \brief Returns a range of permutahedral representations of facets of the simplex. @@ -136,7 +135,7 @@ public: */ Face_range facet_range() const { return Face_range(Face_iterator(*this, dimension()-1), - Face_iterator()); + Face_iterator()); } typedef Gudhi::coxeter_triangulation::Coface_iterator Coface_iterator; @@ -146,7 +145,7 @@ public: */ Coface_range coface_range(std::size_t value_dim) const { return Coface_range(Coface_iterator(*this, value_dim), - Coface_iterator()); + Coface_iterator()); } /** \brief Returns a range of permutahedral representations of cofacets of the simplex. @@ -154,7 +153,7 @@ public: */ Coface_range cofacet_range() const { return Coface_range(Coface_iterator(*this, dimension()+1), - Coface_iterator()); + Coface_iterator()); } /** \brief Returns true, if the simplex is a face of other simplex. @@ -174,19 +173,19 @@ public: auto other_partition_it = other.partition_.begin(); while (self_partition_it != partition_.end()) { while (other_partition_it != other.partition_.end() && v_self != v_other) { - const Part& other_part = *other_partition_it++; - if (other_partition_it == other.partition_.end()) - return false; - for (const auto& k: other_part) - v_other[k]++; + const Part& other_part = *other_partition_it++; + if (other_partition_it == other.partition_.end()) + return false; + for (const auto& k: other_part) + v_other[k]++; } if (other_partition_it == other.partition_.end()) - return false; + return false; const Part& self_part = *self_partition_it++; if (self_partition_it == partition_.end()) - return true; + return true; for (const auto& k: self_part) - v_self[k]++; + v_self[k]++; } return true; } @@ -204,9 +203,9 @@ private: * @param[in] simplex A simplex represented by its permutahedral representation. */ template + class OrderedSetPartition> std::ostream& operator<<(std::ostream& os, - const Permutahedral_representation& simplex) { + const Permutahedral_representation& simplex) { // vertex part os << "("; if (simplex.vertex().empty()) { @@ -225,12 +224,12 @@ std::ostream& operator<<(std::ostream& os, [&os](const Part& p) { os << "{"; if (p.empty()) { - os << "}"; + os << "}"; } auto p_it = p.begin(); os << *p_it++; for (; p_it != p.end(); ++p_it) - os << ", " << *p_it; + os << ", " << *p_it; os << "}"; }; os << " ["; diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Combination_iterator.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Combination_iterator.h index 36bf4b55..ce6a34ec 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Combination_iterator.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Combination_iterator.h @@ -83,7 +83,7 @@ public: } } -protected: + private: value_t value_; // the dereference value bool is_end_; // is true when the current permutation is the final one diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Integer_combination_iterator.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Integer_combination_iterator.h index 8bf75711..c4e86a36 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Integer_combination_iterator.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Integer_combination_iterator.h @@ -25,11 +25,11 @@ typedef unsigned uint; * Based on the algorithm by Mifsud. */ class Integer_combination_iterator : public boost::iterator_facade< Integer_combination_iterator, - std::vector const, - boost::forward_traversal_tag> { - typedef std::vector value_t; + std::vector const, + boost::forward_traversal_tag> { + using value_t = std::vector; -protected: + private: friend class boost::iterator_core_access; bool equal(Integer_combination_iterator const& other) const { @@ -71,7 +71,6 @@ protected: } public: - template Integer_combination_iterator(const uint& n, const uint& k, const Bound_range& bounds) : @@ -109,8 +108,8 @@ public: // Used for the creating an end iterator Integer_combination_iterator() : is_end_(true), n_(0), k_(0) {} - -protected: + + private: value_t value_; // the dereference value bool is_end_; // is true when the current integer combination is the final one diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Ordered_set_partition_iterator.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Ordered_set_partition_iterator.h index 73b98337..d6f9f121 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Ordered_set_partition_iterator.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Ordered_set_partition_iterator.h @@ -13,8 +13,10 @@ #include #include + #include #include + #include namespace Gudhi { @@ -48,11 +50,11 @@ struct Ordered_set_partition { * */ class Ordered_set_partition_iterator : public boost::iterator_facade< Ordered_set_partition_iterator, - Ordered_set_partition const, - boost::forward_traversal_tag> { - typedef Ordered_set_partition value_t; + Ordered_set_partition const, + boost::forward_traversal_tag> { + using value_t = Ordered_set_partition; -protected: + private: friend class boost::iterator_core_access; bool equal(Ordered_set_partition_iterator const& other) const { @@ -66,22 +68,19 @@ protected: void increment() { if (++value_.p_it_ == p_end_) { if (++value_.s_it_ == s_end_) { - is_end_ = true; - return; + is_end_ = true; + return; } else - value_.p_it_.reinitialize(); + value_.p_it_.reinitialize(); } } -public: - + public: Ordered_set_partition_iterator(const uint& n, const uint& k) : value_({Set_partition_iterator(n,k), Permutation_iterator(k)}), - is_end_(n == 0) - { - } + is_end_(n == 0) {} // Used for the creating an end iterator Ordered_set_partition_iterator() : is_end_(true) {} @@ -92,7 +91,7 @@ public: value_.s_it_.reinitialize(); } -protected: + private: Set_partition_iterator s_end_; // Set partition iterator and the corresponding end iterator Permutation_iterator p_end_; // Permutation iterator and the corresponding end iterator value_t value_; // the dereference value diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutahedral_representation_iterators.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutahedral_representation_iterators.h index e892b73b..d42e892a 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutahedral_representation_iterators.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutahedral_representation_iterators.h @@ -20,7 +20,7 @@ #include #include -#include +#include // for std::find namespace Gudhi { @@ -37,15 +37,15 @@ namespace coxeter_triangulation { * Forward iterator, 'value_type' is Permutahedral_representation::Vertex.*/ template class Vertex_iterator : public boost::iterator_facade< Vertex_iterator, - typename Permutahedral_representation::Vertex const, - boost::forward_traversal_tag> { -protected: + typename Permutahedral_representation::Vertex const, + boost::forward_traversal_tag> { + private: friend class boost::iterator_core_access; using Vertex = typename Permutahedral_representation::Vertex; using Ordered_partition = typename Permutahedral_representation::OrderedSetPartition; - typedef Vertex value_t; + using value_t = Vertex; bool equal(Vertex_iterator const& other) const { @@ -60,12 +60,12 @@ protected: std::size_t d = value_.size(); for (auto i: *o_it_) if (i != d) - value_[i]++; + value_[i]++; else - for (std::size_t j = 0; j < d; j++) - value_[j]--; + for (std::size_t j = 0; j < d; j++) + value_[j]--; } - + void increment() { if (is_end_) return; @@ -84,9 +84,8 @@ public: {} Vertex_iterator() : is_end_(true) {} - - -protected: + + private: typename Ordered_partition::const_iterator o_it_, o_end_; value_t value_; bool is_end_; @@ -100,11 +99,11 @@ protected: * Forward iterator, value_type is Permutahedral_representation. */ template class Face_iterator : public boost::iterator_facade< Face_iterator, - Permutahedral_representation const, - boost::forward_traversal_tag> { - typedef Permutahedral_representation value_t; + Permutahedral_representation const, + boost::forward_traversal_tag> { + using value_t = Permutahedral_representation; -protected: + private: friend class boost::iterator_core_access; using Vertex = typename Permutahedral_representation::Vertex; @@ -130,9 +129,8 @@ protected: // Combination *c_it_ is supposed to be sorted in increasing order value_ = face_from_indices(simplex_, *c_it_); } - + public: - Face_iterator(const Permutahedral_representation& simplex, const uint& k) : simplex_(simplex), k_(k), @@ -147,7 +145,7 @@ public: // Used for the creating an end iterator Face_iterator() : is_end_(true) {} -protected: + private: Permutahedral_representation simplex_; // Input simplex uint k_; uint l_; // Dimension of the input simplex @@ -165,11 +163,11 @@ protected: * Forward iterator, value_type is Permutahedral_representation. */ template class Coface_iterator : public boost::iterator_facade< Coface_iterator, - Permutahedral_representation const, - boost::forward_traversal_tag> { - typedef Permutahedral_representation value_t; - -protected: + Permutahedral_representation const, + boost::forward_traversal_tag> { + using value_t = Permutahedral_representation; + + private: friend class boost::iterator_core_access; using Vertex = typename Permutahedral_representation::Vertex; @@ -187,20 +185,20 @@ protected: uint i = 0; for (; i < k_+1; i++) { if (++(o_its_[i]) != o_end_) - break; + break; } if (i == k_+1) { if (++i_it_ == i_end_) { - is_end_ = true; - return; + is_end_ = true; + return; } o_its_.clear(); for (uint j = 0; j < k_ + 1; j++) - o_its_.emplace_back(Ordered_set_partition_iterator(simplex_.partition()[j].size(), (*i_it_)[j]+1)); + o_its_.emplace_back(Ordered_set_partition_iterator(simplex_.partition()[j].size(), (*i_it_)[j]+1)); } else for (uint j = 0; j < i; j++) - o_its_[j].reinitialize(); + o_its_[j].reinitialize(); update_value(); } @@ -212,30 +210,29 @@ protected: for (; u_ <= (*i_it_)[k_]; u_++) { auto range = (*o_its_[k_])[u_]; if (std::find(range.begin(), range.end(), t_) != range.end()) - break; + break; } uint i = 0; for (uint j = u_+1; j <= (*i_it_)[k_]; j++, i++) for (uint b: (*o_its_[k_])[j]) { - uint c = simplex_.partition()[k_][b]; + uint c = simplex_.partition()[k_][b]; value_.partition()[i].push_back(c); - value_.vertex()[c]--; + value_.vertex()[c]--; } for (uint h = 0; h < k_; h++) for (uint j = 0; j <= (*i_it_)[h]; j++, i++) { - for (uint b: (*o_its_[h])[j]) - value_.partition()[i].push_back(simplex_.partition()[h][b]); + for (uint b: (*o_its_[h])[j]) + value_.partition()[i].push_back(simplex_.partition()[h][b]); } for (uint j = 0; j <= u_; j++, i++) for (uint b: (*o_its_[k_])[j]) - value_.partition()[i].push_back(simplex_.partition()[k_][b]); + value_.partition()[i].push_back(simplex_.partition()[k_][b]); // sort the values in each part (probably not needed) for (auto& part: value_.partition()) std::sort(part.begin(), part.end()); } - -public: - + + public: Coface_iterator(const Permutahedral_representation& simplex, const uint& l) : simplex_(simplex), d_(simplex.vertex().size()), @@ -248,8 +245,8 @@ public: uint j = 0; for (; j < simplex_.partition()[k_].size(); j++) if (simplex_.partition()[k_][j] == d_) { - t_ = j; - break; + t_ = j; + break; } if (j == simplex_.partition()[k_].size()) { std::cerr << "Coface iterator: the argument simplex is not a permutahedral representation\n"; @@ -263,8 +260,8 @@ public: // Used for the creating an end iterator Coface_iterator() : is_end_(true) {} - -protected: + + private: Permutahedral_representation simplex_; // Input simplex uint d_; // Ambient dimension uint l_; // Dimension of the coface diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutation_iterator.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutation_iterator.h index ed1fb337..e0142bf4 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutation_iterator.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Permutation_iterator.h @@ -11,7 +11,9 @@ #ifndef PERMUTAHEDRAL_REPRESENTATION_PERMUTATION_ITERATOR_H_ #define PERMUTAHEDRAL_REPRESENTATION_PERMUTATION_ITERATOR_H_ +#include // for std::size_t #include + #include namespace Gudhi { @@ -24,11 +26,11 @@ typedef unsigned uint; * Based on the optimization of the Heap's algorithm by Sedgewick. */ class Permutation_iterator : public boost::iterator_facade< Permutation_iterator, - std::vector const, - boost::forward_traversal_tag> { - typedef std::vector value_t; + std::vector const, + boost::forward_traversal_tag> { + using value_t = std::vector; -protected: + private: friend class boost::iterator_core_access; bool equal(Permutation_iterator const& other) const { @@ -70,12 +72,12 @@ protected: ct_ = 5; uint j = 2; while (d_[j] == j+1) { - d_[j] = 0; - ++j; + d_[j] = 0; + ++j; } if (j == n_ - 1) { - is_end_ = true; - return; + is_end_ = true; + return; } uint k = j+1; uint x = (k%2 ? d_[j] : 0); @@ -117,8 +119,8 @@ public: if (n_ > 0) is_end_ = false; } - -protected: + + private: value_t value_; // the dereference value bool is_end_; // is true when the current permutation is the final one bool optim_3_; // true if n>=3. for n >= 3, the algorithm is optimized diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Set_partition_iterator.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Set_partition_iterator.h index 26bbc1ef..bd1770bc 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Set_partition_iterator.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Set_partition_iterator.h @@ -25,11 +25,11 @@ typedef unsigned uint; * */ class Set_partition_iterator : public boost::iterator_facade< Set_partition_iterator, - std::vector > const, - boost::forward_traversal_tag> { - typedef std::vector > value_t; - -protected: + std::vector > const, + boost::forward_traversal_tag> { + using value_t = std::vector>; + + private: friend class boost::iterator_core_access; bool equal(Set_partition_iterator const& other) const { @@ -54,7 +54,7 @@ protected: } uint i = n_ - 1; while (rgs_[i] + 1 > max_[i] || - rgs_[i] + 1 >= k_) + rgs_[i] + 1 >= k_) i--; if (i == 0) { is_end_ = true; @@ -71,16 +71,15 @@ protected: uint p = k_; if (mm < p) do { - max_[i] = p; - --i; - --p; - rgs_[i] = p; + max_[i] = p; + --i; + --p; + rgs_[i] = p; } while (max_[i] < p); update_value(); } -public: - + public: Set_partition_iterator(const uint& n, const uint& k) : value_(k), @@ -116,12 +115,12 @@ public: max_[i] = rgs_[i-1] + 1; update_value(); } - -protected: + + private: value_t value_; // the dereference value std::vector rgs_; // restricted growth string std::vector max_; // max_[i] = max(rgs_[0],...,rgs[i-1]) + 1 - bool is_end_; // is true when the current permutation is the final one + bool is_end_; // is true when the current permutation is the final one uint n_; uint k_; diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Size_range.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Size_range.h index 262915fb..f41335e9 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Size_range.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/Size_range.h @@ -11,8 +11,9 @@ #ifndef PERMUTAHEDRAL_REPRESENTATION_SIZE_RANGE_H_ #define PERMUTAHEDRAL_REPRESENTATION_SIZE_RANGE_H_ +#include // for std::size_t + #include -#include // std::size_t namespace Gudhi { @@ -22,11 +23,11 @@ namespace coxeter_triangulation { */ template class Size_iterator : public boost::iterator_facade< Size_iterator, - std::size_t const, - boost::forward_traversal_tag> { + std::size_t const, + boost::forward_traversal_tag> { friend class boost::iterator_core_access; -protected: + private: bool equal(Size_iterator const& other) const { return (is_end_ && other.is_end_); } @@ -43,15 +44,14 @@ protected: value_ = t_it_->size()-1; } -public: - + public: Size_iterator(const T_it& t_begin, const T_it& t_end) : t_it_(t_begin), t_end_(t_end), is_end_(t_begin == t_end) { if (!is_end_) value_ = t_it_->size()-1; } -protected: + private: T_it t_it_, t_end_; bool is_end_; std::size_t value_; @@ -61,7 +61,7 @@ template class Size_range { const T& t_; -public: + public: typedef Size_iterator iterator; Size_range(const T& t) : t_(t) {} diff --git a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/face_from_indices.h b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/face_from_indices.h index c658a06d..21ee3c8b 100644 --- a/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/face_from_indices.h +++ b/src/Coxeter_triangulation/include/gudhi/Permutahedral_representation/face_from_indices.h @@ -15,6 +15,9 @@ namespace Gudhi { namespace coxeter_triangulation { +#include // for std::size_t +#include + /** \brief Computes the permutahedral representation of a face of a given simplex * and a range of the vertex indices that compose the face. * @@ -25,10 +28,9 @@ namespace coxeter_triangulation { * @param[in] simplex Input simplex. * @param[in] indices Input range of indices. */ -template +template Permutahedral_representation face_from_indices(const Permutahedral_representation& simplex, - const Index_range& indices) { + const Index_range& indices) { using range_index = typename Index_range::value_type; using Ordered_set_partition = typename Permutahedral_representation::OrderedSetPartition; using Part = typename Ordered_set_partition::value_type; -- cgit v1.2.3