/* 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;
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);
vars[i] = categoricals_get_variable_by_subscript (cov->categoricals, i - cov->n_vars);
}
}
+
+
+void
+covariance_get_interaction_indices (const struct covariance *cov, const struct interaction **iacts)
+{
+ int i;
+ for (i = 0; i < cov->n_vars; i++)
+ {
+ iacts[i] = cov->vars[i];
+ }
+ for (i = cov->n_vars; i < cov->dim; i++)
+ {
+ iacts[i] = categoricals_get_interaction_by_subscript (cov->categoricals, i - cov->n_vars);
+ }
+}