treewide: Fix memory leaks from calls to relocate().
[pspp.git] / src / math / box-whisker.h
blob2dd5b5c609da2b0857396235da676672d32e0ec0
1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (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
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef __MATH_BOX_WHISKER_H__
18 #define __MATH_BOX_WHISKER_H__
20 #include <stddef.h>
21 #include "libpspp/ll.h"
22 #include "libpspp/str.h"
23 #include "math/order-stats.h"
25 /* This module calculates the statistics typically displayed by box-plots.
26 However, there's no reason not to use it for other purposes too.
28 struct tukey_hinges;
29 struct variable;
31 struct outlier
33 double value;
34 struct string label;
35 bool extreme;
36 struct ll ll;
40 struct box_whisker
42 struct order_stats parent;
44 double hinges[3];
45 double whiskers[2];
47 struct ll_list outliers;
49 double step;
51 size_t id_idx;
52 const struct variable *id_var;
55 struct box_whisker * box_whisker_create (const struct tukey_hinges *,
56 size_t id_idx, const struct variable *id_var);
58 void box_whisker_whiskers (const struct box_whisker *bw, double whiskers[2]);
60 void box_whisker_hinges (const struct box_whisker *bw, double hinges[3]);
62 const struct ll_list * box_whisker_outliers (const struct box_whisker *bw);
65 #endif