63 for(i = 1; i < n; i++) {
67 for(j = i; j > 0 && w[j-1].
idx > tw.
idx; j--) {
81 for(i = 0; i < n; i++) {
86 for(i = 1; i < n; i++) {
91 for(j = i; j > 0 && val[j-1] > tv; j--) {
102 for(i = 1; i < n; i++) {
106 for(j = i; j > 0 && val[j-1] > tv; j--) {
124 while(i1<=ub1 &&
i2<=ub2) {
125 if (v[i1].idx <= v[
i2].idx) {
150 size_t n = ub - lb + 1;
162 size_t ub1 = lb1 + m - 1;
165 size_t ub2 = lb2 + m - 1;
168 size_t ub3 = lb3 + m - 1;
206 v = malloc((
size_t)n *
sizeof(v[0]));
207 w = malloc((
size_t)n *
sizeof(w[0]));
209 if (reset_pos || pos == NULL) {
210 for(
int i=0; i<n; i++) {
215 for(
int i=0; i<n; i++) {
223 for(
int i=0; i<n; i++) {
228 for(
int i=0; i<n; i++) {
void xt_mergesort_index(Xt_int *val, int n, int *pos, int reset_pos)
static void insertionsort_idxpos(idxpos_type *w, size_t n)
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)
static void insertionsort_index(Xt_int *val, int n, int *pos, int reset_pos)
integer, parameter, public i2