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;
45 typedef struct statistic *stat_create (struct pool *pool);
46 typedef void stat_update (struct statistic *stat, double w, double x);
47 typedef double stat_get (const struct statistic *);
48 typedef void stat_destroy (struct statistic *);
53 /* Printable title for output */
56 /* Keyword for syntax */
59 /* The result class for the datum. */
74 /* Intermediate data per table. */
77 /* An array of n_layers integers which are used
78 to permute access into the factor_vars of each layer. */
81 /* An array of n_layers cell_containers which hold the union
82 of instances used respectively by each layer. */
83 struct cell_container *instances;
85 struct cell *root_cell;
88 /* The thing parsed after TABLES= */
92 const struct variable **dep_vars;
94 struct layer **layers;
99 /* An array of n_combinations workspaces. */
100 struct workspace *ws;
102 /* An array of n_combinations * n_dep_vars summaries.
103 These are displayed in the Case Processing
105 struct summary *summ;
108 /* A structure created by the parser. Contains the definition of the
109 what the procedure should calculate. */
112 const struct dictionary *dict;
114 /* The "tables" (ie, a definition of how the data should
116 struct mtable *table;
119 /* Missing value class for categorical variables. */
120 enum mv_class ctrl_exclude;
122 /* Missing value class for dependent variables */
123 enum mv_class dep_exclude;
125 /* The statistics to be calculated for each cell. */
129 /* Pool on which cell functions may allocate data. */
135 #define n_MEANS_STATISTICS 17
136 extern const struct cell_spec cell_spec[n_MEANS_STATISTICS];
138 /* This enum must be consistent with the array cell_spec (in means-calc.c).
139 A bitfield instead of enums would in my opinion be
140 more elegent. However we want the order of the specified
141 statistics to be retained in the output. */
153 void run_means (struct means *cmd, struct casereader *input, const struct dataset *ds UNUSED);
155 void means_shipout (const struct mtable *mt, const struct means *means);
157 void means_case_processing_summary (const struct mtable *mt);
160 void destroy_means (struct means *means);