Gecode::Support::PQueue< T, Less > Class Template Reference
[Support algorithms and datastructures]
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&)
Definition at line 55 of file static-pqueue.icc.
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
template<class T, class Less>
Gecode::Support::PQueue< T, Less >::PQueue | ( | void | ) | [inline] |
template<class T, class Less>
Gecode::Support::PQueue< T, Less >::PQueue | ( | int | n, | |
const Less & | l | |||
) | [inline] |
template<class T, class Less>
Gecode::Support::PQueue< T, Less >::PQueue | ( | const PQueue< T, Less > & | p | ) | [inline] |
template<class T, class Less>
Gecode::Support::PQueue< T, Less >::~PQueue | ( | void | ) | [inline] |
Member Function Documentation
template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::init | ( | int | n, | |
const Less & | l | |||
) | [inline] |
template<class T, class Less>
const PQueue< T, Less > & Gecode::Support::PQueue< T, Less >::operator= | ( | const PQueue< T, Less > & | p | ) | [inline] |
template<class T, class Less>
bool Gecode::Support::PQueue< T, Less >::empty | ( | void | ) | const [inline] |
template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::insert | ( | const T & | x | ) | [inline] |
template<class T, class Less>
void Gecode::Support::PQueue< T, Less >::remove | ( | void | ) | [inline] |
template<class T, class Less>
T & Gecode::Support::PQueue< T, Less >::top | ( | void | ) | [inline] |
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 236 of file static-pqueue.icc.
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 186 of file static-pqueue.icc.
The documentation for this class was generated from the following file:
- gecode/support/static-pqueue.icc (Revision: 4971)