Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

bprioqueue.h
Go to the documentation of this file.
1 
31 #pragma once
32 
33 #include <ogdf/lib/abacus/bheap.h>
34 
35 namespace abacus {
36 
38 
56 template<class Type, class Key>
57 class AbaPrioQueue : public AbacusRoot {
58 public:
59 
61 
65  AbaPrioQueue(int size);
66 
68 
72  void insert(Type elem, Key key);
73 
75 
81  int getMin(Type &min) const;
82 
84 
90  int getMinKey(Key &minKey) const;
91 
93 
99  int extractMin(Type &min);
100 
102  void clear();
103 
105  int size() const;
106 
108  int number() const;
109 
111 
117  void realloc(int newSize);
118 
119 private:
120 
123 };
124 
125 }
126 
abacus::AbaPrioQueue::getMinKey
int getMinKey(Key &minKey) const
Retrieves the key of the minimal element in the priority queue.
abacus::AbaBHeap
Binary heaps.
Definition: bheap.h:38
bprioqueue.inc
abacus
Definition: abacusroot.h:48
bheap.h
abacus::AbaPrioQueue::AbaPrioQueue
AbaPrioQueue(int size)
The constructor of an empty priority queue.
abacus::AbaPrioQueue::insert
void insert(Type elem, Key key)
Inserts an element in the priority queue.
abacus::AbaPrioQueue::getMin
int getMin(Type &min) const
Retrieves the element with minimal key from the priority queue.
abacus::AbacusRoot
Base class of all other classes of ABACUS.
Definition: abacusroot.h:68
abacus::AbaPrioQueue
Bounded priority queues.
Definition: bprioqueue.h:57
abacus::AbaPrioQueue::number
int number() const
Returns the number of elements stored in the priority queue.
abacus::AbaPrioQueue::heap_
AbaBHeap< Type, Key > heap_
The heap implementing the priority queue.
Definition: bprioqueue.h:122
abacus::AbaPrioQueue::clear
void clear()
Makes the priority queue empty.
abacus::AbaPrioQueue::realloc
void realloc(int newSize)
Increases the size of the priority queue.
abacus::AbaPrioQueue::extractMin
int extractMin(Type &min)
Retrieves and removes the minimal element from the priority queue.
abacus::AbaPrioQueue::size
int size() const
Returns the maximal number of elements which can be stored in the priority queue.