Stxxl  1.3.2
Public Types | List of all members
PRIORITY_QUEUE_GENERATOR< Tp_, Cmp_, IntM_, MaxS_, Tune_ > Class Template Reference

Priority queue type generator. More...

#include <priority_queue.h>

Public Types

enum  { B = settings::B, m = settings::m, X = B * (settings::k - m) / settings::element_size, Buffer1Size = 32 }
 
enum  { N = ComputeN::N, AI = ComputeN::AI, AE = (m / 2 < 2) ? 2 : (m / 2) }
 
enum  { EConsumption = X * settings::element_size + settings::B * AE + ((MaxS_ / X) / AE) * settings::B * 1024 }
 
typedef
priority_queue_local::find_settings
< sizeof(Tp_), IntM_, MaxS_ >
::result 
settings
 
typedef
priority_queue_local::compute_N
<(1<< Tune_), X,
4 *Buffer1Size >::result 
ComputeN
 
typedef priority_queue
< priority_queue_config< Tp_,
Cmp_, Buffer1Size, N, AI, 2, B,
AE, 2 > > 
result
 

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>
\tparam type of the contained objects (POD with no references to internal memory)
\tparam 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:
//! 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: