High-Level Data Reduction Library 1.6.0
High-Level data reduction routines for ESO pipelines
Loading...
Searching...
No Matches
hdrl_utils_sort

Sort functions for differents data types. More...

Collaboration diagram for hdrl_utils_sort:

Functions

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'.
 

Detailed Description

Sort functions for differents data types.

Function Documentation

◆ 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
ageneric pointer array with one unknown datatype
nENumber of elements in the array
sESize of element in the array
typeDatatype of elements in the 'a' generic array. Standard type in hdrl_sort_type
dirDirection 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
ageneric pointer array with one unknown datatype
nENumber of elements in the array
sESize of element in the array
fFunction 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
ageneric pointer array with doubles
nENumber of elements in the array of doubles
bgeneric array that you need to order by index of the first array
typeDatatype of elements in the 'b' generic array. Standard type in hdrl_sort_type
dirDirection 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
ageneric pointer array with doubles
nENumber of elements in the array of doubles
bsgeneric arrays that you need to order by index of the first array
nANumber of generic arrays
typesDatatypes of elements in the 'bs' generic arrays. Standard type in hdrl_sort_type
dirDirection of sort the arrays (Ascending or Descending)
Returns
cpl_error_code. Return the error code provided by the sort functions.