From f26de8e8198d2cfa5329bcc2d2530cec9eca2ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 30 Nov 2021 13:20:15 +0100 Subject: [PATCH] use the container in STL_extension and not the internal one --- Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h | 24 +++++-------------- .../include/CGAL/Modifiable_priority_queue.h | 15 +++++++++--- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index aaa82040a83..483c96be347 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -57,14 +57,7 @@ #endif #include -#ifdef CGAL_MESH_3_USE_RELAXED_HEAP -# error This option CGAL_MESH_3_USE_RELAXED_HEAP is no longer supported -// The reason is that the Boost relaxed heap does not ensure a strict order -// of the priority queue. -#include -#else #include -#endif //CGAL_MESH_3_USE_RELAXED_HEAP #include #include @@ -507,11 +500,8 @@ private: }; typedef std::less less_PVertex; - #ifdef CGAL_MESH_3_USE_RELAXED_HEAP - typedef boost::relaxed_heap PQueue; - #else - typedef ::CGAL::internal::mutable_queue_with_remove, less_PVertex, PVertex_id> PQueue; - #endif //CGAL_MESH_3_USE_RELAXED_HEAP + typedef Modifiable_priority_queue PQueue; + public: /** @@ -942,10 +932,9 @@ perturb(const FT& sliver_bound, PQueue& pqueue, Visitor& visitor) const { this->create_task_group(); - while (pqueue.size() > 0) + while (!pqueue.empty()) { - PVertex pv = pqueue.top(); - pqueue.pop(); + PVertex pv = pqueue.top_and_pop(); enqueue_task(pv, sliver_bound, visitor, bad_vertices); } @@ -977,8 +966,7 @@ perturb(const FT& sliver_bound, PQueue& pqueue, Visitor& visitor) const while ( !is_time_limit_reached() && !pqueue.empty() ) { // Get pqueue head - PVertex pv = pqueue.top(); - pqueue.pop(); + PVertex pv = pqueue.top_and_pop(); --pqueue_size; CGAL_assertion(pv.is_perturbable()); @@ -1245,7 +1233,7 @@ update_priority_queue(const PVertex& pv, PQueue& pqueue) const } else { - pqueue.remove(pv); + pqueue.erase(pv); return -1; } } diff --git a/STL_Extension/include/CGAL/Modifiable_priority_queue.h b/STL_Extension/include/CGAL/Modifiable_priority_queue.h index 9d932617274..4e765306d50 100644 --- a/STL_Extension/include/CGAL/Modifiable_priority_queue.h +++ b/STL_Extension/include/CGAL/Modifiable_priority_queue.h @@ -11,14 +11,13 @@ #ifndef CGAL_MODIFIABLE_PRIORITY_QUEUE_H #define CGAL_MODIFIABLE_PRIORITY_QUEUE_H -#include // Neeeded by the following Boost header for CHAR_BIT. +#include // Needed by the following Boost header for CHAR_BIT. #include #ifdef CGAL_SURFACE_MESH_SIMPLIFICATION_USE_RELAXED_HEAP #include #else #include - namespace CGAL { namespace internal { template