TPIE

2362a60
sort_deprecated.h File Reference

Contains deprecated sorting algorithms. More...

Go to the source code of this file.

Namespaces

 tpie
 pipelining/factory_base.h Base class of pipelining factories
 
 tpie::ami
 A version of sort that takes an input stream of elements of type T, and an output stream, and and uses the < operator to sort, see also Sorting in TPIE.
 

Functions

err tpie::ami::exception_kind (const exception &e)
 
template<class T >
err tpie::ami::sort (stream< T > *instream_ami, stream< T > *outstream_ami, tpie::progress_indicator_base *indicator=NULL)
 
template<class T , class CMPR >
err tpie::ami::sort (stream< T > *instream_ami, stream< T > *outstream_ami, CMPR *cmp, progress_indicator_base *indicator=NULL)
 
template<class T >
err tpie::ami::ptr_sort (stream< T > *instream_ami, stream< T > *outstream_ami, progress_indicator_base *indicator=NULL)
 
template<class T , class CMPR >
err tpie::ami::ptr_sort (stream< T > *instream_ami, stream< T > *outstream_ami, CMPR *cmp, progress_indicator_base *indicator=NULL)
 
template<class T , class KEY , class CMPR >
err tpie::ami::key_sort (stream< T > *instream_ami, stream< T > *outstream_ami, KEY, CMPR *cmp, progress_indicator_base *indicator=NULL)
 
template<class T >
err tpie::ami::sort (stream< T > *instream_ami, progress_indicator_base *indicator=0)
 
template<class T , class CMPR >
err tpie::ami::sort (stream< T > *instream_ami, CMPR *cmp, progress_indicator_base *indicator=NULL)
 
template<class T >
err tpie::ami::ptr_sort (stream< T > *instream_ami, progress_indicator_base *indicator=NULL)
 
template<class T , class CMPR >
err tpie::ami::ptr_sort (stream< T > *instream_ami, CMPR *cmp, progress_indicator_base *indicator=NULL)
 
template<class T , class KEY , class CMPR >
err tpie::ami::key_sort (stream< T > *instream_ami, KEY, CMPR *cmp, progress_indicator_base *indicator=NULL)
 

Detailed Description

Contains deprecated sorting algorithms.

Sorting in TPIE:
TPIE offers three merge sorting variants. The user must decide which variant is most appropriate for their circumstances. All accomplish the same goal, but the performance can vary depending on the situation. They differ mainly in the way they perform the merge phase of merge sort, specifically how they maintain their heap data structure used in the merge phase. The three variants are the following: sort(), ptr_sort(), key_sort().
sort()
keeps the (entire) first record of each sorted run (each is a stream) in a heap. This approach is most suitable when the record consists entirely of the record key.
ptr_sort()
keeps a pointer to the first record of each stream in the heap. This approach works best when records are very long and the key field(s) take up a large percentage of the record.
key_sort()
keeps the key field(s) and a pointer to the first record of each stream in the heap. This approach works best when the key field(s) are small in comparison to the record size.

Any of these variants will accomplish the task of sorting an input stream in an I/O efficient way, but there can be noticeable differences in processing time between the variants. As an example, key_sort() appears to be more cache-efficient than the others in many cases, and therefore often uses less processor time, despite extra data movement relative to ptr_sort().

In addition to the three variants discussed above, there are multiple choices within each variant regarding how the actual comparison operations are to be performed. These choices are described in some detail for sort().

Definition in file sort_deprecated.h.