#ifndef MEANS_H
#define MEANS_H
+#include "libpspp/hmap.h"
+#include "libpspp/bt.h"
#include "libpspp/compiler.h"
struct cell_container
{
size_t n_factor_vars;
const struct variable **factor_vars;
-
- /* A container holding the union of all instances of values used
- as categories forming this layer. */
- struct cell_container instances;
};
-struct per_var_data;
+struct statistic;
-typedef struct per_var_data *stat_create (struct pool *pool);
-typedef void stat_update (struct per_var_data *stat, double w, double x);
-typedef double stat_get (const struct per_var_data *);
+typedef struct statistic *stat_create (struct pool *pool);
+typedef void stat_update (struct statistic *stat, double w, double x);
+typedef double stat_get (const struct statistic *);
+typedef void stat_destroy (struct statistic *);
struct cell_spec
/* Keyword for syntax */
const char *keyword;
+ /* The result class for the datum. */
+ const char *rc;
+
stat_create *sc;
stat_update *su;
stat_get *sd;
+ stat_destroy *sf;
+};
+
+struct summary
+{
+ double n_total;
+ double n_missing;
};
+/* Intermediate data per table. */
+struct workspace
+{
+ /* An array of n_layers integers which are used
+ to permute access into the factor_vars of each layer. */
+ int *control_idx;
+
+ /* An array of n_layers cell_containers which hold the union
+ of instances used respectively by each layer. */
+ struct cell_container *instances;
+
+ struct cell *root_cell;
+};
/* The thing parsed after TABLES= */
struct mtable
size_t n_dep_vars;
const struct variable **dep_vars;
- const struct variable **control_vars;
-
struct layer **layers;
int n_layers;
- struct cell *root_cell;
+ int n_combinations;
+
+ /* An array of n_combinations workspaces. */
+ struct workspace *ws;
+
+ /* An array of n_combinations * n_dep_vars summaries.
+ These are displayed in the Case Processing
+ Summary box. */
+ struct summary *summ;
};
/* A structure created by the parser. Contains the definition of the
size_t n_tables;
/* Missing value class for categorical variables. */
- enum mv_class exclude;
+ enum mv_class ctrl_exclude;
/* Missing value class for dependent variables */
enum mv_class dep_exclude;
- bool listwise_exclude;
-
-
/* The statistics to be calculated for each cell. */
int *statistics;
int n_statistics;
struct casereader;
void run_means (struct means *cmd, struct casereader *input, const struct dataset *ds UNUSED);
-void means_shipout (const struct mtable *mt, const struct means *means);
+struct lexer;
+bool means_parse (struct lexer *lexer, struct means *means);
+
+
#endif