146#include <type_traits>
158inline constexpr std::size_t
kRadix = 512;
164inline constexpr std::size_t
kRuns = 16;
209 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
210 class C = std::less<> >
211void sort( Store && A , C less = C() );
214template<
class T ,
class C = std::less<> >
215void sort( std::vector< T > & A , C less = C() );
245 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
246 class C = std::less<> >
250template<
class T ,
class C = std::less<> >
262 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
264{
sort( v , std::forward< P >( p )... ); }
265decltype( auto )
sort( R && A , P &&... p )
267 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
268 return(
sort( v , std::forward< P >( p )... ) );
270 return( detail::sortRange( A , f ) );
277template< SortRange R ,
class... P >
278 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
280{
stableSort( v , std::forward< P >( p )... ); }
283 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
284 return(
stableSort( v , std::forward< P >( p )... ) );
286 return( detail::sortRange( A , f ) );
297#include "ADS/sort/impl/Sort.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The quicksorts beyond the quicksort of Montresor's book [see QuickSort.h for it and its improvements ...
The prefetch of a line of the cache, beyond the book: ADS::prefetch( p ) asks the processor to bring ...
The sorts by the digits of the keys, beyond the book (which has Counting Sort and Pigeonhole Sort,...
The natural merge sort that adapts to the runs of the input, beyond the book [see naturalMergeSort() ...
The in-place super scalar samplesort, beyond the book: sampleSort() splits the vector into up to 256 ...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
The sort of strings by integer keys of their prefixes, beyond the book: prefixKeySort() reads each st...
The quicksort in the lanes of the vector registers, beyond the book: vectorQuickSort() sorts integers...
a range that the sorts take beside std::vector and std::span: random access, sized,...
Definition Sorted.h:153
the storage on which the sorts work in place, by reference: a std::vector or a std::span of its items...
Definition Sorted.h:178
void sort(E &ex, Store &&A, C less=C())
the vector sorted by less on the threads of ex, not necessarily stable
void stableSort(E &ex, Store &&A, C less=C())
the vector sorted by less on the threads of ex, the equal items in their order
constexpr std::size_t kRadix
the items from which the numbers go to radixSort()
Definition Sort.h:158
constexpr std::size_t kStrings
the items from which the strings go to the sorts by characters
Definition Sort.h:161
constexpr std::size_t kRuns
the runs up to which the numbers and the strings go to powerSort()
Definition Sort.h:164