High-Level Data Reduction Library: catalogue/hdrl_cat_utils_sort.h Source File

High-Level Data Reduction Library 1.6.0 High-Level data reduction routines for ESO pipelines

Loading...
Searching...
No Matches
hdrl_cat_utils_sort.h
Go to the documentation of this file.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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
27 typedef 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
34 typedef 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 */
hdrl_cat_def.h
hdrl_sort_type
hdrl_sort_type
Definition hdrl_cat_utils_sort.h:27
HDRL_SORT_INT
@ HDRL_SORT_INT
Definition hdrl_cat_utils_sort.h:28
HDRL_SORT_DOUBLE
@ HDRL_SORT_DOUBLE
Definition hdrl_cat_utils_sort.h:29
HDRL_SORT_HDRL_VALUE
@ HDRL_SORT_HDRL_VALUE
Definition hdrl_cat_utils_sort.h:31
HDRL_SORT_CPL_SIZE
@ HDRL_SORT_CPL_SIZE
Definition hdrl_cat_utils_sort.h:30
f_compare
int(* f_compare)(const void *, const void *)
Definition hdrl_cat_utils_sort.h:34
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...
Definition hdrl_cat_utils_sort.c:82
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 co...
Definition hdrl_cat_utils_sort.c:107
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 s...
Definition hdrl_cat_utils_sort.c:188
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 t...
Definition hdrl_cat_utils_sort.c:153