|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
#include <archeap.H>
Public Types | |
| typedef BinHeap< typename GT::Arc *, Distance_Compare< GT, Distance > > | Heap |
| typedef Heap::Node | Node |
| using | handle_type = Node * |
Public Types inherited from Aleph::BinHeap< GT::Arc *, Distance_Compare< GT, Distance > > | |
| using | Node = BinHeapNode< GT::Arc * > |
| El tipo de nodo del heap. | |
Public Types inherited from Aleph::GenBinHeap< NodeType, Key, Compare > | |
| using | Node = NodeType< Key > |
Public Member Functions | |
| Distance & | get_distance () |
| Return the distance functor used to compare arcs in this heap. | |
| 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) | |
| ArcHeap & | operator= (const ArcHeap &)=delete |
| ArcHeap (ArcHeap &&other) noexcept | |
| Move construction transfers ownership of heap nodes. | |
| ArcHeap & | operator= (ArcHeap &&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 the heap. | |
| GT::Arc * | get_min_arc () |
| Extract the arc with minimum distance from the heap and clear its node-to-heap mapping. | |
| void | empty () |
| Remove all heap nodes and delete their memory. | |
| ~ArcHeap () | |
| Destructor. Clears all remaining heap nodes. | |
Public Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare > | |
| Compare & | key_comp () noexcept |
| Compare & | get_compare () noexcept |
| void | swap (GenBinHeap &h) noexcept |
| Node * | getRoot () noexcept |
| Node * | getRoot () const noexcept |
| template<class Operation > | |
| bool | preorder_traverse (Operation op) const |
| template<class Operation > | |
| void | for_each_in_preorder (Operation &operation) const |
| template<class Operation > | |
| void | for_each_in_preorder (Operation &&operation=Operation()) const |
| template<class Operation > | |
| void | for_each_in_inorder (Operation &operation) const |
| template<class Operation > | |
| void | for_each_in_inorder (Operation &&operation=Operation()) const |
| template<class Op > | |
| bool | level_traverse (Op operation=Op()) const |
| GenBinHeap (Compare __cmp=Compare()) noexcept | |
| virtual | ~GenBinHeap () noexcept |
| Node * | insert (Node *p) noexcept |
| Inserta un nodo en un heap. | |
| Node * | getMin_ne () noexcept |
| Node * | getMin () |
| Elimina del heap el nodo de menor prioridad. | |
| Node * | getMax () |
| void | update (Node *p) noexcept |
| Actualiza prioridad de un nodo contenido en el heap. | |
| Node * | remove (Node *node) |
| Elimina del heap el nodo node. | |
| void | remove_all_and_delete () noexcept |
| Borra todos los nodos del heap, invoca a los destructores de los nodos eliminados y libera toda la memoria. | |
| Node * | top () |
| Retorna el nodo con menor prioridad según el criterio de comparación especificado en la declaración. | |
| Node * | top () const |
| const size_t & | size () const noexcept |
| bool | is_empty () const noexcept |
| bool | verify_heap () const |
Private Attributes | |
| Distance | dist |
| Access_Heap_Node | access_node |
| Distance_Compare< GT, Distance > | dist_cmp |
Additional Inherited Members | |
Protected Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare > | |
| virtual bool | verify_heap (Node *p) const |
Static Protected Member Functions inherited from Aleph::GenBinHeap< NodeType, Key, Compare > | |
| static Node * | advance_left (Node *p) noexcept |
| static Node * | advance_right (Node *p) noexcept |
Protected Attributes inherited from Aleph::GenBinHeap< NodeType, Key, Compare > | |
| Compare | cmp |
|
inline |
|
delete |
Copying is disabled (heap manages internal node memory)
|
inlinenoexcept |
|
inline |
Destructor. Clears all remaining heap nodes.
Definition at line 166 of file archeap.H.
References ArcHeap< GT, Distance, Access_Heap_Node >::empty().
|
inline |
Remove all heap nodes and delete their memory.
Definition at line 160 of file archeap.H.
References Aleph::GenBinHeap< NodeType, Key, Compare >::remove_all_and_delete().
Referenced by ArcHeap< GT, Distance, Access_Heap_Node >::~ArcHeap(), and ArcHeap< GT, Distance, Access_Heap_Node >::operator=().
|
inline |
Return the distance functor used to compare arcs in this heap.
Definition at line 63 of file archeap.H.
References ArcHeap< GT, Distance, Access_Heap_Node >::dist.
|
inline |
Extract the arc with minimum distance from the heap and clear its node-to-heap mapping.
Definition at line 136 of file archeap.H.
References ArcHeap< GT, Distance, Access_Heap_Node >::access_node, Aleph::BinHeapNode< Key >::get_key(), Aleph::GenBinHeap< NodeType, Key, Compare >::getMin(), Aleph::maps(), GTArcCommon< ArcInfo >::src_node, and GTArcCommon< ArcInfo >::tgt_node.
Referenced by Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::min_spanning_tree(), and Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree().
|
inlinenoexcept |
Move assignment transfers ownership of heap nodes.
Definition at line 85 of file archeap.H.
References ArcHeap< GT, Distance, Access_Heap_Node >::access_node, ArcHeap< GT, Distance, Access_Heap_Node >::dist, ArcHeap< GT, Distance, Access_Heap_Node >::dist_cmp, ArcHeap< GT, Distance, Access_Heap_Node >::empty(), and Aleph::maps().
|
delete |
|
inline |
Insert or update an arc associated with a target node, keeping the smallest-distance arc per node in the heap.
Definition at line 107 of file archeap.H.
References ArcHeap< GT, Distance, Access_Heap_Node >::access_node, ArcHeap< GT, Distance, Access_Heap_Node >::dist_cmp, Aleph::BinHeapNode< Key >::get_key(), Aleph::GenBinHeap< NodeType, Key, Compare >::insert(), Aleph::maps(), and Aleph::GenBinHeap< NodeType, Key, Compare >::update().
Referenced by Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::min_spanning_tree(), and Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree().
|
private |
Definition at line 58 of file archeap.H.
Referenced by ArcHeap< GT, Distance, Access_Heap_Node >::get_min_arc(), ArcHeap< GT, Distance, Access_Heap_Node >::operator=(), and ArcHeap< GT, Distance, Access_Heap_Node >::put_arc().
|
private |
Definition at line 57 of file archeap.H.
Referenced by ArcHeap< GT, Distance, Access_Heap_Node >::get_distance(), and ArcHeap< GT, Distance, Access_Heap_Node >::operator=().
|
private |
Definition at line 59 of file archeap.H.
Referenced by ArcHeap< GT, Distance, Access_Heap_Node >::operator=(), and ArcHeap< GT, Distance, Access_Heap_Node >::put_arc().