117#ifndef __ADS_ExternalSorting
118 #define __ADS_ExternalSorting
157[[nodiscard]]
inline std::uint64_t
158mergeSortIOs( std::size_t n , std::size_t M , std::size_t B , std::size_t k );
169[[nodiscard]]
inline std::uint64_t
177[[nodiscard]]
inline std::uint64_t
202template<
class T ,
class C = std::less<> >
239template<
class T ,
class C = std::less<> ,
class Sel = LoserTree< T , C > >
241 C less = C() ,
bool snowPlow =
false );
273template<
class T ,
class R ,
class C = std::less<> >
333#include "ADS/external/impl/ExternalSorting.tpp"
The binary search of section 1.2 in a sorted vector : is compared with the middle item of the part ...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
A -ary heap of plain items, beyond the book: the heap of section 10.1 with children per node in a ve...
The sort of a file larger than the memory, beyond the book, as Knuth describes it for tapes,...
The tree of losers of a tournament among players, the structure of the merge of sorted sequences (K...
Random numbers as Knuth treats them (chapter 3 of The Art of Computer Programming),...
The sort that chooses its algorithm, beyond the book: sort() and stableSort() look at what they sort ...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
The two-level memory model of Aggarwal and Vitter, simulated so that the algorithms of the external m...
a file of items on the disk of the model, in blocks of items
Definition TwoLevelMemory.h:199
std::uint64_t permutingLowerBound(std::size_t n, std::size_t M, std::size_t B)
the least I/Os of a permutation of items, the larger of and the smallest with
void distributionSort(const DiskFile< T > &in, DiskFile< T > &out, R &g, C less=C())
the items of in, sorted, into out, by the distribution with pivots from a random sample drawn by g
std::uint64_t sortingLowerBound(std::size_t n, std::size_t M, std::size_t B)
the least I/Os of a sort of items by comparisons, writes plus the reads that the tree of the I/Os n...
void multiwayMergeSort(const DiskFile< T > &in, DiskFile< T > &out, C less=C(), bool snowPlow=false)
the items of in, sorted, into out, by the mergesort of fan-in ; the runs by replacement selection if ...
std::uint64_t mergeSortIOs(std::size_t n, std::size_t M, std::size_t B, std::size_t k)
the I/Os of a mergesort of fan-in at most , with : a pass that forms the runs and one per level of ...
void permuteBySorting(const DiskFile< T > &in, const DiskFile< std::size_t > &pi, DiskFile< T > &out)
, by two sorts and three scans
void binaryMergeSort(const DiskFile< T > &in, DiskFile< T > &out, C less=C())
the items of in, sorted, into out, by the binary mergesort
void permuteDirect(const DiskFile< T > &in, const DiskFile< std::size_t > &pi, DiskFile< T > &out)
, one read per item at most