1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2011, 2012, 2013, 2019 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/>. */
20 #include "libpspp/hmap.h"
21 #include "libpspp/bt.h"
22 #include "libpspp/compiler.h"
30 /* A hash table containing the cells. The table is indexed by a hash
31 based on the cell's categorical value. */
34 /* A binary tree containing the cells. This is
35 used to sort the elements in order of their categorical
45 const struct variable **factor_vars;
51 typedef struct statistic *stat_create (struct pool *pool);
52 typedef void stat_update (struct statistic *stat, double w, double x);
53 typedef double stat_get (const struct statistic *);
54 typedef void stat_destroy (struct statistic *);
59 /* Printable title for output */
62 /* Keyword for syntax */
65 /* The result class for the datum. */
80 /* Intermediate data per table. */
83 /* An array of n_layers integers which are used
84 to permute access into the factor_vars of each layer. */
87 /* An array of n_layers cell_containers which hold the union
88 of instances used respectively by each layer. */
89 struct cell_container *instances;
91 struct cell *root_cell;
94 /* The thing parsed after TABLES= */
98 const struct variable **dep_vars;
100 struct layer **layers;
105 /* An array of n_combinations workspaces. */
106 struct workspace *ws;
108 /* An array of n_combinations * n_dep_vars summaries.
109 These are displayed in the Case Processing
111 struct summary *summ;
114 /* A structure created by the parser. Contains the definition of the
115 what the procedure should calculate. */
118 const struct dictionary *dict;
120 /* The "tables" (ie, a definition of how the data should
122 struct mtable *table;
125 /* Missing value class for categorical variables. */
126 enum mv_class ctrl_exclude;
128 /* Missing value class for dependent variables */
129 enum mv_class dep_exclude;
131 /* The statistics to be calculated for each cell. */
134 size_t allocated_statistics;
136 /* Pool on which cell functions may allocate data. */
142 #define n_MEANS_STATISTICS 17
143 extern const struct cell_spec cell_spec[n_MEANS_STATISTICS];
145 /* This enum must be consistent with the array cell_spec (in means-calc.c).
146 A bitfield instead of enums would in my opinion be
147 more elegent. However we want the order of the specified
148 statistics to be retained in the output. */
156 void run_means (struct means *, struct casereader *, const struct dataset *);
157 bool means_parse (struct lexer *, struct means *);
158 void means_set_default_statistics (struct means *);