KrisLibrary
1.0.0
|
Contains a priority queue with an associated index, allowing updates of the priority value. Priority defined with lowest value first. More...
#include <IndexedPriorityQueue.h>
Public Types | |
typedef std::pair< PT, IT > | value_type |
typedef std::set< std::pair< PT, IT > >::iterator | iterator |
typedef std::set< std::pair< PT, IT > >::const_iterator | const_iterator |
Contains a priority queue with an associated index, allowing updates of the priority value. Priority defined with lowest value first.
An index is provided with each priority queue entry, allowing a priority value to be located from an index in logarithmic time.
IT is the type of the index. PT is the type of the priority value. It is assumed that the < operator has been defined for both types.
Most members operate like STL's priority_queue<pair<PT,IT> >. Be sure to remember that the returned pair has PT as its first type, and IT as its second!
The new members are as follows:
One index value can only map to one priority value (that is, insert(2,0.5) and insert(2,0.7) is an invalid operation).
Undefined behavior will result if any iterator is modified.