Sort functions for differents data types.
More...
|
| cpl_error_code | sort_array_f (void *a, cpl_size nE, cpl_size sE, f_compare f) |
| | sort_array_f Core sort algorith that it's called with the other sort function. If you need to changed the the method of sort this is the function that you need modified.
|
| |
| cpl_error_code | sort_array (void *a, cpl_size nE, cpl_size sE, hdrl_sort_type type, cpl_sort_direction dir) |
| | sort_array hdrl function for order arrays with know types. Using the type parameter for select the comparation function
|
| |
| cpl_error_code | sort_array_index (double *a, cpl_size nE, void *b, hdrl_sort_type type, cpl_sort_direction dir) |
| | sort_array_index hdrl function for sort two arrays The alghorithm sort 'a' and in the same way sort the other generic array by the index of 'a'.
|
| |
| cpl_error_code | sort_arrays_index (double *a, cpl_size nE, void **bs, cpl_size nA, hdrl_sort_type *types, cpl_sort_direction dir) |
| | sort_arrays_index hdrl function for sort several arrays The alghorithm sort 'a' and in the same way sort the others generic arrays by the index of 'a'.
|
| |
Sort functions for differents data types.
◆ sort_array()
| cpl_error_code sort_array |
( |
void * |
a, |
|
|
cpl_size |
nE, |
|
|
cpl_size |
sE, |
|
|
hdrl_sort_type |
type, |
|
|
cpl_sort_direction |
dir |
|
) |
| |
sort_array hdrl function for order arrays with know types. Using the type parameter for select the comparation function
- Parameters
-
| a | generic pointer array with one unknown datatype |
| nE | Number of elements in the array |
| sE | Size of element in the array |
| type | Datatype of elements in the 'a' generic array. Standard type in hdrl_sort_type |
| dir | Direction of sort array (Ascending or Descending) |
- Returns
- cpl_error_code. Return the error code provided by the sort function.
◆ sort_array_f()
| cpl_error_code sort_array_f |
( |
void * |
a, |
|
|
cpl_size |
nE, |
|
|
cpl_size |
sE, |
|
|
f_compare |
f |
|
) |
| |
sort_array_f Core sort algorith that it's called with the other sort function. If you need to changed the the method of sort this is the function that you need modified.
- Parameters
-
| a | generic pointer array with one unknown datatype |
| nE | Number of elements in the array |
| sE | Size of element in the array |
| f | Function for evaluate the comparison between elements |
- Returns
- cpl_error_code. Whit qsort() always return CPL_ERROR_NONE because qsort only return a void. If it change maybe it is possible to check it.
◆ sort_array_index()
| cpl_error_code sort_array_index |
( |
double * |
a, |
|
|
cpl_size |
nE, |
|
|
void * |
b, |
|
|
hdrl_sort_type |
type, |
|
|
cpl_sort_direction |
dir |
|
) |
| |
sort_array_index hdrl function for sort two arrays The alghorithm sort 'a' and in the same way sort the other generic array by the index of 'a'.
- Parameters
-
| a | generic pointer array with doubles |
| nE | Number of elements in the array of doubles |
| b | generic array that you need to order by index of the first array |
| type | Datatype of elements in the 'b' generic array. Standard type in hdrl_sort_type |
| dir | Direction of sort the array (Ascending or Descending) |
- Returns
- cpl_error_code. Return the error code provided by the sort functions.
◆ sort_arrays_index()
| cpl_error_code sort_arrays_index |
( |
double * |
a, |
|
|
cpl_size |
nE, |
|
|
void ** |
bs, |
|
|
cpl_size |
nA, |
|
|
hdrl_sort_type * |
types, |
|
|
cpl_sort_direction |
dir |
|
) |
| |
sort_arrays_index hdrl function for sort several arrays The alghorithm sort 'a' and in the same way sort the others generic arrays by the index of 'a'.
- Parameters
-
| a | generic pointer array with doubles |
| nE | Number of elements in the array of doubles |
| bs | generic arrays that you need to order by index of the first array |
| nA | Number of generic arrays |
| types | Datatypes of elements in the 'bs' generic arrays. Standard type in hdrl_sort_type |
| dir | Direction of sort the arrays (Ascending or Descending) |
- Returns
- cpl_error_code. Return the error code provided by the sort functions.