ell::util::PriorityQueue< QV > Class Template Reference
#include <PriorityQueue.hh>
Detailed Description
template<class QV>
class ell::util::PriorityQueue< QV >
Implements a priority queue of compressed states that are ordered according to their energy (using lexicographical order on compressed string representation as tiebreaker). The top() element corresponds to the state with the smallest energy in the queue.
Definition at line 18 of file PriorityQueue.hh.
Public Types | |
typedef InternalPQtype::const_iterator | const_iterator |
typedef InternalPQtype::iterator | iterator |
typedef InternalPQtype::size_type | size_type |
Public Member Functions | |
iterator | begin (void) |
const_iterator | begin (void) const |
bool | empty (void) const |
iterator | end (void) |
const_iterator | end (void) const |
void | erase (const QueueKey &key) |
void | erase (const State *s) |
iterator | find (const QueueKey &key) |
const_iterator | find (const QueueKey &key) const |
iterator | find (const State *s) |
const_iterator | find (const State *s) const |
double | getMaxE (void) const |
iterator | insert (const QueueKey &key) |
iterator | insert (const State *keyState) |
void | pop (void) |
PriorityQueue () | |
void | reduceMaxE (const double maxE) |
size_type | size (void) const |
const_iterator | top (void) const |
virtual | ~PriorityQueue () |
Protected Types | |
typedef std::map< QueueKey, QV > | InternalPQtype |
Protected Attributes | |
InternalPQtype | pq |
Data Structures | |
class | QueueKey |
the key for an element of the queue More... |
Member Typedef Documentation
typedef InternalPQtype::const_iterator ell::util::PriorityQueue< QV >::const_iterator |
constant iterator to a <QueueKey, T> pair of the queue
Definition at line 49 of file PriorityQueue.hh.
typedef std::map< QueueKey, QV > ell::util::PriorityQueue< QV >::InternalPQtype [protected] |
shortcut for the internal priority queue data structure
Definition at line 41 of file PriorityQueue.hh.
typedef InternalPQtype::iterator ell::util::PriorityQueue< QV >::iterator |
typedef InternalPQtype::size_type ell::util::PriorityQueue< QV >::size_type |
Constructor & Destructor Documentation
ell::util::PriorityQueue< QV >::PriorityQueue | ( | ) |
construction
virtual ell::util::PriorityQueue< QV >::~PriorityQueue | ( | ) | [virtual] |
destruction
Member Function Documentation
iterator ell::util::PriorityQueue< QV >::begin | ( | void | ) |
returns an iterator to the top() element of the queue
const_iterator ell::util::PriorityQueue< QV >::begin | ( | void | ) | const |
returns a constant iterator to the top() element of the queue
bool ell::util::PriorityQueue< QV >::empty | ( | void | ) | const |
Whether or not the queue contains no elements
- Returns:
- true if size()==0 and false otherwise
iterator ell::util::PriorityQueue< QV >::end | ( | void | ) |
returns an iterator behind the last element of the queue
const_iterator ell::util::PriorityQueue< QV >::end | ( | void | ) | const |
returns a constant iterator behind the last element of the queue
void ell::util::PriorityQueue< QV >::erase | ( | const QueueKey & | key | ) |
Erases the key/value pair of the given key
- Parameters:
-
key the key to erase the key/value pair of
void ell::util::PriorityQueue< QV >::erase | ( | const State * | s | ) |
Erases the key/value pair representing the given state
- Parameters:
-
s the state of that the key/value pair is to erase
iterator ell::util::PriorityQueue< QV >::find | ( | const QueueKey & | key | ) |
const_iterator ell::util::PriorityQueue< QV >::find | ( | const QueueKey & | key | ) | const |
iterator ell::util::PriorityQueue< QV >::find | ( | const State * | s | ) |
const_iterator ell::util::PriorityQueue< QV >::find | ( | const State * | s | ) | const |
double ell::util::PriorityQueue< QV >::getMaxE | ( | void | ) | const |
Returns the maximal energy stored in the queue
- Returns:
- the energy of the last queue element
iterator ell::util::PriorityQueue< QV >::insert | ( | const QueueKey & | key | ) |
Inserts an empty QueueValue for the given key. The new QueueValue object is created and can be filled afterwards using the provided iterator. NOTE: An already existing QueueValue object for the given key will be overwritten!
- Parameters:
-
key the key a new value is to be inserted
- Returns:
- the iterator to the newly created QueueValue object.
iterator ell::util::PriorityQueue< QV >::insert | ( | const State * | keyState | ) |
Inserts a key/value pair to the queue using the given information. A new QueueValue object is created and can be filled afterwards using the provided iterator. NOTE: An already existing QueueValue object for the given key will be overwritten!
- Parameters:
-
keyState the state that is to be inserted as a key
- Returns:
- the iterator to the newly created QueueValue object.
void ell::util::PriorityQueue< QV >::pop | ( | void | ) |
deletes the top element of the queue
void ell::util::PriorityQueue< QV >::reduceMaxE | ( | const double | maxE | ) |
Deletes all elements from the queue with key.E >= maxE
- Parameters:
-
maxE the energy to that all elements of the queue should be smaller
size_type ell::util::PriorityQueue< QV >::size | ( | void | ) | const |
the number of elements in the queue
- Returns:
- the number of elements
const_iterator ell::util::PriorityQueue< QV >::top | ( | void | ) | const |
returns the top element of the queue which is the top() element
Field Documentation
InternalPQtype ell::util::PriorityQueue< QV >::pq [protected] |
The documentation for this class was generated from the following file:
- src/ell/util/PriorityQueue.hh