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 * >
 The heap's node type.
 
- 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.
 
void clear ()
 Empties the container.
 
 ~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
 Inserts a node into a heap.
 
Node * getMin_ne () noexcept
 
Node * getMin ()
 Removes the node with the lowest priority from the heap.
 
Node * getMax ()
 
void update (Node *p) noexcept
 Updates the priority of a node contained in the heap.
 
Node * remove (Node *node)
 Removes node from the heap.
 
void remove_all_and_delete () noexcept
 Deletes all the nodes of the heap, invokes the destructors of the removed nodes, and frees all the memory.
 
Node * top ()
 Returns the node with the lowest priority according to the comparison criterion specified in the declaration.
 
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
 

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 173 of file archeap.H.

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

Member Function Documentation

◆ clear()

Empties the container.

Exceptions
none
See also
empty()

Definition at line 170 of file archeap.H.

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

◆ 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: