55 :
public BinHeap<typename GT::Arc *, Distance_Compare<GT, Distance>>
90 Heap::operator=(std::move(
other));
113 if (heap_node ==
nullptr)
115 heap_node =
new Node;
150 assert(handle_ref == heap_node);
152 handle_ref =
nullptr;
238 if (heap_node ==
nullptr)
261 auto *arc = heap_node->data;
#define ah_underflow_error_if(C)
Throws std::underflow_error if condition holds.
Node * get_min_node() const noexcept
Returns a pointer to the minimum node.
void clear() noexcept(std::is_nothrow_destructible_v< T >)
Removes all elements from the heap.
Node * insert(const T &val)
Inserts a new element (copy).
Node * handle_type
Type alias for node handles.
T extract_min()
Extracts and returns the minimum element.
void decrease_key(Node *x, const T &k)
Decreases the key of a node.
bool is_empty() const noexcept
Checks if the heap is empty.
void update(Node *p) noexcept
Actualiza prioridad de un nodo contenido en el heap.
Node * getMin()
Elimina del heap el nodo de menor prioridad.
void remove_all_and_delete() noexcept
Borra todos los nodos del heap, invoca a los destructores de los nodos eliminados y libera toda la me...
Node * insert(Node *p) noexcept
Inserta un nodo en un heap.
ArcFibonacciHeap & operator=(const ArcFibonacciHeap &)=delete
void empty()
Remove all heap nodes and delete their memory.
Distance & get_distance()
Return the distance functor used to compare arcs in this heap.
typename Heap::handle_type handle_type
handle_type & handle_ref(typename GT::Node *p)
~ArcFibonacciHeap()
Destructor. Clears all remaining heap nodes.
bool is_empty() const noexcept
Return true if the heap is empty.
ArcFibonacciHeap(const ArcFibonacciHeap &)=delete
Copying is disabled (heap manages internal node memory)
ArcFibonacciHeap(ArcFibonacciHeap &&other) noexcept
Move construction transfers ownership of heap nodes.
ArcFibonacciHeap(Distance __dist=Distance(), Access_Heap_Node acc=Access_Heap_Node())
Construct an empty Fibonacci arc heap with the given distance functor and heap-node access policy.
ArcFibonacciHeap & operator=(ArcFibonacciHeap &&other) noexcept
Move assignment transfers ownership of heap nodes.
void put_arc(typename GT::Arc *arc, typename GT::Node *tgt)
Insert or update an arc associated with a target node, keeping the smallest-distance arc per node in ...
Access_Heap_Node access_node
Distance_Compare< GT, Distance > Compare
GT::Arc * get_min_arc()
Extract the arc with minimum distance from the heap and clear its node-to-heap mapping.
ArcHeap & operator=(ArcHeap &&other) noexcept
Move assignment transfers ownership of heap nodes.
ArcHeap(Distance __dist=Distance(), Access_Heap_Node acc=Access_Heap_Node())
Construct an empty arc heap with the given distance functor and heap-node access policy.
ArcHeap(const ArcHeap &)=delete
Copying is disabled (heap manages internal node memory)
Distance & get_distance()
Return the distance functor used to compare arcs in this heap.
ArcHeap(ArcHeap &&other) noexcept
Move construction transfers ownership of heap nodes.
Access_Heap_Node access_node
~ArcHeap()
Destructor. Clears all remaining heap nodes.
void put_arc(typename GT::Arc *arc, typename GT::Node *tgt)
Insert or update an arc associated with a target node, keeping the smallest-distance arc per node in ...
ArcHeap & operator=(const ArcHeap &)=delete
BinHeap< typename GT::Arc *, Distance_Compare< GT, Distance > > Heap
Distance_Compare< GT, Distance > dist_cmp
void empty()
Remove all heap nodes and delete their memory.
GT::Arc * get_min_arc()
Extract the arc with minimum distance from the heap and clear its node-to-heap mapping.
void * tgt_node
Please don't use.
List_Graph< Graph_Node< int >, Graph_Arc< int > > GT
DynList< T > maps(const C &c, Op op)
Classic map operation.
Node heap without virtual destructor.
Comparison functor for arc weights/distances.
Arc of graph implemented with double-linked adjacency lists.
Binary heap implementation using tree structure.
Fibonacci Heap implementation.
Utility algorithms and operations for graphs.