#include <stdlib.h>
#include <stdio.h>
#include "xt/quicksort.h"
#include "xt/mergesort.h"
Go to the source code of this file.
|
static void | insertionsort_idxpos (idxpos_type *w, size_t n) |
|
static void | insertionsort_index (Xt_int *val, int n, int *pos, int reset_pos) |
|
static void | my_merge_idxpos (idxpos_type *restrict v, idxpos_type *restrict w, size_t lb1, size_t ub1, size_t lb2, size_t ub2) |
|
static void | my_mergesort_idxpos (idxpos_type *restrict v, idxpos_type *restrict w, size_t lb, size_t ub) |
|
void | xt_mergesort_idxpos (idxpos_type *restrict v, size_t n) |
|
void | xt_mergesort_index (Xt_int *val, int n, int *pos, int reset_pos) |
|
◆ insertionsort_idxpos()
static void insertionsort_idxpos |
( |
idxpos_type * |
w, |
|
|
size_t |
n |
|
) |
| |
|
static |
◆ insertionsort_index()
static void insertionsort_index |
( |
Xt_int * |
val, |
|
|
int |
n, |
|
|
int * |
pos, |
|
|
int |
reset_pos |
|
) |
| |
|
static |
◆ my_merge_idxpos()
static void my_merge_idxpos |
( |
idxpos_type *restrict |
v, |
|
|
idxpos_type *restrict |
w, |
|
|
size_t |
lb1, |
|
|
size_t |
ub1, |
|
|
size_t |
lb2, |
|
|
size_t |
ub2 |
|
) |
| |
|
inlinestatic |
◆ my_mergesort_idxpos()
◆ xt_mergesort_idxpos()
void xt_mergesort_idxpos |
( |
idxpos_type *restrict |
v, |
|
|
size_t |
n |
|
) |
| |
◆ xt_mergesort_index()
void xt_mergesort_index |
( |
Xt_int * |
a, |
|
|
int |
n, |
|
|
int * |
idx, |
|
|
int |
reset_index |
|
) |
| |
mergesort changing values and indices
- Parameters
-
[in,out] | a | data to be sorted |
[in] | n | length of data |
[in,out] | idx | old index of sorted returned a |
[in] | reset_index | override given idx by identity idx |
- Examples
- test_sort.c.
Definition at line 195 of file mergesort.c.