Added script front-end for primer-design code
[htsworkflow.git] / htswanalysis / MACS / lib / gsl / gsl-1.11 / ntuple / gsl_ntuple.h
1 /* histogram/ntuple.h
2  * 
3  * Copyright (C) 2000 Simone Piccardi
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 3 of the License, or (at
8  * your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  */
20
21 /* Jan/2001 Modified by Brian Gough. Minor changes for GSL */
22
23 #ifndef __GSL_NTUPLE_H__
24 #define __GSL_NTUPLE_H__
25
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <gsl/gsl_errno.h>
29 #include <gsl/gsl_histogram.h>
30
31 #undef __BEGIN_DECLS
32 #undef __END_DECLS
33 #ifdef __cplusplus
34 # define __BEGIN_DECLS extern "C" {
35 # define __END_DECLS }
36 #else
37 # define __BEGIN_DECLS /* empty */
38 # define __END_DECLS /* empty */
39 #endif
40
41 __BEGIN_DECLS
42
43 typedef struct {
44     FILE * file;
45     void * ntuple_data;
46     size_t size;
47 } gsl_ntuple;
48
49 typedef struct {
50   int (* function) (void * ntuple_data, void * params);
51   void * params;
52 } gsl_ntuple_select_fn;
53
54 typedef struct {
55   double (* function) (void * ntuple_data, void * params);
56   void * params;
57 } gsl_ntuple_value_fn;
58
59 gsl_ntuple * 
60 gsl_ntuple_open (char * filename, void * ntuple_data, size_t size);
61
62 gsl_ntuple * 
63 gsl_ntuple_create (char * filename, void * ntuple_data, size_t size);
64
65 int gsl_ntuple_write (gsl_ntuple * ntuple);
66 int gsl_ntuple_read (gsl_ntuple * ntuple);
67
68 int gsl_ntuple_bookdata (gsl_ntuple * ntuple);  /* synonym for write */
69
70 int gsl_ntuple_project (gsl_histogram * h, gsl_ntuple * ntuple, 
71                         gsl_ntuple_value_fn *value_func,
72                         gsl_ntuple_select_fn *select_func);
73
74 int gsl_ntuple_close (gsl_ntuple * ntuple);
75
76 __END_DECLS
77
78 #endif /* __GSL_NTUPLE_H__ */
79
80
81
82