+static struct descriptive_data *
+dd_create (const struct variable *var)
+{
+ struct descriptive_data *dd = xmalloc (sizeof *dd);
+
+ dd->mom = moments1_create (MOMENT_VARIANCE);
+ dd->minimum = DBL_MAX;
+ dd->maximum = -DBL_MAX;
+ dd->var = var;
+
+ return dd;
+}
+
+
+static void *
+makeit (void *aux1, void *aux2 UNUSED)
+{
+ const struct variable *var = aux1;
+
+ struct descriptive_data *dd = dd_create (var);
+
+ return dd;
+}
+
+static void
+updateit (void *user_data,
+ enum mv_class exclude,
+ const struct variable *wv,
+ const struct variable *catvar UNUSED,
+ const struct ccase *c,
+ void *aux1, void *aux2)
+{
+ struct descriptive_data *dd = user_data;
+
+ const struct variable *varp = aux1;
+
+ const union value *valx = case_data (c, varp);
+
+ if ( var_is_value_missing (varp, valx, exclude))
+ return;
+
+ struct descriptive_data *dd_total = aux2;
+
+ double weight = 1.0;
+ if (wv)
+ weight = case_data (c, wv)->f;
+
+ moments1_add (dd->mom, valx->f, weight);
+ if (valx->f * weight < dd->minimum)
+ dd->minimum = valx->f * weight;
+
+ if (valx->f * weight > dd->maximum)
+ dd->maximum = valx->f * weight;
+
+ {
+ const struct variable *var = dd_total->var;
+ const union value *val = case_data (c, var);
+
+ moments1_add (dd_total->mom,
+ val->f,
+ weight);
+
+ if (val->f * weight < dd_total->minimum)
+ dd_total->minimum = val->f * weight;
+
+ if (val->f * weight > dd_total->maximum)
+ dd_total->maximum = val->f * weight;
+ }
+}