1 /* histogram/gsl_histogram2d.h
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
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.
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.
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.
20 #ifndef __GSL_HISTOGRAM2D_H__
21 #define __GSL_HISTOGRAM2D_H__
29 # define __BEGIN_DECLS extern "C" {
30 # define __END_DECLS }
32 # define __BEGIN_DECLS /* empty */
33 # define __END_DECLS /* empty */
50 } gsl_histogram2d_pdf ;
52 gsl_histogram2d * gsl_histogram2d_alloc (const size_t nx, const size_t ny);
53 gsl_histogram2d * gsl_histogram2d_calloc (const size_t nx, const size_t ny);
54 gsl_histogram2d * gsl_histogram2d_calloc_uniform (const size_t nx, const size_t ny,
55 const double xmin, const double xmax,
56 const double ymin, const double ymax);
58 void gsl_histogram2d_free (gsl_histogram2d * h);
60 int gsl_histogram2d_increment (gsl_histogram2d * h, double x, double y);
61 int gsl_histogram2d_accumulate (gsl_histogram2d * h,
62 double x, double y, double weight);
63 int gsl_histogram2d_find (const gsl_histogram2d * h,
64 const double x, const double y, size_t * i, size_t * j);
66 double gsl_histogram2d_get (const gsl_histogram2d * h, const size_t i, const size_t j);
67 int gsl_histogram2d_get_xrange (const gsl_histogram2d * h, const size_t i,
68 double * xlower, double * xupper);
69 int gsl_histogram2d_get_yrange (const gsl_histogram2d * h, const size_t j,
70 double * ylower, double * yupper);
73 double gsl_histogram2d_xmax (const gsl_histogram2d * h);
74 double gsl_histogram2d_xmin (const gsl_histogram2d * h);
75 size_t gsl_histogram2d_nx (const gsl_histogram2d * h);
77 double gsl_histogram2d_ymax (const gsl_histogram2d * h);
78 double gsl_histogram2d_ymin (const gsl_histogram2d * h);
79 size_t gsl_histogram2d_ny (const gsl_histogram2d * h);
81 void gsl_histogram2d_reset (gsl_histogram2d * h);
84 gsl_histogram2d_calloc_range(size_t nx, size_t ny,
85 double *xrange, double *yrange);
88 gsl_histogram2d_set_ranges_uniform (gsl_histogram2d * h,
89 double xmin, double xmax,
90 double ymin, double ymax);
93 gsl_histogram2d_set_ranges (gsl_histogram2d * h,
94 const double xrange[], size_t xsize,
95 const double yrange[], size_t ysize);
98 gsl_histogram2d_memcpy(gsl_histogram2d *dest, const gsl_histogram2d *source);
101 gsl_histogram2d_clone(const gsl_histogram2d * source);
104 gsl_histogram2d_max_val(const gsl_histogram2d *h);
107 gsl_histogram2d_max_bin (const gsl_histogram2d *h, size_t *i, size_t *j);
110 gsl_histogram2d_min_val(const gsl_histogram2d *h);
113 gsl_histogram2d_min_bin (const gsl_histogram2d *h, size_t *i, size_t *j);
116 gsl_histogram2d_xmean (const gsl_histogram2d * h);
119 gsl_histogram2d_ymean (const gsl_histogram2d * h);
122 gsl_histogram2d_xsigma (const gsl_histogram2d * h);
125 gsl_histogram2d_ysigma (const gsl_histogram2d * h);
128 gsl_histogram2d_cov (const gsl_histogram2d * h);
131 gsl_histogram2d_sum (const gsl_histogram2d *h);
134 gsl_histogram2d_equal_bins_p(const gsl_histogram2d *h1,
135 const gsl_histogram2d *h2) ;
138 gsl_histogram2d_add(gsl_histogram2d *h1, const gsl_histogram2d *h2);
141 gsl_histogram2d_sub(gsl_histogram2d *h1, const gsl_histogram2d *h2);
144 gsl_histogram2d_mul(gsl_histogram2d *h1, const gsl_histogram2d *h2);
147 gsl_histogram2d_div(gsl_histogram2d *h1, const gsl_histogram2d *h2);
150 gsl_histogram2d_scale(gsl_histogram2d *h, double scale);
153 gsl_histogram2d_shift(gsl_histogram2d *h, double shift);
155 int gsl_histogram2d_fwrite (FILE * stream, const gsl_histogram2d * h) ;
156 int gsl_histogram2d_fread (FILE * stream, gsl_histogram2d * h);
157 int gsl_histogram2d_fprintf (FILE * stream, const gsl_histogram2d * h,
158 const char * range_format,
159 const char * bin_format);
160 int gsl_histogram2d_fscanf (FILE * stream, gsl_histogram2d * h);
162 gsl_histogram2d_pdf * gsl_histogram2d_pdf_alloc (const size_t nx, const size_t ny);
163 int gsl_histogram2d_pdf_init (gsl_histogram2d_pdf * p, const gsl_histogram2d * h);
164 void gsl_histogram2d_pdf_free (gsl_histogram2d_pdf * p);
165 int gsl_histogram2d_pdf_sample (const gsl_histogram2d_pdf * p,
166 double r1, double r2,
167 double * x, double * y);
171 #endif /* __GSL_HISTOGRAM2D_H__ */