Skip to content

Commit

Permalink
Merge remote-tracking branch 'cgal/6.0.x-branch'
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Jan 22, 2025
2 parents db45571 + 5139e6e commit c313da8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Triangulation_segment_traverser_3.h>
#include <CGAL/Triangulation_simplex_3.h>

#include <iostream>
#include <vector>
Expand All @@ -30,8 +30,8 @@
#include <CGAL/Timer.h>

// 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<typename Kernel>
Expand All @@ -40,11 +40,11 @@ void bench_segment_traverser(const int nb_queries,
const double rad,
CGAL::Random& rng)
{
typedef CGAL::Delaunay_triangulation_3<Kernel> DT;
typedef CGAL::Triangulation_segment_simplex_iterator_3<DT> Simplex_traverser;
typedef CGAL::Triangulation_segment_cell_iterator_3<DT> Cell_traverser;
typedef typename DT::Point_3 Point_3;
typedef typename DT::Cell Cell;
using DT = CGAL::Delaunay_triangulation_3<Kernel>;
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<Tds>;

std::cout << "\nBench :\t " << nb_queries << " queries," << std::endl
<< "\t in triangulation of size " << nbv << std::endl
Expand Down Expand Up @@ -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 c = st.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 c = ct.cell();
// if (dt.is_infinite(c)) ++inf;
// else ++fin;
if (dt.is_infinite(c)) ++inf;
else ++fin;
}
timer_ct.stop();
}
Expand All @@ -128,4 +125,6 @@ int main(int argc, char* argv[])

// bench_segment_traverser<Epeck>(nb_queries, nbv, rad, rng);
bench_segment_traverser<Epick>(nb_queries, nbv, rad, rng);

return EXIT_SUCCESS;
}
34 changes: 17 additions & 17 deletions Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_simplex_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -18,7 +18,7 @@ from.
\sa `CGAL::Triangulation_3<TriangulationTraits_3,TriangulationDataStructure_3>`
*/
template< typename Triangulation_3 >
template< typename TriangulationDataStructure_3 >
class Triangulation_simplex_3 {
public:

Expand All @@ -29,67 +29,67 @@ class Triangulation_simplex_3 {
The simplex class itself.
*/
typedef Triangulation_simplex_3<Triangulation_3> Simplex;
typedef Triangulation_simplex_3<TriangulationDataStructure_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;

/// @}

Expand Down Expand Up @@ -188,15 +188,15 @@ Test whether two
simplices are equal.
*/
bool operator==(const
Triangulation_simplex_3<Triangulation_3> &s1);
Triangulation_simplex_3<TriangulationDataStructure_3> &s1);

/*!
Defines a ordering
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<Triangulation_3> &s1);
Triangulation_simplex_3<TriangulationDataStructure_3> &s1);

/// @}

Expand Down

0 comments on commit c313da8

Please sign in to comment.