tlx
Loading...
Searching...
No Matches
bose_nelson_parameter.hpp File Reference
#include <tlx/sort/networks/cswap.hpp>
#include <functional>

Go to the source code of this file.

Namespaces

namespace  tlx
 
namespace  tlx::sort_networks
 Implementations of sorting networks for up to sixteen elements.
 
namespace  tlx::sort_networks::bose_nelson_parameter
 Implementation of Bose-Nelson sorting networks for up to sixteen elements processing parameters instead of an array.
 

Typedefs

template<typename ValueType >
using DefaultCSwap = CS_IfSwap< std::less< ValueType > >
 default conditional swap implementation
 

Functions

template<typename ValueType , typename CSwap >
static void merge_1_1 (ValueType &a0, ValueType &b0, CSwap cswap)
 merge network for element arrays length one and one
 
template<typename ValueType , typename CSwap >
static void merge_1_2 (ValueType &a0, ValueType &b0, ValueType &b1, CSwap cswap)
 merge network for element arrays length one and two
 
template<typename ValueType , typename CSwap >
static void merge_2_1 (ValueType &a0, ValueType &a1, ValueType &b0, CSwap cswap)
 merge network for element arrays length two and one
 
template<typename ValueType , typename CSwap >
static void merge_2_2 (ValueType &a0, ValueType &a1, ValueType &b0, ValueType &b1, CSwap cswap)
 merge network for element arrays length two and two
 
template<typename ValueType , typename CSwap >
static void merge_2_3 (ValueType &a0, ValueType &a1, ValueType &b0, ValueType &b1, ValueType &b2, CSwap cswap)
 merge network for element arrays length two and three
 
template<typename ValueType , typename CSwap >
static void merge_3_2 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &b0, ValueType &b1, CSwap cswap)
 merge network for element arrays length three and two
 
template<typename ValueType , typename CSwap >
static void merge_3_3 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &b0, ValueType &b1, ValueType &b2, CSwap cswap)
 merge network for element arrays length three and three
 
template<typename ValueType , typename CSwap >
static void merge_3_4 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, CSwap cswap)
 merge network for element arrays length three and four
 
template<typename ValueType , typename CSwap >
static void merge_4_3 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &b0, ValueType &b1, ValueType &b2, CSwap cswap)
 merge network for element arrays length four and three
 
template<typename ValueType , typename CSwap >
static void merge_4_4 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, CSwap cswap)
 merge network for element arrays length four and four
 
template<typename ValueType , typename CSwap >
static void merge_4_5 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, CSwap cswap)
 merge network for element arrays length four and five
 
template<typename ValueType , typename CSwap >
static void merge_5_5 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &a4, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, CSwap cswap)
 merge network for element arrays length five and five
 
template<typename ValueType , typename CSwap >
static void merge_5_6 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &a4, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, ValueType &b5, CSwap cswap)
 merge network for element arrays length five and six
 
template<typename ValueType , typename CSwap >
static void merge_6_6 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &a4, ValueType &a5, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, ValueType &b5, CSwap cswap)
 merge network for element arrays length six and six
 
template<typename ValueType , typename CSwap >
static void merge_6_7 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &a4, ValueType &a5, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, ValueType &b5, ValueType &b6, CSwap cswap)
 merge network for element arrays length six and seven
 
template<typename ValueType , typename CSwap >
static void merge_7_7 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &a4, ValueType &a5, ValueType &a6, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, ValueType &b5, ValueType &b6, CSwap cswap)
 merge network for element arrays length seven and seven
 
template<typename ValueType , typename CSwap >
static void merge_7_8 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &a4, ValueType &a5, ValueType &a6, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, ValueType &b5, ValueType &b6, ValueType &b7, CSwap cswap)
 merge network for element arrays length seven and eight
 
template<typename ValueType , typename CSwap >
static void merge_8_8 (ValueType &a0, ValueType &a1, ValueType &a2, ValueType &a3, ValueType &a4, ValueType &a5, ValueType &a6, ValueType &a7, ValueType &b0, ValueType &b1, ValueType &b2, ValueType &b3, ValueType &b4, ValueType &b5, ValueType &b6, ValueType &b7, CSwap cswap)
 merge network for element arrays length eight and eight
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort2 (ValueType &x0, ValueType &x1, CSwap cswap=CSwap())
 Bose-Nelson sorting network for two elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort3 (ValueType &x0, ValueType &x1, ValueType &x2, CSwap cswap=CSwap())
 Bose-Nelson sorting network for three elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort4 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, CSwap cswap=CSwap())
 Bose-Nelson sorting network for four elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort5 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, CSwap cswap=CSwap())
 Bose-Nelson sorting network for five elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort6 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, CSwap cswap=CSwap())
 Bose-Nelson sorting network for six elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort7 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, CSwap cswap=CSwap())
 Bose-Nelson sorting network for seven elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort8 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, CSwap cswap=CSwap())
 Bose-Nelson sorting network for eight elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort9 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, CSwap cswap=CSwap())
 Bose-Nelson sorting network for nine elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort10 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, ValueType &x9, CSwap cswap=CSwap())
 Bose-Nelson sorting network for ten elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort11 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, ValueType &x9, ValueType &x10, CSwap cswap=CSwap())
 Bose-Nelson sorting network for eleven elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort12 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, ValueType &x9, ValueType &x10, ValueType &x11, CSwap cswap=CSwap())
 Bose-Nelson sorting network for twelve elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort13 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, ValueType &x9, ValueType &x10, ValueType &x11, ValueType &x12, CSwap cswap=CSwap())
 Bose-Nelson sorting network for thirteen elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort14 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, ValueType &x9, ValueType &x10, ValueType &x11, ValueType &x12, ValueType &x13, CSwap cswap=CSwap())
 Bose-Nelson sorting network for fourteen elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort15 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, ValueType &x9, ValueType &x10, ValueType &x11, ValueType &x12, ValueType &x13, ValueType &x14, CSwap cswap=CSwap())
 Bose-Nelson sorting network for fifteen elements.
 
template<typename ValueType , typename CSwap = DefaultCSwap<ValueType>>
static void sort16 (ValueType &x0, ValueType &x1, ValueType &x2, ValueType &x3, ValueType &x4, ValueType &x5, ValueType &x6, ValueType &x7, ValueType &x8, ValueType &x9, ValueType &x10, ValueType &x11, ValueType &x12, ValueType &x13, ValueType &x14, ValueType &x15, CSwap cswap=CSwap())
 Bose-Nelson sorting network for sixteen elements.
 
template<typename Iterator , typename Comparator = std::less<typename std::iterator_traits<Iterator>::value_type>>
static void sort (Iterator a, Iterator b, Comparator cmp=Comparator())
 Call Bose-Network sorting network for up to sixteen elements with given comparison method.