(a, low, cnt, dire)
| 15 | # The sequence to be sorted starts at index position low, |
| 16 | # the parameter cnt is the number of elements to be sorted. |
| 17 | def bitonicMerge(a, low, cnt, dire): |
| 18 | if cnt > 1: |
| 19 | k = int(cnt / 2) |
| 20 | for i in range(low, low + k): |
| 21 | compAndSwap(a, i, i + k, dire) |
| 22 | bitonicMerge(a, low, k, dire) |
| 23 | bitonicMerge(a, low + k, k, dire) |
| 24 | |
| 25 | # This funcion first produces a bitonic sequence by recursively |
| 26 | |
| 27 | |
| 28 | # sorting its two halves in opposite sorting orders, and then |
no test coverage detected