#include <cstdint>
#include <vector>
Go to the source code of this file.
|
template<typename T > |
void | BitonicMerge (sort_direction aDir, typename std::vector< T >::iterator &aDataStart, typename std::vector< T >::iterator &aDataEnd) |
|
template<typename T > |
void | BitonicSort (sort_direction aDir, typename std::vector< T >::iterator &aDataStart, typename std::vector< T >::iterator &aDataEnd) |
|
◆ sort_direction
◆ BitonicMerge()
template<typename T >
void BitonicMerge |
( |
sort_direction |
aDir, |
|
|
typename std::vector< T >::iterator & |
aDataStart, |
|
|
typename std::vector< T >::iterator & |
aDataEnd |
|
) |
| |
Definition at line 41 of file BitonicSort.h.
References edm::swap(), and up.
44 uint32_t lSize(aDataEnd - aDataStart);
47 while (lPower2 < lSize)
50 typename std::vector<T>::iterator lMidpoint(aDataStart + (lPower2 >> 1));
51 typename std::vector<T>::iterator lFirst(aDataStart);
52 typename std::vector<T>::iterator lSecond(lMidpoint);
54 for (; lSecond != aDataEnd; ++lFirst, ++lSecond) {
55 if (((*lFirst) > (*lSecond)) == (aDir ==
up)) {
60 BitonicMerge<T>(aDir, aDataStart, lMidpoint);
61 BitonicMerge<T>(aDir, lMidpoint, aDataEnd);
void swap(Association< C > &lhs, Association< C > &rhs)
◆ BitonicSort()
template<typename T >
void BitonicSort |
( |
sort_direction |
aDir, |
|
|
typename std::vector< T >::iterator & |
aDataStart, |
|
|
typename std::vector< T >::iterator & |
aDataEnd |
|
) |
| |
Definition at line 22 of file BitonicSort.h.
References down, and up.
25 uint32_t lSize(aDataEnd - aDataStart);
27 typename std::vector<T>::iterator lMidpoint(aDataStart + (lSize >> 1));
29 BitonicSort<T>(
up, aDataStart, lMidpoint);
30 BitonicSort<T>(
down, lMidpoint, aDataEnd);
32 BitonicSort<T>(
down, aDataStart, lMidpoint);
33 BitonicSort<T>(
up, lMidpoint, aDataEnd);
35 BitonicMerge<T>(aDir, aDataStart, aDataEnd);