|
PartMC
2.4.0
|
Wrapper routines for C qsort. More...

Go to the source code of this file.
Functions | |
| int | pair_compare (const void *a, const void *b) |
| Helper function for integer_sort_c() More... | |
| int | integer_sort_c (int n, int *data, int *perm) |
| Sort the given data array and return the permutation. More... | |
Wrapper routines for C qsort.
Definition in file sort.c.
| int integer_sort_c | ( | int | n, |
| int * | data, | ||
| int * | perm | ||
| ) |
Sort the given data array and return the permutation.
On return the data array is sorted and the perm array contains the permutation, so that new_data[i] = data[perm[i]], where data is the original data and new_data is the sorted data.
| n | The length of data and perm. |
| data | The data array (sorted on return). |
| perm | The permutation on return: new_data[i] = data[perm[i]]. |
| int pair_compare | ( | const void * | a, |
| const void * | b | ||
| ) |
Helper function for integer_sort_c()