CR2RE Pipeline Reference Manual 1.6.10
hdrl_cat_utils_sort.h
1/*
2 * This file is part of the HDRL
3 * Copyright (C) 2017 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef HDRL_UTILS_SORT_H
21#define HDRL_UTILS_SORT_H
22
23
24#include "hdrl_cat_def.h"
25
26
27typedef enum {
28 HDRL_SORT_INT = 1,
29 HDRL_SORT_DOUBLE,
30 HDRL_SORT_CPL_SIZE,
31 HDRL_SORT_HDRL_VALUE,
32} hdrl_sort_type;
33
34typedef int (*f_compare)(const void *, const void *);
35
36cpl_error_code sort_array_f(void *a, cpl_size nE, cpl_size sE, f_compare f);
37cpl_error_code sort_array( void *a, cpl_size nE, cpl_size sE, hdrl_sort_type type, cpl_sort_direction dir);
38
39cpl_error_code sort_array_index( double *a, cpl_size nE, void *b, hdrl_sort_type type, cpl_sort_direction dir);
40cpl_error_code sort_arrays_index( double *a, cpl_size nE, void **bs, cpl_size nA, hdrl_sort_type *types, cpl_sort_direction dir);
41
42
43 #endif /* HDRL_UTILS_SORT_H */
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...
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 co...
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 s...
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 t...