Generated on Wed Nov 1 15:05:25 2006 for Gecode by doxygen 1.4.5

Gecode::Support::PQueue< T, Less > Class Template Reference
[Support algorithms and datastructures]

#include <static-pqueue.hh>

List of all members.


Detailed Description

template<class T, class Less>
class Gecode::Support::PQueue< T, Less >

Simple fixed-size priority queue.

The order is implemented by an instance of the class Less which must provide the single member function

 bool operator()(const T&, const T&) 
for comparing elements.

Requires

Definition at line 51 of file static-pqueue.hh.

Public Member Functions

 PQueue (void)
 Default constructor (creates empty queue).
 PQueue (int n, const Less &l)
 Create for n elements and order l.
void init (int, const Less &)
 Initialize for n elements and order l.
 PQueue (const PQueue &p)
 Assign queue from queue p (elements are shared).
const PQueueoperator= (const PQueue &)
 Assign queue from queue p (elements are shared).
 ~PQueue (void)
 Release queue.
bool empty (void) const
 Test whether queue is empty.
void insert (const T &x)
 Insert element x according to order.
void remove (void)
 Remove smallest element.
T & top (void)
 Provide access to smallest element.
void fix (void)
 Reorder queue after smallest element has changed (might not be smallest any longer).
void update (const PQueue< T, Less > &p, bool share)
 Update this queue from queue p (share elements if share is true).


Constructor & Destructor Documentation

template<class T, class Less>
Gecode::Support::PQueue< T, Less >::PQueue void   )  [inline]
 

Default constructor (creates empty queue).

Definition at line 145 of file static-pqueue.hh.

template<class T, class Less>
Gecode::Support::PQueue< T, Less >::PQueue int  n,
const Less &  l
[inline]
 

Create for n elements and order l.

Definition at line 150 of file static-pqueue.hh.

template<class T, class Less>
Gecode::Support::PQueue< T, Less >::PQueue const PQueue< T, Less > &  p  ) 
 

Assign queue from queue p (elements are shared).

template<class T, class Less>
Gecode::Support::PQueue< T, Less >::~PQueue void   )  [inline]
 

Release queue.

Definition at line 198 of file static-pqueue.hh.


Member Function Documentation

template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::init int  ,
const Less & 
[inline]
 

Initialize for n elements and order l.

Definition at line 155 of file static-pqueue.hh.

template<class T, class Less>
const PQueue& Gecode::Support::PQueue< T, Less >::operator= const PQueue< T, Less > &   ) 
 

Assign queue from queue p (elements are shared).

template<class T, class Less>
bool Gecode::Support::PQueue< T, Less >::empty void   )  const [inline]
 

Test whether queue is empty.

Definition at line 205 of file static-pqueue.hh.

template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::insert const T &  x  )  [inline]
 

Insert element x according to order.

Definition at line 212 of file static-pqueue.hh.

template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::remove void   )  [inline]
 

Remove smallest element.

Definition at line 219 of file static-pqueue.hh.

template<class T, class Less>
T & Gecode::Support::PQueue< T, Less >::top void   )  [inline]
 

Provide access to smallest element.

Definition at line 226 of file static-pqueue.hh.

template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::fix void   )  [inline]
 

Reorder queue after smallest element has changed (might not be smallest any longer).

Definition at line 232 of file static-pqueue.hh.

template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::update const PQueue< T, Less > &  p,
bool  share
[inline]
 

Update this queue from queue p (share elements if share is true).

Definition at line 182 of file static-pqueue.hh.


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