Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
bprioqueue.inc
Go to the documentation of this file.
1
29#pragma once
30
31#pragma GCC visibility push(default)
32namespace abacus {
33
34
35template<class Type, class Key>
37{ }
38
39
40template<class Type, class Key>
41void AbaPrioQueue<Type, Key>::insert(Type elem, Key key)
42{
43 heap_.insert(elem, key);
44}
45
46
47template<class Type, class Key>
48int AbaPrioQueue<Type, Key>::getMin(Type &min) const
49{
51 if (heap_.empty()) return 1;
52
53 min = heap_.getMin();
54 return 0;
55}
56
57
58template<class Type, class Key>
59int AbaPrioQueue<Type, Key>::getMinKey(Key &minKey) const
60{
62 if (heap_.empty()) return 1;
63
64 minKey = heap_.getMinKey();
65 return 0;
66}
67
68
69template<class Type, class Key>
70int AbaPrioQueue<Type, Key>::extractMin(Type& min)
71{
73 if (heap_.empty()) return 1;
74
75 min = heap_.extractMin();
76 return 0;
77}
78
79
80template<class Type, class Key>
81void AbaPrioQueue<Type, Key>::clear()
82{
83 heap_.clear();
84}
85
86
87template<class Type, class Key>
88inline int AbaPrioQueue<Type, Key>::size() const
89{
90 return heap_.size();
91}
92
93
94template<class Type, class Key>
95inline int AbaPrioQueue<Type, Key>::number() const
96{
97 return heap_.number();
98}
99
100
101template<class Type, class Key>
102void AbaPrioQueue<Type, Key>::realloc(int newSize)
103{
104 if (newSize < size()) {
105 Logger::ifout() << "AbaPrioQueue::realloc : priority queue cannot be decreased\n";
107 }
108
109 heap_.realloc(newSize);
110}
111
112}
113#pragma GCC visibility pop
AbaPrioQueue(int size)
The constructor of an empty priority queue.
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
Definition exceptions.h:58