#include <fibonacci_heap.hh>
Public Member Functions | |
void | clear () |
Clear all elements in the heap and make the heap empty. | |
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. | |
fibonacci_heap () | |
Default constructor. | |
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 (fibonacci_heap< P, T > &other_heap) |
Take other_heap's elements and insert them in this heap. | |
void | push (const P &priority, const T &value) |
Push a new element in the heap. |
mln::util::fibonacci_heap< P, T >::fibonacci_heap | ( | ) | [inline] |
Default constructor.
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.
References mln::util::fibonacci_heap< P, T >::min_root, mln::util::fibonacci_heap< P, T >::num_marked_nodes, mln::util::fibonacci_heap< P, T >::num_nodes, and mln::util::fibonacci_heap< P, T >::num_trees.
void mln::util::fibonacci_heap< P, T >::clear | ( | ) | [inline] |
Clear all elements in the heap and make the heap empty.
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.
bool mln::util::fibonacci_heap< P, T >::is_empty | ( | ) | const [inline] |
Is it empty?
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] |
unsigned mln::util::fibonacci_heap< P, T >::nelements | ( | ) | const [inline] |
Return the number of elements.
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.
References mln::util::fibonacci_heap< P, T >::min_root, mln::util::fibonacci_heap< P, T >::num_marked_nodes, mln::util::fibonacci_heap< P, T >::num_nodes, and mln::util::fibonacci_heap< P, T >::num_trees.
T mln::util::fibonacci_heap< P, T >::pop_front | ( | ) | [inline] |
Return and remove the minimum value in the heap.
References mln::util::fibonacci_heap< P, T >::is_empty(), mln::util::fibonacci_heap< P, T >::is_valid(), mln::util::fibonacci_heap< P, T >::min_root, 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 | ( | 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.
References mln::util::fibonacci_heap< P, T >::is_empty(), mln::util::fibonacci_heap< P, T >::min_root, mln::util::fibonacci_heap< P, T >::num_marked_nodes, mln::util::fibonacci_heap< P, T >::num_nodes, and mln::util::fibonacci_heap< P, T >::num_trees.
void mln::util::fibonacci_heap< P, T >::push | ( | const P & | priority, | |
const T & | value | |||
) | [inline] |
Push a new element in the heap.
Referenced by mln::util::fibonacci_heap< P, T >::pop_front().