42#include <initializer_list>
61template<
typename T,
class C = std::less<T>,
template<
typename,
class>
class Impl = PairingHeap>
73 using handle =
typename SpecImpl::Handle;
100 template<
class InputIt>
160 template<
class InputIt>
161 void push(InputIt first, InputIt last) {
162 while (first != last) {
171 void push(std::initializer_list<value_type> ilist) {
push(std::begin(ilist), std::end(ilist)); }
232namespace pq_internal {
235template<
typename T,
typename C>
249template<
typename E,
typename P>
266template<
typename E,
typename P,
class C,
template<
typename,
class>
class Impl>
270template<
typename E,
typename P,
class C,
template<
typename,
class>
class Impl>
298 Pair pair(element, priority);
305 Pair pair(this->
value(pos).element(), priority);
310template<
typename E,
typename P,
class C,
template<
typename,
class>
class Impl,
typename Map>
385template<
typename E,
typename P,
class C = std::less<P>,
template<
typename,
class>
class Impl =
PairingHeap>
409template<
typename E,
typename P,
class C = std::less<P>,
413 HashArray<E, typename PrioritizedQueue<E, P, C, Impl>::Handle, HashFunc<E>>> {
431template<
typename P,
class C,
template<
typename,
class>
class Impl,
template<
typename>
class HashFunc>
434 NodeArray<typename PrioritizedQueue<node, P, C, Impl>::Handle>> {
449 :
SuperQueue(cmp, initialSize == -1 ? G.numberOfNodes() : initialSize,
460template<
typename P,
class C,
template<
typename,
class>
class Impl,
template<
typename>
class HashFunc>
463 EdgeArray<typename PrioritizedQueue<edge, P, C, Impl>::Handle>> {
479 :
SuperQueue(cmp, initialSize == -1 ? G.numberOfEdges() : initialSize,
Includes declaration of graph class.
Declaration and implementation of HashArray class.
Declaration of classes used for hashing.
Implementation of pairing heap data structure.
Basic declarations, included by all source files.
Class for the representation of edges.
Data type for general directed graphs (adjacency list representation).
Indexed arrays using hashing for element access.
Class for the representation of nodes.
Pairing heap implementation.
void clear()
Removes all elements from this queue.
PrioritizedMapQueue(const Graph &G, const C &cmp=C(), int initialSize=-1)
Creates a new queue with the given comparer.
typename PrioritizedQueue< edge, P, C, Impl >::Handle Handle
typename PrioritizedQueue< node, P, C, Impl >::Handle Handle
PrioritizedMapQueue(const Graph &G, const C &cmp=C(), int initialSize=-1)
Creates a new queue with the given comparer.
void clear()
Removes all elements from this queue.
Prioritized queue interface wrapper for heaps.
PrioritizedMapQueue(const C &cmp=C(), int initialSize=128)
Creates a new queue with the given comparer.
Priority queue interface wrapper for heaps.
void pop()
Removes the top element from the heap.
void push(std::initializer_list< value_type > ilist)
Inserts new elements specified by the given initializer list.
const value_type & const_reference
void push(InputIt first, InputIt last)
Inserts new elements specified by the given range.
PriorityQueue & operator=(PriorityQueue other)
Copy and move assignment.
void swap(PriorityQueue &other)
Swaps the contents.
const T & value(handle pos) const
Returns the priority of that handle.
typename SpecImpl::Handle handle
PriorityQueue(std::initializer_list< value_type > init, const C &cmp=C())
Creates priority queue with contents of the given initializer list.
PriorityQueue(PriorityQueue &&other)
Move constructor.
handle push(const value_type &value)
Inserts a new element with given value into the queue.
PriorityQueue(InputIt first, InputIt last, const C &cmp=C())
Creates priority queue with contents of the given range.
PriorityQueue & operator=(std::initializer_list< value_type > ilist)
Assigns the priority queue contents of the given initializer list.
~PriorityQueue()
Destroys the underlying data structure.
void merge(PriorityQueue &other)
Merges in enqueued values of other queue.
PriorityQueue(const PriorityQueue &other)
Copy constructor.
PriorityQueue(const C &cmp=C(), int initialSize=128)
Creates empty priority queue.
void decrease(handle pos, const T &value)
Decreases value of the element specified by handle to value.
size_type m_size
Number of entries.
void clear()
Removes all the entries from the queue.
friend void swap(PriorityQueue &a, PriorityQueue &b)
Swaps the contents.
SpecImpl * m_impl
Underlying heap data structure.
bool empty() const
Checks whether the queue is empty.
const T & top() const
Returns reference to the top element in the queue.
const C & comparator() const
Returns the comparator used for ordering elements.
size_type size() const
Returns the number of enqueued elements.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
Used to compare elements with assigned priorities.
bool operator()(const T &x, const T &y) const
Compare(const Compare &other)
Compare(const C &compare=C())
Pair for storing an element and a priority.
const P & priority() const
PairTemplate(const E &element, const P &priority)
const E & element() const
void decrease(const E &element, const P &priority)
Decreases the priority of the given element.
bool contains(const E &element) const
Returns whether this queue contains that key.
typename PrioritizedQueue< E, P, C, Impl >::Handle Handle
void pop()
Removes the topmost element from the queue.
void clear()
Removes all elements from this queue.
PrioritizedArrayQueueBase(const C &cmp, int initialSize, const Map &map)
void push(const E &element, const P &priority)
Adds a new element to the queue.
const P & priority(const E &element) const
Defines a queue for handling prioritized elements.
const E & topElement() const
Returns the topmost element in the queue.
const P & topPriority() const
Returns the priority of the topmost element in this queue.
Handle push(const E &element, const P &priority)
Pushes a new element with the respective priority to the queue.
typename SuperQueue::handle Handle
The type of handle for accessing the elements of this queue.
PrioritizedQueue(const C &cmp=C(), int initialSize=128)
void decrease(Handle pos, const P &priority)
EdgeElement * edge
The type of edges.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)