#include "command.h"
#include "lexer.h"
#include "error.h"
-#include "approx.h"
#include "magic.h"
#include "stats.h"
#include "som.h"
static void run_z_pass (void);
/* Procedure execution functions. */
-static int calc (struct ccase *);
-static void precalc (void);
-static void postcalc (void);
+static int calc (struct ccase *, void *);
+static void precalc (void *);
+static void postcalc (void *);
static void display (void);
\f
/* Parser and outline. */
v_variables = NULL;
n_variables = 0;
- lex_match_id ("DESCRIPTIVES");
- lex_match_id ("CONDESCRIPTIVES");
if (!parse_descriptives (&cmd))
goto lossage;
/* Data pass! */
bad_weight = 0;
- procedure (precalc, calc, postcalc);
+ procedure_with_splits (precalc, calc, postcalc, NULL);
if (bad_weight)
msg (SW, _("At least one case in the data file had a weight value "
/* Transformation function to calculate Z-scores. */
static int
-descriptives_trns_proc (struct trns_header * trns, struct ccase * c)
+descriptives_trns_proc (struct trns_header * trns, struct ccase * c,
+ int case_num UNUSED)
{
struct descriptives_trns *t = (struct descriptives_trns *) trns;
struct dsc_z_score *z;
struct variable *d;
t->z[count].s = v;
- t->z[count].d = d = dict_create_var (default_dict,
- v->p.dsc.zname, 0);
- assert (d != NULL);
+ t->z[count].d = d = dict_create_var_assert (default_dict,
+ v->p.dsc.zname, 0);
+ d->init = 0;
if (v->label)
{
d->label = xmalloc (strlen (v->label) + 12);
}
t->z[count].mean = v->p.dsc.stats[dsc_mean];
t->z[count].std_dev = v->p.dsc.stats[dsc_stddev];
- if (t->z[count].std_dev == SYSMIS
- || approx_eq (t->z[count].std_dev, 0.0))
+ if (t->z[count].std_dev == SYSMIS || t->z[count].std_dev == 0.0)
t->z[count].mean = SYSMIS;
count++;
}
/* Statistical calculation. */
static void
-precalc (void)
+precalc (void *aux UNUSED)
{
int i;
}
static int
-calc (struct ccase * c)
+calc (struct ccase * c, void *aux UNUSED)
{
int i;
}
static void
-postcalc (void)
+postcalc (void *aux UNUSED)
{
int i;