Public Member Functions

mln::util::fibonacci_heap< P, T > Class Template Reference
[Utilities]

Fibonacci heap. More...

#include <fibonacci_heap.hh>

Inheritance diagram for mln::util::fibonacci_heap< P, T >:
Inheritance graph

List of all members.

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.
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.

Detailed Description

template<typename P, typename T>
class mln::util::fibonacci_heap< P, T >

Fibonacci heap.

Definition at line 117 of file fibonacci_heap.hh.


Constructor & Destructor Documentation

template<typename P , typename T >
mln::util::fibonacci_heap< P, T >::fibonacci_heap (  )  [inline]

Default constructor.

Definition at line 472 of file fibonacci_heap.hh.

template<typename P , typename T >
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.


Member Function Documentation

template<typename P , typename T >
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().

template<typename P , typename T >
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.

template<typename P , typename T >
bool mln::util::fibonacci_heap< P, T >::is_empty (  )  const [inline]
template<typename P , typename T >
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().

template<typename P , typename T >
unsigned mln::util::fibonacci_heap< P, T >::nelements (  )  const [inline]

Return the number of elements.

Definition at line 745 of file fibonacci_heap.hh.

template<typename P , typename T >
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.

template<typename P , typename T >
T mln::util::fibonacci_heap< P, T >::pop_front (  )  [inline]
template<typename P , typename T >
void mln::util::fibonacci_heap< P, T >::push ( const P &  priority,
const T &  value 
) [inline]

Push a new element in the heap.

See also:
insert

Definition at line 508 of file fibonacci_heap.hh.

Referenced by mln::util::fibonacci_heap< P, T >::pop_front().

template<typename P , typename T >
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().