Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Fibonacci_Heap< T, Compare >::Node Struct Reference

Represents a node in the Fibonacci Heap. More...

#include <tpl_fibonacci_heap.H>

Collaboration diagram for Aleph::Fibonacci_Heap< T, Compare >::Node:
[legend]

Public Member Functions

 Node (const T &d)
 Construct a node copying d into the internal storage.
 
 Node (T &&d) noexcept(std::is_nothrow_move_constructible_v< T >)
 Construct a node moving d into the internal storage.
 
template<typename Arg , typename... Args, std::enable_if_t<(sizeof...(Args) >=1)||(!std::is_same_v< std::decay_t< Arg >, T > &&!std::is_same_v< std::decay_t< Arg >, Node >), int > = 0>
 Node (Arg &&arg, Args &&... args)
 Perfect-forwarding constructor for in-place construction.
 

Public Attributes

T data
 The data stored in this node.
 
Nodeparent = nullptr
 Parent node (nullptr if root)
 
Nodechild = nullptr
 Pointer to one child (head of child list)
 
Nodeleft = this
 Left sibling in circular list.
 
Noderight = this
 Right sibling in circular list.
 
size_t degree = 0
 Number of children.
 
bool mark = false
 Has this node lost a child since becoming non-root?
 

Detailed Description

template<typename T, class Compare = Aleph::less<T>>
struct Aleph::Fibonacci_Heap< T, Compare >::Node

Represents a node in the Fibonacci Heap.

This structure is publicly accessible to allow external algorithms (such as Dijkstra or Prim) to store handles (pointers) to nodes and perform efficient decrease_key operations.

Warning
Users should not modify node fields directly. Use the heap's methods (decrease_key, delete_node) instead.

Definition at line 125 of file tpl_fibonacci_heap.H.

Constructor & Destructor Documentation

◆ Node() [1/3]

template<typename T , class Compare = Aleph::less<T>>
Aleph::Fibonacci_Heap< T, Compare >::Node::Node ( const T d)
inlineexplicit

Construct a node copying d into the internal storage.

Definition at line 136 of file tpl_fibonacci_heap.H.

◆ Node() [2/3]

template<typename T , class Compare = Aleph::less<T>>
Aleph::Fibonacci_Heap< T, Compare >::Node::Node ( T &&  d)
inlineexplicitnoexcept

Construct a node moving d into the internal storage.

Definition at line 139 of file tpl_fibonacci_heap.H.

◆ Node() [3/3]

template<typename T , class Compare = Aleph::less<T>>
template<typename Arg , typename... Args, std::enable_if_t<(sizeof...(Args) >=1)||(!std::is_same_v< std::decay_t< Arg >, T > &&!std::is_same_v< std::decay_t< Arg >, Node >), int > = 0>
Aleph::Fibonacci_Heap< T, Compare >::Node::Node ( Arg &&  arg,
Args &&...  args 
)
inlineexplicit

Perfect-forwarding constructor for in-place construction.

This overload allows callers of Fibonacci_Heap::emplace() to forward arbitrary constructor arguments for T without creating temporaries.

Template Parameters
ArgFirst argument forwarded to the T constructor.
ArgsRemaining constructor arguments.
Parameters
argFirst argument forwarded to the stored value.
argsRemaining arguments forwarded to the stored value.

Definition at line 157 of file tpl_fibonacci_heap.H.

Member Data Documentation

◆ child

◆ data

◆ degree

template<typename T , class Compare = Aleph::less<T>>
size_t Aleph::Fibonacci_Heap< T, Compare >::Node::degree = 0

◆ left

◆ mark

template<typename T , class Compare = Aleph::less<T>>
bool Aleph::Fibonacci_Heap< T, Compare >::Node::mark = false

Has this node lost a child since becoming non-root?

Definition at line 133 of file tpl_fibonacci_heap.H.

Referenced by Aleph::Fibonacci_Heap< T, Compare >::cut().

◆ parent

◆ right


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