1#ifndef __DUNE_ACFEM_MPL_SEQUENCESORT_HH__
2#define __DUNE_ACFEM_MPL_SEQUENCESORT_HH__
4#include "generators.hh"
5#include "typetuplesort.hh"
11 template<std::
size_t I0, std::
size_t I1>
14 static constexpr std::size_t i0 = I0;
15 static constexpr std::size_t i1 = I1;
19 struct UnpackSortData;
21 template<std::size_t... I, std::size_t... P>
22 struct UnpackSortData<TypeTuple<IndexPair<I, P>...> >
30 template<
class Seq,
template<std::
size_t, std::
size_t>
class DoSwap,
class Permutation = MakeSequenceFor<Seq> >
33 template<std::size_t... I, std::size_t... P,
template<std::
size_t, std::
size_t>
class DoSwap>
36 template<
class A,
class B>
37 using Swap = DoSwap<A::i0, B::i0>;
39 using SortData = TypeTuple<IndexPair<I, P>...>;
40 using SortInfo = MergeSort<SortData, Swap>;
41 using Result =
typename UnpackSortData<SortInfo>::Result;
42 using Permutation =
typename UnpackSortData<SortInfo>::Permutation;
45 template<
class Seq,
template<std::
size_t, std::
size_t>
class DoSwap>
48 template<std::size_t... I,
template<std::
size_t, std::
size_t>
class DoSwap>
51 template<
class A,
class B>
52 using Swap = DoSwap<A::value, B::value>;
54 static constexpr bool value = IsSortedV<TypeTuple<IndexConstant<I>...>, Swap>;
Sequence< std::size_t, V... > IndexSequence
Sequence of std::size_t values.
Definition: types.hh:64
Form a sub-sequence with the values at the positions NOT given in Indices.
Definition: conditional.hh:8