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