Template Function ADS::permuteBySorting

Function Documentation

template<class T>
void ADS::permuteBySorting(const DiskFile<T> &in, const DiskFile<std::size_t> &pi, DiskFile<T> &out)

out[ i ] = in[ pi[ i ] ], by two sorts and three scans

Pre:

pi a permutation of 0 , … , n - 1 (an audit), M >= 3 B, out empty, the three files on the same memory