From 8fe8a8c9041975d950501be23a43c5aab1ba31ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 16 Jan 2025 11:03:06 +0100 Subject: [PATCH 1/4] Fix compilation of traverser benchmark --- .../segment_traverser_benchmark.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp index 2839ea5e00b..69501904ffe 100644 --- a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp +++ b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp @@ -44,7 +44,7 @@ void bench_segment_traverser(const int nb_queries, typedef CGAL::Triangulation_segment_simplex_iterator_3
Simplex_traverser; typedef CGAL::Triangulation_segment_cell_iterator_3
Cell_traverser; typedef typename DT::Point_3 Point_3; - typedef typename DT::Cell Cell; + typedef typename DT::Cell_handle Cell_handle; std::cout << "\nBench :\t " << nb_queries << " queries," << std::endl << "\t in triangulation of size " << nbv << std::endl @@ -83,29 +83,29 @@ void bench_segment_traverser(const int nb_queries, { //Simplex traverser timer_st.start(); - Simplex_traverser st(dt, segments[2*i], segments[2*i + 1]); + Simplex_traverser st(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. unsigned int inf = 0, fin = 0; for (; st != st.end(); ++st) { - Cell c = st.cell(); -// if (dt.is_infinite(c)) ++inf; -// else ++fin; + Cell_handle c = st.get_cell(); + // if (dt.is_infinite(c)) ++inf; + // else ++fin; } timer_st.stop(); //Cell traverser timer_ct.start(); - Cell_traverser ct(dt, segments[2*i], segments[2*i + 1]); + Cell_traverser ct(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. inf = 0, fin = 0; for (; ct != ct.end(); ++ct) { - Cell c = ct.cell(); -// if (dt.is_infinite(c)) ++inf; -// else ++fin; + Cell_handle c = ct.handle(); + // if (dt.is_infinite(c)) ++inf; + // else ++fin; } timer_ct.stop(); } From 81076472b17640335657c652f53c67aac381a9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 17 Jan 2025 19:05:06 +0100 Subject: [PATCH 2/4] try to fix CI --- .github/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/install.sh b/.github/install.sh index 32b8552aa8f..13e63287364 100755 --- a/.github/install.sh +++ b/.github/install.sh @@ -2,7 +2,7 @@ sudo apt-get update sudo apt-get install -y libmpfr-dev \ libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \ - libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh + libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit5-dev zsh #update cmake to 3.18.4 sudo apt purge --auto-remove cmake cd /tmp From b721064782033be862fce37fbe8c5ec5c198c511 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 21 Jan 2025 15:54:49 +0100 Subject: [PATCH 3/4] fix doc of Triangulation_simplex_3 (the template param is TDS) --- .../CGAL/Triangulation_simplex_3.h | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h index af3a03801b5..17beea514f1 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h @@ -5,7 +5,7 @@ namespace CGAL { \ingroup PkgTriangulation3VertexCellClasses The class `Triangulation_simplex_3` stores a simplex of any dimension -defined by the `Triangulation_3` class. It also defines the +defined by the `TriangulationDataStructure_3` class. It also defines the operator less such that simplices can be stored in a `map` or a `set` of simplices. The simplex is invalidated by any change in the triangulation. @@ -18,7 +18,7 @@ from. \sa `CGAL::Triangulation_3` */ -template< typename Triangulation_3 > +template< typename TriangulationDataStructure_3 > class Triangulation_simplex_3 { public: @@ -29,67 +29,67 @@ public: The simplex class itself. */ -typedef Triangulation_simplex_3 Simplex; +typedef Triangulation_simplex_3 Simplex; /*! */ -typedef Triangulation_3::Vertex_handle Vertex_handle; +typedef TriangulationDataStructure_3::Vertex_handle Vertex_handle; /*! */ -typedef Triangulation_3::Edge Edge; +typedef TriangulationDataStructure_3::Edge Edge; /*! */ -typedef Triangulation_3::Facet Facet; +typedef TriangulationDataStructure_3::Facet Facet; /*! */ -typedef Triangulation_3::Cell_handle Cell_handle; +typedef TriangulationDataStructure_3::Cell_handle Cell_handle; /*! */ -typedef Triangulation_3::Cell_circulator Cell_circulator; +typedef TriangulationDataStructure_3::Cell_circulator Cell_circulator; /*! */ -typedef Triangulation_3::Facet_circulator Facet_circulator; +typedef TriangulationDataStructure_3::Facet_circulator Facet_circulator; /*! */ -typedef Triangulation_3::Edge_iterator Edge_iterator; +typedef TriangulationDataStructure_3::Edge_iterator Edge_iterator; /*! */ -typedef Triangulation_3::Facet_iterator Facet_iterator; +typedef TriangulationDataStructure_3::Facet_iterator Facet_iterator; /*! */ -typedef Triangulation_3::Finite_vertices_iterator Finite_vertices_iterator; +typedef TriangulationDataStructure_3::Finite_vertices_iterator Finite_vertices_iterator; /*! */ -typedef Triangulation_3::Finite_edges_iterator Finite_edges_iterator; +typedef TriangulationDataStructure_3::Finite_edges_iterator Finite_edges_iterator; /*! */ -typedef Triangulation_3::Finite_facets_iterator Finite_facets_iterator; +typedef TriangulationDataStructure_3::Finite_facets_iterator Finite_facets_iterator; /*! */ -typedef Triangulation_3::Finite_cells_iterator Finite_cells_iterator; +typedef TriangulationDataStructure_3::Finite_cells_iterator Finite_cells_iterator; /// @} @@ -188,7 +188,7 @@ Test whether two simplices are equal. */ bool operator==(const -Triangulation_simplex_3 &s1); +Triangulation_simplex_3 &s1); /*! Defines a ordering @@ -196,7 +196,7 @@ on the simplices. This ordering depends on the memory layout and is independent of the geometry. Therefore, the ordering is not intrinsic */ bool operator< (const -Triangulation_simplex_3 &s1); +Triangulation_simplex_3 &s1); /// @} From fbaccdb075aa923ee66ca9eaddd157300f8959ea Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 21 Jan 2025 15:55:25 +0100 Subject: [PATCH 4/4] fix compilation on msvc and use public API --- .../segment_traverser_benchmark.cpp | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp index 69501904ffe..2039138e058 100644 --- a/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp +++ b/Triangulation_3/benchmark/Triangulation_3/segment_traverser_benchmark.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -30,8 +30,8 @@ #include // Define the kernel. -typedef CGAL::Exact_predicates_exact_constructions_kernel Epeck; -typedef CGAL::Exact_predicates_inexact_constructions_kernel Epick; +using Epeck = CGAL::Exact_predicates_exact_constructions_kernel; +using Epick = CGAL::Exact_predicates_inexact_constructions_kernel; template @@ -40,11 +40,11 @@ void bench_segment_traverser(const int nb_queries, const double rad, CGAL::Random& rng) { - typedef CGAL::Delaunay_triangulation_3 DT; - typedef CGAL::Triangulation_segment_simplex_iterator_3
Simplex_traverser; - typedef CGAL::Triangulation_segment_cell_iterator_3
Cell_traverser; - typedef typename DT::Point_3 Point_3; - typedef typename DT::Cell_handle Cell_handle; + using DT = CGAL::Delaunay_triangulation_3; + using Tds = typename DT::Triangulation_data_structure; + using Point_3 = typename DT::Point_3; + using Cell_handle = typename DT::Cell_handle; + using Simplex_3 = CGAL::Triangulation_simplex_3; std::cout << "\nBench :\t " << nb_queries << " queries," << std::endl << "\t in triangulation of size " << nbv << std::endl @@ -83,29 +83,26 @@ void bench_segment_traverser(const int nb_queries, { //Simplex traverser timer_st.start(); - Simplex_traverser st(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. unsigned int inf = 0, fin = 0; - for (; st != st.end(); ++st) + for (Simplex_3 st : dt.segment_traverser_simplices(segments[2 * i], segments[2 * i + 1])) { - Cell_handle c = st.get_cell(); - // if (dt.is_infinite(c)) ++inf; - // else ++fin; + Cell_handle c = st.incident_cell(); + if (dt.is_infinite(c)) ++inf; + else ++fin; } timer_st.stop(); //Cell traverser timer_ct.start(); - Cell_traverser ct(&dt, segments[2*i], segments[2*i + 1]); // Count the number of finite cells traversed. inf = 0, fin = 0; - for (; ct != ct.end(); ++ct) + for (Cell_handle c : dt.segment_traverser_cell_handles(segments[2 * i], segments[2 * i + 1])) { - Cell_handle c = ct.handle(); - // if (dt.is_infinite(c)) ++inf; - // else ++fin; + if (dt.is_infinite(c)) ++inf; + else ++fin; } timer_ct.stop(); } @@ -128,4 +125,6 @@ int main(int argc, char* argv[]) // bench_segment_traverser(nb_queries, nbv, rad, rng); bench_segment_traverser(nb_queries, nbv, rad, rng); + + return EXIT_SUCCESS; }