14#ifndef TLX_SORT_NETWORKS_BEST_HEADER
15#define TLX_SORT_NETWORKS_BEST_HEADER
35template <
typename Iterator>
37 std::less<typename std::iterator_traits<Iterator>::value_type> >;
40template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
41static void sort2(Iterator a, CSwap cswap = CSwap()) {
46template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
47static void sort3(Iterator a, CSwap cswap = CSwap()) {
54template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
55static void sort4(Iterator a, CSwap cswap = CSwap()) {
64template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
65static void sort5(Iterator a, CSwap cswap = CSwap()) {
78template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
79static void sort6(Iterator a, CSwap cswap = CSwap()) {
95template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
96static void sort7(Iterator a, CSwap cswap = CSwap()) {
116template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
117static void sort8(Iterator a, CSwap cswap = CSwap()) {
140template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
141static void sort9(Iterator a, CSwap cswap = CSwap()) {
170template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
171static void sort10(Iterator a, CSwap cswap = CSwap()) {
204template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
205static void sort11(Iterator a, CSwap cswap = CSwap()) {
244template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
245static void sort12(Iterator a, CSwap cswap = CSwap()) {
288template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
289static void sort13(Iterator a, CSwap cswap = CSwap()) {
338template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
339static void sort14(Iterator a, CSwap cswap = CSwap()) {
394template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
395static void sort15(Iterator a, CSwap cswap = CSwap()) {
455template <
typename Iterator,
typename CSwap = DefaultCSwap<Iterator> >
456static void sort16(Iterator a, CSwap cswap = CSwap()) {
521template <
typename Iterator,
typename Comparator =
522 std::less<typename std::iterator_traits<Iterator>::value_type> >
523static void sort(Iterator begin, Iterator end, Comparator cmp = Comparator()) {
526 switch (end - begin) {
Conditional swap implementation used for sorting networks: trivial portable C++ implementation with c...
Implementation of best known sorting networks for up to sixteen elements.
static void sort5(Iterator a, CSwap cswap=CSwap())
sorting network for five elements
CS_IfSwap< std::less< typename std::iterator_traits< Iterator >::value_type > > DefaultCSwap
default conditional swap implementation
static void sort4(Iterator a, CSwap cswap=CSwap())
sorting network for four elements
static void sort7(Iterator a, CSwap cswap=CSwap())
sorting network for seven elements
static void sort2(Iterator a, CSwap cswap=CSwap())
sorting network for two elements
static void sort13(Iterator a, CSwap cswap=CSwap())
sorting network for thirteen elements
static void sort8(Iterator a, CSwap cswap=CSwap())
sorting network for eight elements
static void sort15(Iterator a, CSwap cswap=CSwap())
sorting network for fifteen elements
static void sort9(Iterator a, CSwap cswap=CSwap())
sorting network for nine elements
static void sort16(Iterator a, CSwap cswap=CSwap())
sorting network for sixteen elements
static void sort12(Iterator a, CSwap cswap=CSwap())
sorting network for twelve elements
static void sort10(Iterator a, CSwap cswap=CSwap())
sorting network for ten elements
static void sort3(Iterator a, CSwap cswap=CSwap())
sorting network for three elements
static void sort14(Iterator a, CSwap cswap=CSwap())
sorting network for fourteen elements
static void sort6(Iterator a, CSwap cswap=CSwap())
sorting network for six elements
static void sort(Iterator begin, Iterator end, Comparator cmp=Comparator())
Call best known sorting network for up to sixteen elements with given comparison method.
static void sort11(Iterator a, CSwap cswap=CSwap())
sorting network for eleven elements
Implementations of sorting networks for up to sixteen elements.