Generated on Mon Jun 23 17:18:30 2008 for ell-2.3.0 by doxygen 1.5.1

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

template<class QV>
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.

template<class QV>
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.

template<class QV>
typedef InternalPQtype::iterator ell::util::PriorityQueue< QV >::iterator

iterator to a <QueueKey,QueueVal> pair of the queue

Definition at line 51 of file PriorityQueue.hh.

template<class QV>
typedef InternalPQtype::size_type ell::util::PriorityQueue< QV >::size_type

size type of the queue

Definition at line 53 of file PriorityQueue.hh.


Constructor & Destructor Documentation

template<class QV>
ell::util::PriorityQueue< QV >::PriorityQueue (  ) 

construction

template<class QV>
virtual ell::util::PriorityQueue< QV >::~PriorityQueue (  )  [virtual]

destruction


Member Function Documentation

template<class QV>
iterator ell::util::PriorityQueue< QV >::begin ( void   ) 

returns an iterator to the top() element of the queue

template<class QV>
const_iterator ell::util::PriorityQueue< QV >::begin ( void   )  const

returns a constant iterator to the top() element of the queue

template<class QV>
bool ell::util::PriorityQueue< QV >::empty ( void   )  const

Whether or not the queue contains no elements

Returns:
true if size()==0 and false otherwise

template<class QV>
iterator ell::util::PriorityQueue< QV >::end ( void   ) 

returns an iterator behind the last element of the queue

template<class QV>
const_iterator ell::util::PriorityQueue< QV >::end ( void   )  const

returns a constant iterator behind the last element of the queue

template<class QV>
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

template<class QV>
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

template<class QV>
iterator ell::util::PriorityQueue< QV >::find ( const QueueKey key  ) 

Returns an iterator to the queue element representing s or end() otherwise.

Parameters:
key the key to find
Returns:
iterator to the element or end() if not found

template<class QV>
const_iterator ell::util::PriorityQueue< QV >::find ( const QueueKey key  )  const

Returns a constant iterator to the queue element representing s or end() otherwise.

Parameters:
key the key to find
Returns:
constant iterator to the element or end() if not found

template<class QV>
iterator ell::util::PriorityQueue< QV >::find ( const State s  ) 

Returns an iterator to the queue element representing s or end() otherwise.

Parameters:
s the state of which the representation has to be found
Returns:
iterator to the element or end() if not found

template<class QV>
const_iterator ell::util::PriorityQueue< QV >::find ( const State s  )  const

Returns a constant iterator to the queue element representing s or end() otherwise.

Parameters:
s the state of which the representation has to be found
Returns:
constant iterator to the element or end() if not found

template<class QV>
double ell::util::PriorityQueue< QV >::getMaxE ( void   )  const

Returns the maximal energy stored in the queue

Returns:
the energy of the last queue element

template<class QV>
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.

template<class QV>
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.

template<class QV>
void ell::util::PriorityQueue< QV >::pop ( void   ) 

deletes the top element of the queue

template<class QV>
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

template<class QV>
size_type ell::util::PriorityQueue< QV >::size ( void   )  const

the number of elements in the queue

Returns:
the number of elements

template<class QV>
const_iterator ell::util::PriorityQueue< QV >::top ( void   )  const

returns the top element of the queue which is the top() element


Field Documentation

template<class QV>
InternalPQtype ell::util::PriorityQueue< QV >::pq [protected]

the internal priority queue data structure

Definition at line 44 of file PriorityQueue.hh.


The documentation for this class was generated from the following file: