Yet Another eXchange Tool  0.9.0
Functions
mergesort.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "xt/quicksort.h"
#include "xt/mergesort.h"
Include dependency graph for mergesort.c:

Go to the source code of this file.

Functions

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)
 

Detailed Description

Author
Jörg Behrens behre.nosp@m.ns@d.nosp@m.krz.d.nosp@m.e Moritz Hanke hanke.nosp@m.@dkr.nosp@m.z.de Thomas Jahns jahns.nosp@m.@dkr.nosp@m.z.de

Definition in file mergesort.c.

Function Documentation

◆ insertionsort_idxpos()

static void insertionsort_idxpos ( idxpos_type w,
size_t  n 
)
static

Definition at line 60 of file mergesort.c.

Here is the caller graph for this function:

◆ insertionsort_index()

static void insertionsort_index ( Xt_int val,
int  n,
int *  pos,
int  reset_pos 
)
static

Definition at line 74 of file mergesort.c.

Here is the caller graph for this function:

◆ 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

Definition at line 118 of file mergesort.c.

Here is the caller graph for this function:

◆ my_mergesort_idxpos()

static void my_mergesort_idxpos ( idxpos_type *restrict  v,
idxpos_type *restrict  w,
size_t  lb,
size_t  ub 
)
static

Definition at line 147 of file mergesort.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xt_mergesort_idxpos()

void xt_mergesort_idxpos ( idxpos_type *restrict  v,
size_t  n 
)

Definition at line 186 of file mergesort.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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]adata to be sorted
[in]nlength of data
[in,out]idxold index of sorted returned a
[in]reset_indexoverride given idx by identity idx
Examples
test_sort.c.

Definition at line 195 of file mergesort.c.

Here is the call graph for this function:
Here is the caller graph for this function: