};
-typedef void *stat_create (const struct means *, struct pool *pool);
-
-typedef void stat_update (const struct means *, void *stat, double w, double x);
-
-typedef double stat_get (const struct means *, struct per_var_data *, void *aux);
-
+typedef void *stat_create (struct pool *pool);
+typedef void stat_update (void *stat, double w, double x);
+typedef double stat_get (const struct per_var_data *, void *aux);
struct cell_spec
{
stat_get *sd;
};
-
struct harmonic_mean
{
double rsum;
double n;
};
-
static void *
-harmonic_create (const struct means *means UNUSED, struct pool *pool)
+harmonic_create (struct pool *pool)
{
struct harmonic_mean *hm = pool_alloc (pool, sizeof *hm);
static void
-harmonic_update (const struct means *means UNUSED, void *stat, double w, double x)
+harmonic_update (void *stat, double w, double x)
{
struct harmonic_mean *hm = stat;
hm->rsum += w / x;
static double
-harmonic_get (const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat)
+harmonic_get (const struct per_var_data *pvd UNUSED, void *stat)
{
struct harmonic_mean *hm = stat;
static void *
-geometric_create (const struct means *means UNUSED, struct pool *pool)
+geometric_create (struct pool *pool)
{
struct geometric_mean *gm = pool_alloc (pool, sizeof *gm);
static void
-geometric_update (const struct means *means UNUSED, void *stat, double w, double x)
+geometric_update (void *stat, double w, double x)
{
struct geometric_mean *gm = stat;
gm->prod *= pow (x, w);
static double
-geometric_get (const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat)
+geometric_get (const struct per_var_data *pvd UNUSED, void *stat)
{
struct geometric_mean *gm = stat;
\f
static double
-sum_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+sum_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double n, mean;
static double
-n_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+n_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double n;
}
static double
-arithmean_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+arithmean_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double n, mean;
}
static double
-variance_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+variance_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double n, mean, variance;
static double
-stddev_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat)
+stddev_get (const struct per_var_data *pvd, void *stat)
{
- return sqrt (variance_get (means, pvd, stat));
+ return sqrt (variance_get (pvd, stat));
}
\f
static double
-skew_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+skew_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double skew;
}
static double
-sekurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+sekurt_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double n;
return calc_sekurt (n);
}
-
-
static double
-seskew_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+seskew_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double n;
return calc_seskew (n);
}
-
-
static double
-kurt_get (const const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+kurt_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double kurt;
return kurt;
}
-
static double
-semean_get (const struct means *means UNUSED, struct per_var_data *pvd, void *stat UNUSED)
+semean_get (const struct per_var_data *pvd, void *stat UNUSED)
{
double n, var;
return sqrt (var / n);
}
-
-
\f
static void *
-min_create (const struct means *means UNUSED, struct pool *pool)
+min_create (struct pool *pool)
{
double *r = pool_alloc (pool, sizeof *r);
}
static void
-min_update (const struct means *means UNUSED, void *stat, double w UNUSED, double x)
+min_update (void *stat, double w UNUSED, double x)
{
double *r = stat;
}
static double
-min_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat)
+min_get (const struct per_var_data *pvd UNUSED, void *stat)
{
double *r = stat;
}
static void *
-max_create (const struct means *means UNUSED, struct pool *pool)
+max_create (struct pool *pool)
{
double *r = pool_alloc (pool, sizeof *r);
}
static void
-max_update (const struct means *means UNUSED, void *stat, double w UNUSED, double x)
+max_update (void *stat, double w UNUSED, double x)
{
double *r = stat;
}
static double
-max_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat)
+max_get (const struct per_var_data *pvd UNUSED, void *stat)
{
double *r = stat;
};
static void *
-range_create (const struct means *means UNUSED, struct pool *pool)
+range_create (struct pool *pool)
{
struct range *r = pool_alloc (pool, sizeof *r);
}
static void
-range_update (const struct means *means UNUSED, void *stat, double w UNUSED, double x)
+range_update (void *stat, double w UNUSED, double x)
{
struct range *r = stat;
}
static double
-range_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat)
+range_get (const struct per_var_data *pvd UNUSED, void *stat)
{
struct range *r = stat;
\f
static void *
-last_create (const struct means *means UNUSED, struct pool *pool)
+last_create (struct pool *pool)
{
double *l = pool_alloc (pool, sizeof *l);
}
static void
-last_update (const struct means *means UNUSED, void *stat, double w UNUSED, double x)
+last_update (void *stat, double w UNUSED, double x)
{
double *l = stat;
}
static double
-last_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat)
+last_get (const struct per_var_data *pvd UNUSED, void *stat)
{
double *l = stat;
static void *
-first_create (const struct means *means UNUSED, struct pool *pool)
+first_create (struct pool *pool)
{
double *f = pool_alloc (pool, sizeof *f);
- *f = SYSMIS;
+ *f = SYSMIS;
return f;
}
static void
-first_update (const struct means *means UNUSED, void *stat, double w UNUSED, double x)
+first_update (void *stat, double w UNUSED, double x)
{
double *f = stat;
}
static double
-first_get (const const struct means *means UNUSED, struct per_var_data *pvd UNUSED, void *stat)
+first_get (const struct per_var_data *pvd UNUSED, void *stat)
{
double *f = stat;
return *f;
}
-
-
/* Table of cell_specs */
static const struct cell_spec cell_spec[] = {
{N_("Mean"), "MEAN", NULL, NULL, arithmean_get},
const struct cell_spec *cs = &cell_spec[csi];
if (cs->sc)
{
- pp->cell_stats[i] = cs->sc (means, means->pool);
+ pp->cell_stats[i] = cs->sc (means->pool);
}
}
pp->mom = moments1_create (maxmom);
}
static void
-update_n (const void *aux1, void *aux2, void *user_data, const struct ccase *c)
+update_n (const void *aux1, void *aux2, void *user_data, const struct ccase *c, double weight)
{
int i;
int v = 0;
struct mtable *table = aux2;
struct per_cat_data *per_cat_data = user_data;
- double weight = dict_get_case_weight (means->dict, c, &per_cat_data->warn);
-
for (v = 0; v < table->n_dep_vars; ++v)
{
struct per_var_data *pvd = &per_cat_data->pvd[v];
if (cs->su)
- cs->su (means,
- pvd->cell_stats[i],
+ cs->su (pvd->cell_stats[i],
weight, x);
}
const struct cell_spec *cs = &cell_spec[csi];
if (cs->su)
- cs->sd (means, pvd, pvd->cell_stats[i]);
+ cs->sd (pvd, pvd->cell_stats[i]);
}
}
}
const int csi = cmd->cells[i];
const struct cell_spec *cs = &cell_spec[csi];
- double result = cs->sd (cmd, pvd, pvd->cell_stats[i]);
+ double result = cs->sd (pvd, pvd->cell_stats[i]);
tab_double (t, heading_columns + i,
heading_rows + grp + dv * n_cats,