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"
26 /* A hash table containing the cells. The table is indexed by a hash
27 based on the cell's categorical value. */
30 /* A binary tree containing the cells. This is
31 used to sort the elements in order of their categorical
41 const struct variable **factor_vars;
47 typedef struct statistic *stat_create (struct pool *pool);
48 typedef void stat_update (struct statistic *stat, double w, double x);
49 typedef double stat_get (const struct statistic *);
50 typedef void stat_destroy (struct statistic *);
55 /* Printable title for output */
58 /* Keyword for syntax */
61 /* The result class for the datum. */
76 /* Intermediate data per table. */
79 /* An array of n_layers integers which are used
80 to permute access into the factor_vars of each layer. */
83 /* An array of n_layers cell_containers which hold the union
84 of instances used respectively by each layer. */
85 struct cell_container *instances;
87 struct cell *root_cell;
90 /* The thing parsed after TABLES= */
94 const struct variable **dep_vars;
96 struct layer **layers;
101 /* An array of n_combinations workspaces. */
102 struct workspace *ws;
104 /* An array of n_combinations * n_dep_vars summaries.
105 These are displayed in the Case Processing
107 struct summary *summ;
110 /* A structure created by the parser. Contains the definition of the
111 what the procedure should calculate. */
114 const struct dictionary *dict;
116 /* The "tables" (ie, a definition of how the data should
118 struct mtable *table;
121 /* Missing value class for categorical variables. */
122 enum mv_class ctrl_exclude;
124 /* Missing value class for dependent variables */
125 enum mv_class dep_exclude;
127 /* The statistics to be calculated for each cell. */
131 /* Pool on which cell functions may allocate data. */
137 #define n_MEANS_STATISTICS 17
138 extern const struct cell_spec cell_spec[n_MEANS_STATISTICS];
140 /* This enum must be consistent with the array cell_spec (in means-calc.c).
141 A bitfield instead of enums would in my opinion be
142 more elegent. However we want the order of the specified
143 statistics to be retained in the output. */
155 void run_means (struct means *cmd, struct casereader *input, const struct dataset *ds UNUSED);
158 bool means_parse (struct lexer *lexer, struct means *means);