diff options
author | Vincent Rouvreau <10407034+VincentRouvreau@users.noreply.github.com> | 2022-08-10 08:12:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 08:12:42 +0200 |
commit | 4f83706aa1263c04cb5e8763e1e8eb6c580bed3c (patch) | |
tree | 8170d537be00f9e31deb6f9287c6e48ac81147b5 | |
parent | 61dca80e02d94559934a1ecff8f0923fbcc3436c (diff) | |
parent | 71cbf8f35814d247fe7421c079a6ea78da2282f4 (diff) |
Merge pull request #670 from VincentRouvreau/bug/fix_663
Adapt the use of CGAL::Modifiable_priority_queue for CGAL>=5.5 while keeping compatibility
-rw-r--r-- | src/Contraction/include/gudhi/Skeleton_blocker_contractor.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h b/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h index 56b76318..6911ca2e 100644 --- a/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h +++ b/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h @@ -171,8 +171,13 @@ typename GeometricSimplifiableComplex::Vertex_handle> { Self const* algorithm_; }; +#if CGAL_VERSION_NR < 1050500000 typedef CGAL::Modifiable_priority_queue<Edge_handle, Compare_cost, Undirected_edge_id> PQ; - typedef typename PQ::handle pq_handle; +#else + typedef CGAL::Modifiable_priority_queue<Edge_handle, Compare_cost, Undirected_edge_id, CGAL::CGAL_BOOST_PENDING_RELAXED_HEAP> PQ; +#endif + + typedef bool pq_handle; // An Edge_data is associated with EVERY edge in the complex (collapsible or not). @@ -196,7 +201,7 @@ typename GeometricSimplifiableComplex::Vertex_handle> { } bool is_in_PQ() const { - return PQHandle_ != PQ::null_handle(); + return PQHandle_ != false; } void set_PQ_handle(pq_handle h) { @@ -204,7 +209,7 @@ typename GeometricSimplifiableComplex::Vertex_handle> { } void reset_PQ_handle() { - PQHandle_ = PQ::null_handle(); + PQHandle_ = false; } private: @@ -238,16 +243,22 @@ typename GeometricSimplifiableComplex::Vertex_handle> { } void insert_in_PQ(Edge_handle edge, Edge_data& data) { - data.set_PQ_handle(heap_PQ_->push(edge)); + heap_PQ_->push(edge); + data.set_PQ_handle(true); ++current_num_edges_heap_; } void update_in_PQ(Edge_handle edge, Edge_data& data) { +#if CGAL_VERSION_NR < 1050500000 data.set_PQ_handle(heap_PQ_->update(edge, data.PQ_handle())); +#else + heap_PQ_->update(edge); +#endif } void remove_from_PQ(Edge_handle edge, Edge_data& data) { - data.set_PQ_handle(heap_PQ_->erase(edge, data.PQ_handle())); + heap_PQ_->erase(edge); + data.set_PQ_handle(false); --current_num_edges_heap_; } |