Fibonacci heap. More...
#include <fibonacci_heap.hh>
Public Member Functions | |
void | clear () |
Clear all elements in the heap and make the heap empty. | |
fibonacci_heap () | |
Default constructor. | |
fibonacci_heap (const fibonacci_heap< P, T > &node) | |
Copy constructor Be ware that once this heap is constructed, the argument node is cleared and all its elements are part of this new heap. | |
const T & | front () const |
Return the minimum value in the heap. | |
bool | is_empty () const |
Is it empty? | |
bool | is_valid () const |
return false if it is empty. | |
unsigned | nelements () const |
Return the number of elements. | |
fibonacci_heap< P, T > & | operator= (fibonacci_heap< P, T > &rhs) |
Assignment operator. | |
T | pop_front () |
Return and remove the minimum value in the heap. | |
void | push (const P &priority, const T &value) |
Push a new element in the heap. | |
void | push (fibonacci_heap< P, T > &other_heap) |
Take other_heap's elements and insert them in this heap. |
Fibonacci heap.
Definition at line 117 of file fibonacci_heap.hh.
mln::util::fibonacci_heap< P, T >::fibonacci_heap | ( | ) | [inline] |
Default constructor.
Definition at line 472 of file fibonacci_heap.hh.
mln::util::fibonacci_heap< P, T >::fibonacci_heap | ( | const fibonacci_heap< P, T > & | node | ) | [inline] |
Copy constructor Be ware that once this heap is constructed, the argument node
is cleared and all its elements are part of this new heap.
Definition at line 480 of file fibonacci_heap.hh.
void mln::util::fibonacci_heap< P, T >::clear | ( | ) | [inline] |
Clear all elements in the heap and make the heap empty.
Definition at line 723 of file fibonacci_heap.hh.
References mln::util::fibonacci_heap< P, T >::pop_front().
const T & mln::util::fibonacci_heap< P, T >::front | ( | ) | const [inline] |
Return the minimum value in the heap.
Definition at line 569 of file fibonacci_heap.hh.
bool mln::util::fibonacci_heap< P, T >::is_empty | ( | ) | const [inline] |
Is it empty?
Definition at line 705 of file fibonacci_heap.hh.
Referenced by mln::util::fibonacci_heap< P, T >::pop_front(), and mln::util::fibonacci_heap< P, T >::push().
bool mln::util::fibonacci_heap< P, T >::is_valid | ( | ) | const [inline] |
return false if it is empty.
Definition at line 714 of file fibonacci_heap.hh.
Referenced by mln::util::fibonacci_heap< P, T >::pop_front().
unsigned mln::util::fibonacci_heap< P, T >::nelements | ( | ) | const [inline] |
Return the number of elements.
Definition at line 745 of file fibonacci_heap.hh.
fibonacci_heap< P, T > & mln::util::fibonacci_heap< P, T >::operator= | ( | fibonacci_heap< P, T > & | rhs | ) | [inline] |
Assignment operator.
Be ware that this operator do *not* copy the data from rhs
to this heap. It moves all elements which means that afterwards, rhs
is is cleared and all its elements are part of this new heap.
Definition at line 754 of file fibonacci_heap.hh.
T mln::util::fibonacci_heap< P, T >::pop_front | ( | ) | [inline] |
Return and remove the minimum value in the heap.
Definition at line 578 of file fibonacci_heap.hh.
References mln::util::fibonacci_heap< P, T >::is_empty(), mln::util::fibonacci_heap< P, T >::is_valid(), and mln::util::fibonacci_heap< P, T >::push().
Referenced by mln::util::fibonacci_heap< P, T >::clear().
void mln::util::fibonacci_heap< P, T >::push | ( | const P & | priority, | |
const T & | value | |||
) | [inline] |
Push a new element in the heap.
Definition at line 508 of file fibonacci_heap.hh.
Referenced by mln::util::fibonacci_heap< P, T >::pop_front().
void mln::util::fibonacci_heap< P, T >::push | ( | fibonacci_heap< P, T > & | other_heap | ) | [inline] |
Take other_heap's
elements and insert them in this heap.
After this call other_heap
is cleared.
Definition at line 520 of file fibonacci_heap.hh.
References mln::util::fibonacci_heap< P, T >::is_empty().