4 # include <tpl_binHeap.H>
5 # include <tpl_graph_utils.H>
9 class Access_Heap_Node>
11 :
public BinHeap<typename GT::Arc*, Distance_Compare<GT, Distance>>
14 Access_Heap_Node & access_node;
19 Distance & get_distance() {
return dist; }
21 ArcHeap(Distance & __dist, Access_Heap_Node && acc = Access_Heap_Node())
22 : dist(__dist), access_node(acc), dist_cmp(dist)
32 void put_arc(
typename GT::Arc * arc,
typename GT::Node * tgt)
34 Node *& heap_node = access_node(tgt);
36 if (heap_node == NULL)
41 heap_node->get_key() = arc;
48 typename GT::Arc *& arc_in_heap = heap_node->get_key();
51 if (dist_cmp(arc_in_heap, arc))
59 typename GT::Arc * get_min_arc()
61 Node * heap_node = this->
getMin();
62 typename GT::Arc * arc = heap_node->get_key();
65 typename GT::Node * p = (
typename GT::Node*) arc->src_node;
66 if (access_node(p) != heap_node)
67 p = (
typename GT::Node*) arc->tgt_node;
69 I(access_node(p) == heap_node);
71 access_node(p) = NULL;
Node * insert(Node *p)
Definition: tpl_binHeap.H:533
Definition: tpl_graph_utils.H:2102
void update(Node *p)
Definition: tpl_binHeap.H:629
Node * getMin()
Definition: tpl_binHeap.H:589
Definition: tpl_binHeap.H:784
BinHeapNode< Key > Node
El tipo de nodo del heap.
Definition: tpl_binHeap.H:787
void remove_all_and_delete()
Definition: tpl_binHeap.H:673