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/compiler.h"
24 /* A hash table containing the cells. The table is indexed by a hash
25 based on the cell's categorical value. */
28 /* A binary tree containing the cells. This is
29 used to sort the elements in order of their categorical
39 const struct variable **factor_vars;
41 /* A container holding the union of all instances of values used
42 as categories forming this layer. */
43 struct cell_container instances;
49 typedef struct per_var_data *stat_create (struct pool *pool);
50 typedef void stat_update (struct per_var_data *stat, double w, double x);
51 typedef double stat_get (const struct per_var_data *);
56 /* Printable title for output */
59 /* Keyword for syntax */
68 /* The thing parsed after TABLES= */
72 const struct variable **dep_vars;
74 const struct variable **control_vars;
76 struct layer **layers;
79 struct cell *root_cell;
82 /* A structure created by the parser. Contains the definition of the
83 what the procedure should calculate. */
86 const struct dictionary *dict;
88 /* The "tables" (ie, a definition of how the data should
93 /* Missing value class for categorical variables. */
94 enum mv_class exclude;
96 /* Missing value class for dependent variables */
97 enum mv_class dep_exclude;
99 bool listwise_exclude;
102 /* The statistics to be calculated for each cell. */
106 /* Pool on which cell functions may allocate data. */
112 #define n_MEANS_STATISTICS 17
113 extern const struct cell_spec cell_spec[n_MEANS_STATISTICS];
115 /* This enum must be consistent with the array cell_spec (in means-calc.c).
116 A bitfield instead of enums would in my opinion be
117 more elegent. However we want the order of the specified
118 statistics to be retained in the output. */
130 void run_means (struct means *cmd, struct casereader *input, const struct dataset *ds UNUSED);
132 void means_shipout (const struct mtable *mt, const struct means *means);