44#ifndef __ADS_SortingNetworks
45 #define __ADS_SortingNetworks
71using Comparator = std::pair< std::size_t , std::size_t >;
133 class T = std::ranges::range_value_t< std::remove_cvref_t< Store > > ,
134 class C = std::less<> >
139template<
class T ,
class C = std::less<> >
140void applyNetwork( std::vector< T > & A ,
const std::vector< Comparator > & N ,
152 requires requires( std::vector< std::ranges::range_value_t< R > > & v ,
159 const auto f = [ & ](
auto & v ) ->
decltype(
auto ) {
160 return(
applyNetwork( v , std::forward< P >( p )... ) );
162 return( detail::sortRange( A , f , f ) );
173#include "ADS/sort/impl/SortingNetworks.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the aud...
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
std::vector< Comparator > bitonicNetwork(std::size_t n)
the bitonic sorter for items
std::pair< std::size_t, std::size_t > Comparator
a comparator of a network: the smaller of and goes to
Definition SortingNetworks.h:71
std::vector< Comparator > mergeExchangeNetwork(std::size_t n)
the merge exchange of Batcher for items
void applyNetwork(Store &&A, const std::vector< Comparator > &N, C less=C())
the comparators of applied to in their order