#include <lemon/fib_heap.h>
Compare
specifies the ordering of the priorities. In a heap one can change the priority of an item, add or erase an item, etc.The methods increase and erase are not efficient in a Fibonacci heap. In case of many calls to these operations, it is better to use a binary heap.
Item | Type of the items to be stored. | |
Prio | Type of the priority of the items. | |
ItemIntMap | A read and writable Item int map, for the usage of the heap. | |
Compare | A class for the ordering of the priorities. The default is std::less<Prio> . |
Definition at line 67 of file fib_heap.h.
Public Types | |
enum | state_enum { IN_HEAP = 0, PRE_HEAP = -1, POST_HEAP = -2 } |
Status of the nodes. More... | |
Public Member Functions | |
int | size () const |
The number of items stored in the heap. | |
bool | empty () const |
Checks if the heap stores no items. | |
void | set (Item const item, PrioType const value) |
item gets to the heap with priority value independently if item was already there. | |
void | push (Item const item, PrioType const value) |
Adds item to the heap with priority value . | |
Item | top () const |
Returns the item with minimum priority relative to Compare . | |
PrioType | prio () const |
Returns the minimum priority relative to Compare . | |
PrioType & | operator[] (const Item &item) |
Returns the priority of item . | |
const PrioType & | operator[] (const Item &item) const |
Returns the priority of item . | |
void | pop () |
Deletes the item with minimum priority relative to Compare . | |
void | erase (const Item &item) |
Deletes item from the heap. | |
void | decrease (Item item, PrioType const value) |
Decreases the priority of item to value . | |
void | increase (Item item, PrioType const value) |
Increases the priority of item to value . | |
state_enum | state (const Item &item) const |
Returns if item is in, has already been in, or has never been in the heap. |
|
Definition at line 82 of file fib_heap.h. |
|
Returns the number of items stored in the heap. Definition at line 100 of file fib_heap.h. |
|
Returns Definition at line 107 of file fib_heap.h. |
|
This method returns the item with minimum priority relative to
Definition at line 133 of file fib_heap.h. |
|
It returns the minimum priority relative to
Definition at line 141 of file fib_heap.h. |
|
This function returns the priority of
Definition at line 149 of file fib_heap.h. |
|
It returns the priority of
Definition at line 159 of file fib_heap.h. |
|
This method sets the priority of Definition at line 199 of file fib_heap.h. |
Here is the call graph for this function:
|
This method returns PRE_HEAP if Definition at line 213 of file fib_heap.h. |