/* A map indexed by a union values */
struct hmap map;
- const struct variable *var;
const struct interaction *iact;
int base_subscript_short;
/* The weight variable */
const struct variable *wv;
-
/* An array of var_params */
struct var_params *vp;
if (cat != NULL)
{
for (i = 0 ; i < cat->n_vp; ++i)
- hmap_destroy (&cat->vp[i].map);
+ {
+ struct hmap *map = &cat->vp[i].map;
+ struct value_node *nn;
+
+ HMAP_FOR_EACH (nn, struct value_node, node, map)
+ {
+ case_unref (nn->ccase);
+ }
+
+ hmap_destroy (map);
+ }
pool_destroy (cat->pool);
free (cat);
for (i = 0 ; i < cat->n_vp; ++i)
{
hmap_init (&cat->vp[i].map);
- cat->vp[i].var = inter[i]->vars[0];
cat->vp[i].iact = inter[i];
}
for (i = 0 ; i < cat->n_vp; ++i)
{
const struct interaction *iact = cat->vp[i].iact;
- const struct variable *var = cat->vp[i].var;
-
- const union value *val = case_data (c, var);
size_t hash;
struct value_node *node ;
-#if XXX
- if ( var_is_value_missing (var, val, cat->exclude))
+ if ( interaction_case_is_missing (iact, c, cat->exclude))
continue;
-#endif
hash = interaction_case_hash (iact, c);
node = lookup_case (&cat->vp[i].map, iact, c);
if ( NULL == node)
{
- int width = var_get_width (var);
node = pool_malloc (cat->pool, sizeof *node);
node->ccase = case_ref (c);
cat->vp[i].cc += weight;
if (cat->update)
- cat->update (node->user_data, cat->exclude, cat->wv, var, c, cat->aux1, cat->aux2);
+ cat->update (node->user_data, cat->exclude, cat->wv, NULL, c, cat->aux1, cat->aux2);
}
}
{
int index = reverse_variable_lookup_short (cat, subscript);
- return cat->vp[index].var;
+ return cat->vp[index].iact->vars[0];
}
/* Return the interaction corresponding to SUBSCRIPT */
-static const struct interaction *
+const struct interaction *
categoricals_get_interaction_by_subscript (const struct categoricals *cat, int subscript)
{
int index = reverse_variable_lookup_short (cat, subscript);