Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ArcHeap< GT, Distance, Access_Heap_Node > Class Template Reference

#include <archeap.H>

Inheritance diagram for ArcHeap< GT, Distance, Access_Heap_Node >:
[legend]
Collaboration diagram for ArcHeap< GT, Distance, Access_Heap_Node >:
[legend]

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

Distanceget_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)
 
ArcHeapoperator= (const ArcHeap &)=delete
 
 ArcHeap (ArcHeap &&other) noexcept
 Move construction transfers ownership of heap nodes.
 
ArcHeapoperator= (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::Arcget_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
 
NodegetRoot () noexcept
 
NodegetRoot () 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
 
Nodeinsert (Node *p) noexcept
 Inserta un nodo en un heap.
 
NodegetMin_ne () noexcept
 
NodegetMin ()
 Elimina del heap el nodo de menor prioridad.
 
NodegetMax ()
 
void update (Node *p) noexcept
 Actualiza prioridad de un nodo contenido en el heap.
 
Noderemove (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.
 
Nodetop ()
 Retorna el nodo con menor prioridad según el criterio de comparación especificado en la declaración.
 
Nodetop () const
 
const size_tsize () const noexcept
 
bool is_empty () const noexcept
 
bool verify_heap () const
 

Private Attributes

Distance dist
 
Access_Heap_Node access_node
 
Distance_Compare< GT, Distancedist_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 Nodeadvance_left (Node *p) noexcept
 
static Nodeadvance_right (Node *p) noexcept
 
- Protected Attributes inherited from Aleph::GenBinHeap< NodeType, Key, Compare >
Compare cmp
 

Detailed Description

template<class GT, class Distance, class Access_Heap_Node>
class ArcHeap< GT, Distance, Access_Heap_Node >

Definition at line 54 of file archeap.H.

Member Typedef Documentation

◆ handle_type

Definition at line 103 of file archeap.H.

◆ Heap

◆ Node

Constructor & Destructor Documentation

◆ ArcHeap() [1/3]

Construct an empty arc heap with the given distance functor and heap-node access policy.

Definition at line 67 of file archeap.H.

◆ ArcHeap() [2/3]

Copying is disabled (heap manages internal node memory)

◆ ArcHeap() [3/3]

Move construction transfers ownership of heap nodes.

Definition at line 79 of file archeap.H.

◆ ~ArcHeap()

Destructor. Clears all remaining heap nodes.

Definition at line 166 of file archeap.H.

References ArcHeap< GT, Distance, Access_Heap_Node >::empty().

Member Function Documentation

◆ empty()

◆ get_distance()

Distance & ArcHeap< GT, Distance, Access_Heap_Node >::get_distance ( )
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.

◆ get_min_arc()

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ put_arc()

Member Data Documentation

◆ access_node

◆ dist

◆ dist_cmp


The documentation for this class was generated from the following file: