65#ifndef __ADS_KnuthSorts
66 #define __ADS_KnuthSorts
113 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
114 class C = std::less<> >
118template<
class T ,
class C = std::less<> >
140 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
141 class C = std::less<> >
143 std::size_t * moves =
nullptr );
146template<
class T ,
class C = std::less<> >
148 std::size_t * moves =
nullptr );
170template<
RankStore Store ,
class T = std::ranges::range_value_t<
171 std::remove_cvref_t< Store > > >
205 std::remove_cvref_t< Store > > >
209template< RadixKey T >
236 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
237 class C = std::less<> >
241template<
class T ,
class C = std::less<> >
273 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
274 class C = std::less<> >
278template<
class T ,
class C = std::less<> >
294 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
301 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
304 return( detail::sortRange( A , f , f ) );
311template< SortRange R ,
class... P >
312 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
319 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
322 return( detail::sortRange( A , f , f ) );
329template< SortRange R ,
class... P >
330 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
337 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
340 return( detail::sortRange( A , f , f ) );
347template< SortRange R ,
class... P >
348 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
355 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
358 return( detail::sortRange( A , f , f ) );
365template< SortRange R ,
class... P >
366 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
373 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
376 return( detail::sortRange( A , f , f ) );
383template< SortRange R ,
class... P >
384 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
391 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
394 return( detail::sortRange( A , f , f ) );
405#include "ADS/sort/impl/KnuthSorts.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The sorts by the digits of the keys, beyond the book (which has Counting Sort and Pigeonhole Sort,...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
an integer or a floating point number of at most 8 bytes
Definition RadixSort.h:126
the storage on which the sorts of the book work in place, which read the items by their ranks only: a...
Definition Sorted.h:184
a range that the sorts take beside std::vector and std::span: random access, sized,...
Definition Sorted.h:153
void listInsertionSort(Store &&A, C less=C(), std::size_t *moves=nullptr)
the list insertion sort; the moves of the items go to *moves, if given
void mergeInsertionSort(Store &&A, C less=C())
the merge insertion sort of Ford and Johnson
void tournamentSort(Store &&A, C less=C())
the tournament sort
void binaryInsertionSort(Store &&A, C less=C())
the binary insertion sort
void radixExchangeSort(Store &&A)
the radix exchange sort
long fordJohnsonBound(std::size_t n)
the worst case of the comparisons of mergeInsertionSort() on items,
void addressCalculationSort(Store &&A, std::size_t M=0)
the address calculation sort of numbers into lists, if is 0; with an infinite range (an infinity,...