 |
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
31 #pragma GCC visibility push(default)
35 template<
class Type,
class Key>
40 template<
class Type,
class Key>
43 heap_.insert(elem, key);
47 template<
class Type,
class Key>
51 if (heap_.empty())
return 1;
58 template<
class Type,
class Key>
62 if (heap_.empty())
return 1;
64 minKey = heap_.getMinKey();
69 template<
class Type,
class Key>
73 if (heap_.empty())
return 1;
75 min = heap_.extractMin();
80 template<
class Type,
class Key>
87 template<
class Type,
class Key>
94 template<
class Type,
class Key>
97 return heap_.number();
101 template<
class Type,
class Key>
104 if (newSize <
size()) {
105 Logger::ifout() <<
"AbaPrioQueue::realloc : priority queue cannot be decreased\n";
109 heap_.realloc(newSize);
113 #pragma GCC visibility pop
int getMinKey(Key &minKey) const
Retrieves the key of the minimal element in the priority queue.
AbaPrioQueue(int size)
The constructor of an empty priority queue.
void insert(Type elem, Key key)
Inserts an element in the priority queue.
int getMin(Type &min) const
Retrieves the element with minimal key from the priority queue.
int number() const
Returns the number of elements stored in the priority queue.
#define OGDF_THROW_PARAM(CLASS, PARAM)
Replacement for throw.
static std::ostream & ifout()
stream for forced output (global; used by internal libraries, e.g. Abacus)
void clear()
Makes the priority queue empty.
void realloc(int newSize)
Increases the size of the priority queue.
int extractMin(Type &min)
Retrieves and removes the minimal element from the priority queue.
int size() const
Returns the maximal number of elements which can be stored in the priority queue.