89#ifndef __ADS_RadixSort
90 #define __ADS_RadixSort
113#include <type_traits>
127 ( std::is_integral_v< T > || std::is_floating_point_v< T > ) &&
128 (
sizeof( T ) <= 8 );
134template< RadixKey T >
167 std::remove_cvref_t< Store > > >
171template< RadixKey T >
181 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
186template<
class T ,
class K >
241 std::remove_cvref_t< Store > > >
245template< RadixKey T >
276template< StringStore Store >
291 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
293{
radixSort( v , std::forward< P >( p )... ); }
296 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
297 return(
radixSort( v , std::forward< P >( p )... ) );
299 return( detail::sortRange( A , f ) );
306template< SortRange R ,
class... P >
307 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
314 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
315 return(
radixSortBy( v , std::forward< P >( p )... ) );
317 return( detail::sortRange( A , f ) );
324template< SortRange R ,
class... P >
325 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
332 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
335 return( detail::sortRange( A , f ) );
342template< SortRange R ,
class... P >
343 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
350 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
351 return(
msdRadixSort( v , std::forward< P >( p )... ) );
353 return( detail::sortRange( A , f ) );
364#include "ADS/sort/impl/RadixSort.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 ...
Insertion Sort (section 2.7.2), as one sorts a hand of cards: is inserted in the sorted prefix ,...
The room of the parallel algorithms, beyond the book: the buffers of items that the parallel sorts a...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
The quicksort in the lanes of the vector registers, beyond the book: vectorQuickSort() sorts integers...
an integer or a floating point number of at most 8 bytes
Definition RadixSort.h:126
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 msdRadixSort(Store &&A)
the MSD radix sort of strings
constexpr std::size_t kFlagSmall
the groups that americanFlagSort() leaves to a sort by comparisons are those of fewer items than this...
Definition RadixSort.h:192
void radixSortBy(Store &&A, K key)
the LSD radix sort of any items by the unsigned key( x ), stable
void americanFlagSort(Store &&A)
the MSD radix sort of numbers in place
void radixSort(Store &&A)
the LSD radix sort of numbers
auto radixKey(T x)
the unsigned key of , whose order is the order of the numbers: the bits of with the sign bit flipped...
constexpr bool kVectorSort
true if vectorQuickSort() runs in the vectors of the processor, by the quicksort of Highway,...
Definition VectorQuickSort.h:173