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 #pragma GCC visibility push(default)
36 namespace abacus {
37 
39 
57 template<class Type, class Key>
58 class AbaPrioQueue : public AbacusRoot {
59 public:
60 
62 
66  AbaPrioQueue(int size);
67 
69 
73  void insert(Type elem, Key key);
74 
76 
82  int getMin(Type &min) const;
83 
85 
91  int getMinKey(Key &minKey) const;
92 
94 
100  int extractMin(Type &min);
101 
103  void clear();
104 
106  int size() const;
107 
109  int number() const;
110 
112 
118  void realloc(int newSize);
119 
120 private:
121 
124 };
125 
126 }
127 
129 #pragma GCC visibility pop
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:39
bprioqueue.inc
abacus
Definition: ILPClusterPlanarity.h:50
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:69
abacus::AbaPrioQueue
Bounded priority queues.
Definition: bprioqueue.h:58
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:123
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.