STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity > Class Template Reference

Detailed Description

template<class ValueType, class CompareType, unsigned MaxArity>
class stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >

Definition at line 32 of file pq_int_merger.h.

+ Inheritance diagram for stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >:
+ Collaboration diagram for stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >:

Public Types

enum  { max_arity = MaxArity }
 
typedef CompareType compare_type
 comparator object type More...
 
typedef int_merger< ValueType,
CompareType, MaxArity > 
self_type
 our type More...
 
typedef value_typesequence_type
 type of sequences in which the values are stored: memory arrays More...
 
typedef internal_size_type size_type
 size type of total number of item in merger More...
 
typedef loser_tree< self_type,
CompareType, MaxArity > 
tree_type
 type of embedded loser tree More...
 
typedef ValueType value_type
 type of values in merger More...
 

Public Member Functions

 ~int_merger ()
 
void append_array (value_type *target, unsigned_type length)
 append array to merger, takes ownership of the array. requires: is_space_available() == 1 More...
 
bool is_sentinel (const value_type &a) const
 True if a is the sentinel value. More...
 
bool is_space_available () const
 Whether there is still space for new array. More...
 
 m_size (0)
 
unsigned_type mem_cons () const
 
 mem_cons_ (0)
 
void multi_merge (value_type *begin, value_type *end)
 extract the (length = end - begin) smallest elements and write them to [begin..end) empty segments are deallocated. Requires: there are at least length elements and segments are ended by sentinels. More...
 
 sentinel (c.min_value())
 
size_type size () const
 Return the number of items in the arrays. More...
 
void swap (int_merger &obj)
 
Interface for loser_tree
bool is_array_empty (unsigned_type slot) const
 is this array invalid? here: empty and prefixed with sentinel? More...
 
bool is_array_allocated (unsigned_type slot) const
 is this array's backing memory still allocated or does the current point to sentinel? More...
 
sequence_typeget_array (unsigned_type slot)
 Return the item sequence of the given slot. More...
 
void swap_arrays (unsigned_type a, unsigned_type b)
 Swap contents of arrays a and b. More...
 
void make_array_sentinel (unsigned_type slot)
 Set a usually empty array to the sentinel. More...
 
void free_array (unsigned_type slot)
 free an empty segment . More...
 
void prefetch_arrays ()
 Hint (prefetch) first non-internal (actually second) block of each sequence. No-operation for internal arrays. More...
 

Public Attributes

 __pad0__: tree(c
 
this
 

Protected Attributes

value_typecurrent [MaxArity]
 pointer to current element More...
 
value_typecurrent_end [MaxArity]
 pointer to end of block for current element More...
 
size_type m_size
 total number of elements stored More...
 
unsigned_type mem_cons_
 
value_typesegment [MaxArity]
 start of Segments More...
 
unsigned_type segment_size [MaxArity]
 just to count the internal memory consumption, in bytes More...
 
value_type sentinel
 target of free segment pointers More...
 
tree_type tree
 loser tree instance More...
 

Additional Inherited Members

- Private Member Functions inherited from stxxl::noncopyable
 noncopyable ()
 

Member Typedef Documentation

template<class ValueType, class CompareType, unsigned MaxArity>
typedef CompareType stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::compare_type

comparator object type

Definition at line 38 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
typedef int_merger<ValueType, CompareType, MaxArity> stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::self_type

our type

Definition at line 43 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
typedef value_type* stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::sequence_type

type of sequences in which the values are stored: memory arrays

Definition at line 54 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
typedef internal_size_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::size_type

size type of total number of item in merger

Definition at line 57 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
typedef loser_tree<self_type, CompareType, MaxArity> stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::tree_type

type of embedded loser tree

Definition at line 50 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
typedef ValueType stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::value_type

type of values in merger

Definition at line 36 of file pq_int_merger.h.

Member Enumeration Documentation

template<class ValueType, class CompareType, unsigned MaxArity>
anonymous enum
Enumerator
max_arity 

Definition at line 40 of file pq_int_merger.h.

Constructor & Destructor Documentation

template<class ValueType, class CompareType, unsigned MaxArity>
stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::~int_merger ( )
inline

Definition at line 165 of file pq_int_merger.h.

Member Function Documentation

template<class ValueType, class CompareType, unsigned MaxArity>
void stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::append_array ( value_type target,
unsigned_type  length 
)
inline

append array to merger, takes ownership of the array. requires: is_space_available() == 1

Definition at line 207 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
void stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::free_array ( unsigned_type  slot)
inline

free an empty segment .

Definition at line 124 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
sequence_type& stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::get_array ( unsigned_type  slot)
inline

Return the item sequence of the given slot.

Definition at line 101 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
bool stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::is_array_allocated ( unsigned_type  slot) const
inline

is this array's backing memory still allocated or does the current point to sentinel?

Definition at line 95 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
bool stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::is_array_empty ( unsigned_type  slot) const
inline

is this array invalid? here: empty and prefixed with sentinel?

Definition at line 88 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
bool stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::is_sentinel ( const value_type a) const
inline

True if a is the sentinel value.

Definition at line 200 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
bool stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::is_space_available ( ) const
inline

Whether there is still space for new array.

Definition at line 194 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::m_size ( )
inline

Definition at line 154 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
void stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::make_array_sentinel ( unsigned_type  slot)
inline

Set a usually empty array to the sentinel.

Definition at line 116 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
unsigned_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::mem_cons ( ) const
inline

Definition at line 191 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::mem_cons_ ( )
template<class ValueType, class CompareType, unsigned MaxArity>
void stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::multi_merge ( value_type begin,
value_type end 
)
inline

extract the (length = end - begin) smallest elements and write them to [begin..end) empty segments are deallocated. Requires: there are at least length elements and segments are ended by sentinels.

Definition at line 249 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
void stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::prefetch_arrays ( )
inline

Hint (prefetch) first non-internal (actually second) block of each sequence. No-operation for internal arrays.

Definition at line 144 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::sentinel ( c.  min_value())
template<class ValueType, class CompareType, unsigned MaxArity>
size_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::size ( ) const
inline

Return the number of items in the arrays.

Definition at line 241 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
void stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::swap ( int_merger< ValueType, CompareType, MaxArity > &  obj)
inline

Definition at line 181 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
void stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::swap_arrays ( unsigned_type  a,
unsigned_type  b 
)
inline

Swap contents of arrays a and b.

Definition at line 107 of file pq_int_merger.h.

Member Data Documentation

template<class ValueType, class CompareType, unsigned MaxArity>
stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::__pad0__

Definition at line 151 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
value_type* stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::current[MaxArity]
protected

pointer to current element

Definition at line 70 of file pq_int_merger.h.

Referenced by stxxl::priority_queue_local::int_merger< value_type, comparator_type, IntKMAX >::swap().

template<class ValueType, class CompareType, unsigned MaxArity>
value_type* stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::current_end[MaxArity]
protected

pointer to end of block for current element

Definition at line 72 of file pq_int_merger.h.

Referenced by stxxl::priority_queue_local::int_merger< value_type, comparator_type, IntKMAX >::swap().

template<class ValueType, class CompareType, unsigned MaxArity>
size_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::m_size
protected

total number of elements stored

Definition at line 81 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
unsigned_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::mem_cons_
protected
template<class ValueType, class CompareType, unsigned MaxArity>
value_type* stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::segment[MaxArity]
protected
template<class ValueType, class CompareType, unsigned MaxArity>
unsigned_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::segment_size[MaxArity]
protected

just to count the internal memory consumption, in bytes

Definition at line 76 of file pq_int_merger.h.

Referenced by stxxl::priority_queue_local::int_merger< value_type, comparator_type, IntKMAX >::swap().

template<class ValueType, class CompareType, unsigned MaxArity>
value_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::sentinel
protected

target of free segment pointers

Definition at line 64 of file pq_int_merger.h.

Referenced by stxxl::priority_queue_local::int_merger< value_type, comparator_type, IntKMAX >::swap().

template<class ValueType, class CompareType, unsigned MaxArity>
* stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::this

Definition at line 151 of file pq_int_merger.h.

template<class ValueType, class CompareType, unsigned MaxArity>
tree_type stxxl::priority_queue_local::int_merger< ValueType, CompareType, MaxArity >::tree
protected

loser tree instance

Definition at line 61 of file pq_int_merger.h.


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