PQueue< T > Class Template Reference

A standard linked-list based priority queue templaye. More...

#include </usr1/tp517/Tumble/trunk/src/tumble/util.h>

List of all members.

Public Member Functions

 PQueue ()
int size ()
bool pop (T &val)
void push (const T &val, double p)
bool remove (const T &val)
void print ()

Public Attributes

int sz
PQueueEntry< T > * front
PQueueEntry< T > * back


Detailed Description

template<class T>
class PQueue< T >

A standard linked-list based priority queue templaye.

This has $ O(n^2) $ behavior for inserts.

This should be used for queues that are less than 25 elements, as in devilliers vertex removal algorithm.

Definition at line 608 of file util.h.


Constructor & Destructor Documentation

template<class T>
PQueue< T >::PQueue (  )  [inline]

Definition at line 613 of file util.h.

References PQueue< T >::back, PQueue< T >::front, and PQueue< T >::sz.


Member Function Documentation

template<class T>
int PQueue< T >::size (  )  [inline]

Definition at line 618 of file util.h.

References PQueue< T >::sz.

template<class T>
bool PQueue< T >::pop ( T &  val  )  [inline]

Definition at line 637 of file util.h.

References PQueue< T >::back, PQueue< T >::front, PQueueEntry< T >::i, PQueueEntry< T >::next, and PQueue< T >::sz.

template<class T>
void PQueue< T >::push ( const T &  val,
double  p 
) [inline]

Definition at line 650 of file util.h.

References PQueue< T >::back, PQueue< T >::front, PQueueEntry< T >::next, PQueueEntry< T >::p, PQueueEntry< T >::prev, and PQueue< T >::sz.

template<class T>
bool PQueue< T >::remove ( const T &  val  )  [inline]

Definition at line 681 of file util.h.

References PQueue< T >::back, PQueue< T >::front, PQueueEntry< T >::i, PQueueEntry< T >::next, PQueueEntry< T >::prev, and PQueue< T >::sz.

template<class T>
void PQueue< T >::print (  )  [inline]

Definition at line 624 of file util.h.

References PQueue< T >::front, PQueueEntry< T >::i, PQueueEntry< T >::next, and PQueueEntry< T >::p.


Member Data Documentation

template<class T>
int PQueue< T >::sz

Definition at line 610 of file util.h.

Referenced by PQueue< T >::pop(), PQueue< T >::PQueue(), PQueue< T >::push(), PQueue< T >::remove(), and PQueue< T >::size().

template<class T>
PQueueEntry<T>* PQueue< T >::front

Definition at line 611 of file util.h.

Referenced by PQueue< T >::pop(), PQueue< T >::PQueue(), PQueue< T >::print(), PQueue< T >::push(), and PQueue< T >::remove().

template<class T>
PQueueEntry<T> * PQueue< T >::back

Definition at line 611 of file util.h.

Referenced by PQueue< T >::pop(), PQueue< T >::PQueue(), PQueue< T >::push(), and PQueue< T >::remove().


The documentation for this class was generated from the following file:
Generated on Mon May 24 09:53:34 2010 for TUMBLE by  doxygen 1.5.2