STXXL
1.4.1
|
External priority queue data structure
Introduction to priority queue container: see STXXL Priority Queue tutorial.
Design and Internals of priority queue container: see Priority Queue.
Definition at line 98 of file priority_queue.h.
Public Types | |
enum | { delete_buffer_size = Config::delete_buffer_size, N = Config::N, IntKMAX = Config::IntKMAX, num_int_groups = Config::num_int_groups, num_ext_groups = Config::num_ext_groups, total_num_groups = Config::num_int_groups + Config::num_ext_groups, BlockSize = Config::BlockSize, ExtKMAX = Config::ExtKMAX } |
typedef Config::alloc_strategy_type | alloc_strategy_type |
typedef typed_block< BlockSize, value_type > | block_type |
Type of the block used in disk-memory transfers. More... | |
typedef Config::comparator_type | comparator_type |
Comparison object. More... | |
typedef ConfigType | Config |
typedef read_write_pool < block_type > | pool_type |
typedef stxxl::uint64 | size_type |
An unsigned integral type (64 bit). More... | |
typedef Config::value_type | value_type |
The type of object stored in the priority_queue. More... | |
Public Member Functions | |
Constructors/Destructors | |
priority_queue (pool_type &pool_) | |
Constructs external priority queue object. More... | |
priority_queue (prefetch_pool< block_type > &p_pool_, write_pool< block_type > &w_pool_) | |
Constructs external priority queue object. More... | |
priority_queue (unsigned_type p_pool_mem, unsigned_type w_pool_mem) | |
Constructs external priority queue object. More... | |
virtual | ~priority_queue () |
Capacity | |
size_type | size () const |
Returns number of elements contained. More... | |
bool | empty () const |
Returns true if queue has no elements. More... | |
Operators | |
const value_type & | top () const |
Returns "largest" element. More... | |
Modifiers | |
void | pop () |
Removes the element at the top. More... | |
void | push (const value_type &obj) |
Inserts x into the priority_queue. More... | |
Miscellaneous | |
unsigned_type | mem_cons () const |
Number of bytes consumed by the priority_queue from the internal memory not including pools (see the constructor) More... | |
void | dump_sizes () const |
void | dump_params () const |
Protected Types | |
typedef priority_queue_local::ext_merger < block_type, comparator_type, ExtKMAX, alloc_strategy_type > | ext_merger_type |
typedef priority_queue_local::internal_priority_queue < value_type, std::vector < value_type > , comparator_type > | insert_heap_type |
typedef priority_queue_local::loser_tree < value_type, comparator_type, IntKMAX > | int_merger_type |
Private Member Functions | |
unsigned_type | current_delete_buffer_size () const |
unsigned_type | current_group_buffer_size (unsigned_type i) const |
void | empty_insert_heap () |
value_type | get_supremum () const |
void | init () |
unsigned_type | make_space_available (unsigned_type level) |
void | refill_delete_buffer () |
size_type | refill_group_buffer (unsigned_type k) |
Private Member Functions inherited from stxxl::noncopyable | |
noncopyable () | |
typedef Config::alloc_strategy_type stxxl::priority_queue< ConfigType >::alloc_strategy_type |
Definition at line 118 of file priority_queue.h.
typedef typed_block<BlockSize, value_type> stxxl::priority_queue< ConfigType >::block_type |
Type of the block used in disk-memory transfers.
Definition at line 122 of file priority_queue.h.
typedef Config::comparator_type stxxl::priority_queue< ConfigType >::comparator_type |
Comparison object.
Definition at line 117 of file priority_queue.h.
typedef ConfigType stxxl::priority_queue< ConfigType >::Config |
Definition at line 101 of file priority_queue.h.
|
protected |
Definition at line 138 of file priority_queue.h.
|
protected |
Definition at line 127 of file priority_queue.h.
|
protected |
Definition at line 132 of file priority_queue.h.
typedef read_write_pool<block_type> stxxl::priority_queue< ConfigType >::pool_type |
Definition at line 123 of file priority_queue.h.
typedef stxxl::uint64 stxxl::priority_queue< ConfigType >::size_type |
An unsigned integral type (64 bit).
Definition at line 120 of file priority_queue.h.
typedef Config::value_type stxxl::priority_queue< ConfigType >::value_type |
The type of object stored in the priority_queue.
Definition at line 115 of file priority_queue.h.
anonymous enum |
Enumerator | |
---|---|
delete_buffer_size | |
N | |
IntKMAX | |
num_int_groups | |
num_ext_groups | |
total_num_groups | |
BlockSize | |
ExtKMAX |
Definition at line 102 of file priority_queue.h.
stxxl::priority_queue< ConfigType >::priority_queue | ( | pool_type & | pool_ | ) |
Constructs external priority queue object.
pool_ | pool of blocks that will be used for data writing and prefetching for the disk<->memory transfers happening in the priority queue. Larger pool size helps to speed up operations. |
Definition at line 377 of file priority_queue.h.
References stxxl::priority_queue< ConfigType >::init(), and STXXL_VERBOSE_PQ.
stxxl::priority_queue< ConfigType >::priority_queue | ( | prefetch_pool< block_type > & | p_pool_, |
write_pool< block_type > & | w_pool_ | ||
) |
Constructs external priority queue object.
p_pool_ | pool of blocks that will be used for data prefetching for the disk<->memory transfers happening in the priority queue. Larger pool size helps to speed up operations. |
w_pool_ | pool of blocks that will be used for writing data for the memory<->disk transfers happening in the priority queue. Larger pool size helps to speed up operations. |
Definition at line 390 of file priority_queue.h.
References stxxl::priority_queue< ConfigType >::init(), and STXXL_VERBOSE_PQ.
stxxl::priority_queue< ConfigType >::priority_queue | ( | unsigned_type | p_pool_mem, |
unsigned_type | w_pool_mem | ||
) |
Constructs external priority queue object.
p_pool_mem | memory (in bytes) for prefetch pool that will be used for data prefetching for the disk<->memory transfers happening in the priority queue. Larger pool size helps to speed up operations. |
w_pool_mem | memory (in bytes) for buffered write pool that will be used for writing data for the memory<->disk transfers happening in the priority queue. Larger pool size helps to speed up operations. |
Definition at line 402 of file priority_queue.h.
References stxxl::priority_queue< ConfigType >::init(), and STXXL_VERBOSE_PQ.
|
virtual |
Definition at line 436 of file priority_queue.h.
References STXXL_VERBOSE_PQ.
|
inlineprivate |
Definition at line 175 of file priority_queue.h.
|
inlineprivate |
Definition at line 176 of file priority_queue.h.
void stxxl::priority_queue< ConfigType >::dump_params | ( | ) | const |
Definition at line 837 of file priority_queue.h.
References STXXL_MSG.
void stxxl::priority_queue< ConfigType >::dump_sizes | ( | ) | const |
Definition at line 811 of file priority_queue.h.
References STXXL_MSG.
|
inline |
Returns true if queue has no elements.
Definition at line 257 of file priority_queue.h.
|
private |
Definition at line 730 of file priority_queue.h.
References stxxl::priority_queue_local::merge_iterator(), and STXXL_VERBOSE_PQ.
|
inlineprivate |
Definition at line 174 of file priority_queue.h.
|
private |
Definition at line 414 of file priority_queue.h.
References stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::set_pool().
Referenced by stxxl::priority_queue< ConfigType >::priority_queue().
|
private |
|
inline |
Number of bytes consumed by the priority_queue from the internal memory not including pools (see the constructor)
Definition at line 300 of file priority_queue.h.
|
inline |
Removes the element at the top.
Removes the element at the top of the priority_queue, that is, the largest element in the priority_queue. Precondition: empty()
is false. Postcondition: size()
will be decremented by 1.
Definition at line 345 of file priority_queue.h.
|
inline |
Inserts x into the priority_queue.
Inserts x into the priority_queue. Postcondition: size()
will be incremented by 1.
Definition at line 362 of file priority_queue.h.
References stxxl::priority_queue< ConfigType >::push().
Referenced by stxxl::priority_queue< ConfigType >::push().
|
private |
Definition at line 511 of file priority_queue.h.
References stxxl::is_sorted(), stxxl::priority_queue_local::merge3_iterator(), stxxl::priority_queue_local::merge4_iterator(), stxxl::priority_queue_local::merge_iterator(), STXXL_MSG, STXXL_THROW2, and STXXL_VERBOSE_PQ.
|
private |
Definition at line 452 of file priority_queue.h.
References stxxl::is_sorted(), STXXL_MSG, and STXXL_VERBOSE_PQ.
|
inline |
Returns number of elements contained.
Definition at line 324 of file priority_queue.h.
References stxxl::priority_queue< ConfigType >::size().
Referenced by stxxl::priority_queue< ConfigType >::size().
|
inline |
Returns "largest" element.
Returns a const reference to the element at the top of the priority_queue. The element at the top is guaranteed to be the largest element in the priority queue, as determined by the comparison function comparator_type (the same as the second parameter of PRIORITY_QUEUE_GENERATOR utility class). That is, for every other element x in the priority_queue, comparator_type(Q.top(), x) is false. Precondition: empty()
is false.
Definition at line 333 of file priority_queue.h.
References stxxl::priority_queue< ConfigType >::top().
Referenced by stxxl::priority_queue< ConfigType >::top().
|
protected |
Definition at line 154 of file priority_queue.h.
|
protected |
Definition at line 150 of file priority_queue.h.
|
protected |
Definition at line 151 of file priority_queue.h.
|
protected |
Definition at line 152 of file priority_queue.h.
|
protected |
Definition at line 143 of file priority_queue.h.
|
protected |
Definition at line 147 of file priority_queue.h.
|
protected |
Definition at line 146 of file priority_queue.h.
|
protected |
Definition at line 157 of file priority_queue.h.
|
protected |
Definition at line 140 of file priority_queue.h.
|
protected |
Definition at line 160 of file priority_queue.h.
|
protected |
Definition at line 141 of file priority_queue.h.
|
protected |
Definition at line 142 of file priority_queue.h.
|
protected |
Definition at line 163 of file priority_queue.h.