Stxxl  1.2.1
PRIORITY_QUEUE_GENERATOR< Tp_, Cmp_, IntM_, MaxS_, Tune_ > Class Template Reference

Priority queue type generator. More...

#include <priority_queue.h>

List of all members.


Detailed Description

template<class Tp_, class Cmp_, unsigned_type IntM_, unsigned MaxS_, unsigned Tune_ = 6>
class PRIORITY_QUEUE_GENERATOR< Tp_, Cmp_, IntM_, MaxS_, Tune_ >

Priority queue type generator.

Implements a data structure from "Peter Sanders. Fast Priority Queues
for Cached Memory. ALENEX'99" for external memory.
<BR>
Template parameters:
- Tp_ type of the contained objects
- Cmp_ the comparison type used to determine
whether one element is smaller than another element.
If Cmp_(x,y) is true, then x is smaller than y. The element
returned by Q.top() is the largest element in the priority
queue. That is, it has the property that, for every other
element \b x in the priority queue, Cmp_(Q.top(), x) is false.
Cmp_ must also provide min_value method, that returns value of type Tp_ that is
smaller than any element of the queue \b x , i.e. Cmp_(Cmp_.min_value(),x) is
always \b true . <BR>
<BR>
Example: comparison object for priority queue
where \b top() returns the \b smallest contained integer:
@verbatim 

//! struct CmpIntGreater //! { //! bool operator () (const int & a, const int & b) const { return a>b; } //! int min_value() const { return std::numeric_limits<int>::max(); } //! }; //! Example: comparison object for priority queue where top() returns the largest contained integer:

//! struct CmpIntLess
//! {
//!   bool operator () (const int & a, const int & b) const { return a<b; }
//!   int min_value() const  { return std::numeric_limits<int>::min(); }
//! };
//! 

Note that Cmp_ must define strict weak ordering. (see what it is)


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