1 /* gsl_histogram_maxval.c
2 * Copyright (C) 2000 Simone Piccardi
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
19 /***************************************************************
21 * File gsl_histogram_maxval.c:
22 * Routine to find maximum and minumum content of a hisogram.
23 * Need GSL library and header.
24 * Contains the routines:
25 * gsl_histogram_max_val find max content values
26 * gsl_histogram_min_val find min content values
27 * gsl_histogram_bin_max find coordinates of max contents bin
28 * gsl_histogram_bin_min find coordinates of min contents bin
33 ***************************************************************/
35 #include <gsl/gsl_errno.h>
36 #include <gsl/gsl_histogram.h>
39 gsl_histogram_max_val (const gsl_histogram * h)
41 const size_t n = h->n;
43 double max = h->bin[0];
44 for (i = 0; i < n; i++)
55 gsl_histogram_max_bin (const gsl_histogram * h)
59 double max = h->bin[0];
60 for (i = 0; i < h->n; i++)
72 gsl_histogram_min_val (const gsl_histogram * h)
75 double min = h->bin[0];
76 for (i = 0; i < h->n; i++)
87 gsl_histogram_min_bin (const gsl_histogram * h)
91 double min = h->bin[0];
92 for (i = 0; i < h->n; i++)