19 #ifndef CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_
20 #define CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_
22 #define CGAL_SURFACE_MESH_SIMPLIFICATION_USE_RELAXED_HEAP
24 #include <boost/optional.hpp>
25 #include <boost/pending/relaxed_heap.hpp>
32 template <
class IndexedType_,
class Compare_ = std::less<IndexedType_>,
class ID_ = boost::
identity_property_map>
33 class Modifiable_priority_queue {
35 typedef Modifiable_priority_queue Self;
37 typedef IndexedType_ IndexedType;
38 typedef Compare_ Compare;
41 typedef boost::relaxed_heap<IndexedType, Compare, ID> Heap;
42 typedef typename Heap::value_type value_type;
43 typedef typename Heap::size_type size_type;
48 Modifiable_priority_queue(size_type largest_ID, Compare
const& c, ID
const&
id) : mHeap(largest_ID, c, id) { }
50 handle push(value_type
const& v) {
55 handle update(value_type
const& v, handle h) {
60 handle erase(value_type
const& v, handle) {
65 value_type top()
const {
77 bool contains(value_type
const& v) {
78 return mHeap.contains(v);
81 boost::optional<value_type> extract_top() {
82 boost::optional<value_type> r;
86 r = boost::optional<value_type>(v);
91 static handle null_handle() {
101 #endif // CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_