SINFONI Pipeline Reference Manual  2.6.0
sinfo_median.h
1 /*
2  * This file is part of the ESO SINFONI Pipeline
3  * Copyright (C) 2004,2005 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, 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18  */
19 /*---------------------------------------------------------------------------
20 
21  File name : sinfo_median.h
22  Author : N. Devillard
23  Created on : 1998
24  Description : Fast sinfo_median finding routines
25  *--------------------------------------------------------------------------*/
26 /*
27  $Id: sinfo_median.h,v 1.3 2007-06-06 07:10:45 amodigli Exp $
28  $Author: amodigli $
29  $Date: 2007-06-06 07:10:45 $
30  $Revision: 1.3 $
31 */
32 #ifndef SINFO_MEDIAN_H
33 #define SINFO_MEDIAN_H
34 
35 
36 /*---------------------------------------------------------------------------
37  Includes
38  ---------------------------------------------------------------------------*/
39 
40 /* Get the definition of a pixelvalue */
41 #include "sinfo_local_types.h"
42 
43 /*---------------------------------------------------------------------------
44  Function prototypes
45  ---------------------------------------------------------------------------*/
73 /*--------------------------------------------------------------------------*/
74 
75 pixelvalue
76 sinfo_kth_smallest(pixelvalue a[], int n, int k);
77 
92 double
93 sinfo_kth_smallest_double(double a[], int n, int k) ;
94 
95 #define median_double(a,n) \
96 sinfo_kth_smallest_double(a,n,(((n)&1)?((n)/2):(((n)/2)-1)))
97 
112 pixelvalue
113 sinfo_opt_med3(
114  pixelvalue * p
115 ) ;
116 
131 pixelvalue
132 sinfo_opt_med5(
133  pixelvalue * p
134 );
135 
136 
151 pixelvalue
152 sinfo_opt_med7(
153  pixelvalue * p
154 ) ;
155 
174 pixelvalue
175 sinfo_opt_med9(
176  pixelvalue * p
177 ) ;
178 
197 pixelvalue
198 sinfo_opt_med25(
199  pixelvalue * p
200 ) ;
201 
202 
218 pixelvalue
219 sinfo_median_pixelvalue(pixelvalue * a, int n);
220 
221 #endif