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
31namespace abacus {
32
33
34template<class Type, class Key>
36{ }
37
38
39template<class Type, class Key>
40void AbaPrioQueue<Type, Key>::insert(Type elem, Key key)
41{
42 heap_.insert(elem, key);
43}
44
45
46template<class Type, class Key>
47int AbaPrioQueue<Type, Key>::getMin(Type &min) const
48{
50 if (heap_.empty()) return 1;
51
52 min = heap_.getMin();
53 return 0;
54}
55
56
57template<class Type, class Key>
58int AbaPrioQueue<Type, Key>::getMinKey(Key &minKey) const
59{
61 if (heap_.empty()) return 1;
62
63 minKey = heap_.getMinKey();
64 return 0;
65}
66
67
68template<class Type, class Key>
69int AbaPrioQueue<Type, Key>::extractMin(Type& min)
70{
72 if (heap_.empty()) return 1;
73
74 min = heap_.extractMin();
75 return 0;
76}
77
78
79template<class Type, class Key>
80void AbaPrioQueue<Type, Key>::clear()
81{
82 heap_.clear();
83}
84
85
86template<class Type, class Key>
87inline int AbaPrioQueue<Type, Key>::size() const
88{
89 return heap_.size();
90}
91
92
93template<class Type, class Key>
94inline int AbaPrioQueue<Type, Key>::number() const
95{
96 return heap_.number();
97}
98
99
100template<class Type, class Key>
101void AbaPrioQueue<Type, Key>::realloc(int newSize)
102{
103 if (newSize < size()) {
104 Logger::ifout() << "AbaPrioQueue::realloc : priority queue cannot be decreased\n";
106 }
107
108 heap_.realloc(newSize);
109}
110
111}
AbaPrioQueue(int size)
The constructor of an empty priority queue.
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
Definition exceptions.h:54
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()