|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Implementation of a Fibonacci Heap priority queue. More...
#include <tpl_fibonacci_heap.H>
Classes | |
| struct | Node |
| Represents a node in the Fibonacci Heap. More... | |
Public Types | |
| using | value_type = T |
| Type alias for the element type. | |
| using | key_compare = Compare |
| Type alias for the comparison functor. | |
| using | handle_type = Node * |
| Type alias for node handles. | |
Public Member Functions | |
| Fibonacci_Heap (Compare compare=Compare()) noexcept | |
| Default constructor. | |
| template<typename... Args> | |
| Fibonacci_Heap (std::in_place_t, Args &&... args) noexcept | |
| Constructor with in-place comparator construction. | |
| ~Fibonacci_Heap () | |
| Destructor. | |
| Fibonacci_Heap (const Fibonacci_Heap &)=delete | |
| Copy constructor is disabled (use merge or manual copy) | |
| Fibonacci_Heap & | operator= (const Fibonacci_Heap &)=delete |
| Copy assignment is disabled (use merge or manual copy) | |
| Fibonacci_Heap (Fibonacci_Heap &&other) noexcept | |
| Move constructor. | |
| Fibonacci_Heap & | operator= (Fibonacci_Heap &&other) noexcept |
| Move assignment operator. | |
| void | swap (Fibonacci_Heap &other) noexcept |
| Swaps contents with another heap. | |
| Node * | insert (const T &val) |
| Inserts a new element (copy). | |
| Node * | insert (T &&val) |
| Inserts a new element (move). | |
| template<typename... Args> | |
| Node * | emplace (Args &&... args) |
| Constructs and inserts an element in-place. | |
| const T & | get_min () const |
| Returns the minimum element without removing it. | |
| Node * | get_min_node () const noexcept |
| Returns a pointer to the minimum node. | |
| T | extract_min () |
| Extracts and returns the minimum element. | |
| void | decrease_key (Node *x, const T &k) |
| Decreases the key of a node. | |
| void | decrease_key (Node *x, T &&k) |
| Decreases the key of a node (move version). | |
| Node * | update_key (Node *x, const T &k) |
| Updates the key of a node (increase or decrease). | |
| void | delete_node (Node *x) |
| Deletes a specific node from the heap. | |
| void | merge (Fibonacci_Heap &other) |
| Merges another heap into this one. | |
| void | merge (Fibonacci_Heap &&other) |
| Merges another heap into this one (rvalue version). | |
| bool | is_empty () const noexcept |
| Checks if the heap is empty. | |
| size_t | size () const noexcept |
| Returns the number of elements in the heap. | |
| void | clear () noexcept(std::is_nothrow_destructible_v< T >) |
| Removes all elements from the heap. | |
| bool | empty () const noexcept |
| void | pop () |
| const T & | top () const |
| Compare | key_comp () const |
| Returns the comparison functor. | |
Private Member Functions | |
| void | consolidate () |
| Consolidates the root list after extract_min. | |
| void | cut (Node *x, Node *y) |
| Cuts a node from its parent and adds it to the root list. | |
| void | cascading_cut (Node *y) |
| Performs cascading cut operation. | |
| void | delete_all_nodes (Node *node) |
| Recursively deletes all nodes in a tree. | |
| void | add_to_root_list (Node *node) |
| Adds a node to the root list. | |
Static Private Member Functions | |
| static void | link (Node *y, Node *x) |
| Links two trees of the same degree. | |
Private Attributes | |
| Node * | min_node = nullptr |
| Pointer to the current minimum root. | |
| size_t | num_nodes = 0 |
| Number of elements stored in the heap. | |
| Compare | cmp |
| Comparison functor used to order nodes. | |
| std::vector< Node * > | consolidate_array_ |
| Reusable scratch array for Fibonacci_Heap::consolidate(). | |
Static Private Attributes | |
| static constexpr size_t | MAX_DEGREE = 128 |
| Maximum degree tracked during consolidation. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename T , class Compare > | |
| void | swap (Fibonacci_Heap< T, Compare > &a, Fibonacci_Heap< T, Compare > &b) noexcept |
| Swaps two Fibonacci heaps. | |
Implementation of a Fibonacci Heap priority queue.
A Fibonacci Heap is a collection of heap-ordered trees that supports a rich set of operations with excellent amortized time complexity. It is particularly well-suited for graph algorithms like Dijkstra's shortest path and Prim's minimum spanning tree where decrease-key operations are frequent.
| Operation | Time Complexity |
|---|---|
| insert | O(1) |
| get_min | O(1) |
| extract_min | O(log n) |
| decrease_key | O(1) |
| delete_node | O(log n) |
| merge | O(1) |
| is_empty | O(1) |
| size | O(1) |
| T | The data type of elements stored in the heap. |
| Compare | The comparison functor (defaults to Aleph::less<T> for a min-heap). Use Aleph::greater<T> for a max-heap. |
Definition at line 111 of file tpl_fibonacci_heap.H.
| using Aleph::Fibonacci_Heap< T, Compare >::handle_type = Node * |
Type alias for node handles.
Definition at line 410 of file tpl_fibonacci_heap.H.
| using Aleph::Fibonacci_Heap< T, Compare >::key_compare = Compare |
Type alias for the comparison functor.
Definition at line 407 of file tpl_fibonacci_heap.H.
| using Aleph::Fibonacci_Heap< T, Compare >::value_type = T |
Type alias for the element type.
Definition at line 404 of file tpl_fibonacci_heap.H.
|
inlineexplicitnoexcept |
Default constructor.
Creates an empty heap using a copy of compare to order keys.
| compare | Comparison functor (defaults to Compare()). |
Definition at line 419 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::consolidate_array_, and Aleph::Fibonacci_Heap< T, Compare >::MAX_DEGREE.
|
inlineexplicitnoexcept |
Constructor with in-place comparator construction.
Allows constructing the comparator from arbitrary arguments. Use std::in_place as first argument to disambiguate.
| Args | Types of comparator constructor arguments |
| args | Arguments forwarded to Compare's constructor |
Definition at line 435 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::consolidate_array_, and Aleph::Fibonacci_Heap< T, Compare >::MAX_DEGREE.
|
inline |
Destructor.
Deallocates all nodes. Runs in O(n) time.
Definition at line 446 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::clear().
|
delete |
Copy constructor is disabled (use merge or manual copy)
|
inlinenoexcept |
Move constructor.
Transfers ownership of all nodes from other to this heap. The source heap becomes empty.
| other | The heap to move from |
Definition at line 465 of file tpl_fibonacci_heap.H.
References Aleph::maps().
|
inlineprivate |
Adds a node to the root list.
| node | The node to add (must not be in any list) |
Definition at line 381 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::Node::data, Aleph::Fibonacci_Heap< T, Compare >::Node::left, Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::Node::parent, and Aleph::Fibonacci_Heap< T, Compare >::Node::right.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::emplace(), Aleph::Fibonacci_Heap< T, Compare >::insert(), and Aleph::Fibonacci_Heap< T, Compare >::insert().
|
inlineprivate |
Performs cascading cut operation.
If y has lost a child before (mark == true), cut it from its parent and recursively check the parent. This maintains the amortized O(1) decrease_key complexity.
| y | The node to potentially cut |
Definition at line 330 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::cut(), Aleph::maps(), and y.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), and Aleph::Fibonacci_Heap< T, Compare >::delete_node().
|
inlinenoexcept |
Removes all elements from the heap.
Deallocates all nodes and resets the heap to empty state.
Definition at line 924 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::delete_all_nodes(), Aleph::Fibonacci_Heap< T, Compare >::min_node, and Aleph::Fibonacci_Heap< T, Compare >::num_nodes.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::~Fibonacci_Heap(), ArcFibonacciHeap< GT, Distance, Access_Heap_Node >::empty(), Aleph::Fibonacci_Heap< T, Compare >::operator=(), and TEST().
|
inlineprivate |
Consolidates the root list after extract_min.
Ensures no two roots have the same degree by linking trees of equal degree until all roots have distinct degrees.
Definition at line 222 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::consolidate_array_, Aleph::Fibonacci_Heap< T, Compare >::Node::data, Aleph::Fibonacci_Heap< T, Compare >::Node::degree, Aleph::Fibonacci_Heap< T, Compare >::Node::left, Aleph::Fibonacci_Heap< T, Compare >::link(), Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::MAX_DEGREE, Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::Node::parent, Aleph::Fibonacci_Heap< T, Compare >::Node::right, w, and y.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::delete_node(), and Aleph::Fibonacci_Heap< T, Compare >::extract_min().
|
inlineprivate |
Cuts a node from its parent and adds it to the root list.
| x | The node to cut |
| y | The parent of x |
Definition at line 298 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::Node::child, Aleph::Fibonacci_Heap< T, Compare >::Node::degree, Aleph::Fibonacci_Heap< T, Compare >::Node::left, Aleph::Fibonacci_Heap< T, Compare >::Node::mark, Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::Node::parent, Aleph::Fibonacci_Heap< T, Compare >::Node::right, and y.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::cascading_cut(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), and Aleph::Fibonacci_Heap< T, Compare >::delete_node().
Decreases the key of a node.
Decreases the key of node x to the new value k. If this violates the heap property with x's parent, x is cut and added to the root list, potentially triggering cascading cuts.
| x | Handle to the node (returned by insert/emplace) |
| k | The new key value (must be <= current key) |
| std::invalid_argument | if x is nullptr |
| std::domain_error | if k > current key |
Definition at line 675 of file tpl_fibonacci_heap.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::Fibonacci_Heap< T, Compare >::cascading_cut(), Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::cut(), Aleph::Fibonacci_Heap< T, Compare >::Node::data, Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::Node::parent, and y.
Referenced by demo_performance_comparison(), ArcFibonacciHeap< GT, Distance, Access_Heap_Node >::put_arc(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::Fibonacci_Heap< T, Compare >::update_key().
|
inline |
Decreases the key of a node (move version).
| x | Handle to the node |
| k | The new key value (moved into node) |
Definition at line 701 of file tpl_fibonacci_heap.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::Fibonacci_Heap< T, Compare >::cascading_cut(), Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::cut(), Aleph::Fibonacci_Heap< T, Compare >::Node::data, Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::Node::parent, and y.
|
inlineprivate |
Recursively deletes all nodes in a tree.
Used by clear() for O(n) cleanup instead of O(n log n).
| node | Root of the subtree to delete |
Definition at line 355 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::Node::child, Aleph::Fibonacci_Heap< T, Compare >::delete_all_nodes(), Aleph::Fibonacci_Heap< T, Compare >::Node::left, Aleph::next(), and Aleph::Fibonacci_Heap< T, Compare >::Node::right.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::clear(), and Aleph::Fibonacci_Heap< T, Compare >::delete_all_nodes().
|
inline |
Deletes a specific node from the heap.
Removes the node x from the heap regardless of its position.
| x | Handle to the node to delete |
| std::invalid_argument | if x is nullptr |
Definition at line 767 of file tpl_fibonacci_heap.H.
References ah_invalid_argument_if, Aleph::Fibonacci_Heap< T, Compare >::cascading_cut(), Aleph::Fibonacci_Heap< T, Compare >::Node::child, Aleph::Fibonacci_Heap< T, Compare >::consolidate(), Aleph::Fibonacci_Heap< T, Compare >::cut(), Aleph::Fibonacci_Heap< T, Compare >::Node::left, Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::num_nodes, Aleph::Fibonacci_Heap< T, Compare >::Node::parent, and Aleph::Fibonacci_Heap< T, Compare >::Node::right.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::Fibonacci_Heap< T, Compare >::update_key().
|
inline |
Constructs and inserts an element in-place.
Constructs the element directly in the node using the provided arguments, avoiding unnecessary copies or moves.
| Args | Types of constructor arguments |
| args | Arguments to forward to T's constructor |
Definition at line 564 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::add_to_root_list(), Aleph::maps(), and Aleph::Fibonacci_Heap< T, Compare >::num_nodes.
Referenced by TEST().
|
inlinenoexcept |
Definition at line 934 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::is_empty().
|
inline |
Extracts and returns the minimum element.
Removes the minimum element from the heap and returns it. The heap is restructured (consolidated) after removal.
| std::underflow_error | if the heap is empty |
Definition at line 611 of file tpl_fibonacci_heap.H.
References ah_underflow_error_if, Aleph::Fibonacci_Heap< T, Compare >::consolidate(), Aleph::Fibonacci_Heap< T, Compare >::is_empty(), Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::num_nodes, Aleph::Fibonacci_Heap< T, Compare >::Node::parent, and Aleph::Fibonacci_Heap< T, Compare >::Node::right.
Referenced by demo_performance_comparison(), ArcFibonacciHeap< GT, Distance, Access_Heap_Node >::get_min_arc(), Aleph::Fibonacci_Heap< T, Compare >::pop(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and verify_heap_property().
|
inline |
Returns the minimum element without removing it.
| std::underflow_error | if the heap is empty |
Definition at line 580 of file tpl_fibonacci_heap.H.
References ah_underflow_error_if, Aleph::Fibonacci_Heap< T, Compare >::Node::data, Aleph::Fibonacci_Heap< T, Compare >::is_empty(), and Aleph::Fibonacci_Heap< T, Compare >::min_node.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::Fibonacci_Heap< T, Compare >::top().
|
inlinenoexcept |
Returns a pointer to the minimum node.
Useful when you need the handle rather than just the value.
Definition at line 595 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::min_node.
Referenced by ArcFibonacciHeap< GT, Distance, Access_Heap_Node >::get_min_arc(), and TEST().
|
inline |
Inserts a new element (copy).
Creates a new node with a copy of val and adds it to the heap.
| val | The value to insert |
Definition at line 525 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::add_to_root_list(), and Aleph::Fibonacci_Heap< T, Compare >::num_nodes.
Referenced by demo_performance_comparison(), ArcFibonacciHeap< GT, Distance, Access_Heap_Node >::put_arc(), FibonacciHeapWithDataTest::SetUp(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::Fibonacci_Heap< T, Compare >::update_key().
|
inline |
Inserts a new element (move).
Creates a new node by moving val into it.
| val | The value to insert (will be moved) |
Definition at line 543 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::add_to_root_list(), and Aleph::Fibonacci_Heap< T, Compare >::num_nodes.
|
inlinenoexcept |
Checks if the heap is empty.
Definition at line 900 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::min_node.
Referenced by demo_performance_comparison(), Aleph::Fibonacci_Heap< T, Compare >::empty(), Aleph::Fibonacci_Heap< T, Compare >::extract_min(), Aleph::Fibonacci_Heap< T, Compare >::get_min(), ArcFibonacciHeap< GT, Distance, Access_Heap_Node >::get_min_arc(), ArcFibonacciHeap< GT, Distance, Access_Heap_Node >::is_empty(), Aleph::Fibonacci_Heap< T, Compare >::merge(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and verify_heap_property().
|
inline |
Returns the comparison functor.
Definition at line 954 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::cmp.
Referenced by TEST().
Links two trees of the same degree.
Makes y a child of x. Assumes both are roots and x has the smaller key.
| y | The node to become a child |
| x | The node to become the parent |
Definition at line 190 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::Node::child, Aleph::Fibonacci_Heap< T, Compare >::Node::degree, Aleph::Fibonacci_Heap< T, Compare >::Node::left, Aleph::Fibonacci_Heap< T, Compare >::Node::right, and y.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::consolidate().
|
inline |
Merges another heap into this one (rvalue version).
| other | Temporary heap whose contents will be transferred. |
merge(Fibonacci_Heap{...}). Definition at line 888 of file tpl_fibonacci_heap.H.
References Aleph::maps(), and Aleph::Fibonacci_Heap< T, Compare >::merge().
|
inline |
Merges another heap into this one.
All nodes from other are transferred to this heap. The other heap becomes empty after this operation.
| other | The heap to merge (will be emptied) |
Definition at line 847 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::Node::data, Aleph::HTList::is_empty(), Aleph::Fibonacci_Heap< T, Compare >::is_empty(), Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::min_node, Aleph::Fibonacci_Heap< T, Compare >::num_nodes, and Aleph::Fibonacci_Heap< T, Compare >::Node::right.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::merge(), and TEST().
|
delete |
Copy assignment is disabled (use merge or manual copy)
|
inlinenoexcept |
Move assignment operator.
Clears this heap and transfers ownership from other.
| other | The heap to move from |
Definition at line 483 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::clear(), Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::consolidate_array_, Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::min_node, and Aleph::Fibonacci_Heap< T, Compare >::num_nodes.
|
inline |
Definition at line 939 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::extract_min().
|
inlinenoexcept |
Returns the number of elements in the heap.
Definition at line 912 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::num_nodes.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Swaps contents with another heap.
Exchanges all nodes between this heap and other in O(1) time.
| other | The heap to swap with |
Definition at line 505 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::consolidate_array_, Aleph::maps(), Aleph::Fibonacci_Heap< T, Compare >::min_node, and Aleph::Fibonacci_Heap< T, Compare >::num_nodes.
|
inline |
Definition at line 944 of file tpl_fibonacci_heap.H.
References Aleph::Fibonacci_Heap< T, Compare >::get_min().
Updates the key of a node (increase or decrease).
Unlike decrease_key, this method handles both increases and decreases. For increases, it deletes and reinserts the node.
| x | Handle to the node |
| k | The new key value |
| std::invalid_argument | if x is nullptr |
Definition at line 734 of file tpl_fibonacci_heap.H.
References ah_invalid_argument_if, Aleph::Fibonacci_Heap< T, Compare >::cmp, Aleph::Fibonacci_Heap< T, Compare >::Node::data, Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::delete_node(), Aleph::Fibonacci_Heap< T, Compare >::insert(), and Aleph::maps().
Referenced by TEST().
|
related |
Swaps two Fibonacci heaps.
Definition at line 966 of file tpl_fibonacci_heap.H.
|
private |
Comparison functor used to order nodes.
Definition at line 172 of file tpl_fibonacci_heap.H.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::add_to_root_list(), Aleph::Fibonacci_Heap< T, Compare >::consolidate(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::key_comp(), Aleph::Fibonacci_Heap< T, Compare >::merge(), Aleph::Fibonacci_Heap< T, Compare >::operator=(), Aleph::Fibonacci_Heap< T, Compare >::swap(), and Aleph::Fibonacci_Heap< T, Compare >::update_key().
|
private |
Reusable scratch array for Fibonacci_Heap::consolidate().
Keeping the buffer as a member avoids heap allocations on every extract_min() call, which keeps amortized costs constant.
Definition at line 180 of file tpl_fibonacci_heap.H.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::Fibonacci_Heap(), Aleph::Fibonacci_Heap< T, Compare >::Fibonacci_Heap(), Aleph::Fibonacci_Heap< T, Compare >::consolidate(), Aleph::Fibonacci_Heap< T, Compare >::operator=(), and Aleph::Fibonacci_Heap< T, Compare >::swap().
|
staticconstexprprivate |
Maximum degree tracked during consolidation.
The degree of any Fibonacci heap root is bounded by log_phi(n). The value 128 comfortably covers heaps larger than 2^64 elements.
Definition at line 168 of file tpl_fibonacci_heap.H.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::Fibonacci_Heap(), Aleph::Fibonacci_Heap< T, Compare >::Fibonacci_Heap(), and Aleph::Fibonacci_Heap< T, Compare >::consolidate().
|
private |
Pointer to the current minimum root.
Definition at line 170 of file tpl_fibonacci_heap.H.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::add_to_root_list(), Aleph::Fibonacci_Heap< T, Compare >::clear(), Aleph::Fibonacci_Heap< T, Compare >::consolidate(), Aleph::Fibonacci_Heap< T, Compare >::cut(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::delete_node(), Aleph::Fibonacci_Heap< T, Compare >::extract_min(), Aleph::Fibonacci_Heap< T, Compare >::get_min(), Aleph::Fibonacci_Heap< T, Compare >::get_min_node(), Aleph::Fibonacci_Heap< T, Compare >::is_empty(), Aleph::Fibonacci_Heap< T, Compare >::merge(), Aleph::Fibonacci_Heap< T, Compare >::operator=(), and Aleph::Fibonacci_Heap< T, Compare >::swap().
|
private |
Number of elements stored in the heap.
Definition at line 171 of file tpl_fibonacci_heap.H.
Referenced by Aleph::Fibonacci_Heap< T, Compare >::clear(), Aleph::Fibonacci_Heap< T, Compare >::delete_node(), Aleph::Fibonacci_Heap< T, Compare >::emplace(), Aleph::Fibonacci_Heap< T, Compare >::extract_min(), Aleph::Fibonacci_Heap< T, Compare >::insert(), Aleph::Fibonacci_Heap< T, Compare >::insert(), Aleph::Fibonacci_Heap< T, Compare >::merge(), Aleph::Fibonacci_Heap< T, Compare >::operator=(), Aleph::Fibonacci_Heap< T, Compare >::size(), and Aleph::Fibonacci_Heap< T, Compare >::swap().