Gecode::Support::PQueue< T, Less > Class Template Reference
[Support algorithms and datastructures]
#include <static-pqueue.hh>
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&)
Requires
#include "gecode/support/static-pqueue.hh"
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 PQueue & | operator= (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
|
Default constructor (creates empty queue).
Definition at line 145 of file static-pqueue.hh. |
|
Create for n elements and order l.
Definition at line 150 of file static-pqueue.hh. |
|
Assign queue from queue p (elements are shared).
|
|
Release queue.
Definition at line 198 of file static-pqueue.hh. |
Member Function Documentation
|
Initialize for n elements and order l.
Definition at line 155 of file static-pqueue.hh. |
|
Assign queue from queue p (elements are shared).
|
|
Test whether queue is empty.
Definition at line 205 of file static-pqueue.hh. |
|
Insert element x according to order.
Definition at line 212 of file static-pqueue.hh. |
|
Remove smallest element.
Definition at line 219 of file static-pqueue.hh. |
|
Provide access to smallest element.
Definition at line 226 of file static-pqueue.hh. |
|
Reorder queue after smallest element has changed (might not be smallest any longer).
Definition at line 232 of file static-pqueue.hh. |
|
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:
- gecode/support/static-pqueue.hh (Revision: 3514)