+
+ cat->reverse_variable_map_short = pool_calloc (cat->pool,
+ cat->df_sum,
+ sizeof *cat->reverse_variable_map_short);
+
+ cat->reverse_variable_map_long = pool_calloc (cat->pool,
+ cat->n_cats_total,
+ sizeof *cat->reverse_variable_map_long);
+
+ for (i = 0 ; i < cat->n_iap; ++i)
+ {
+ struct interaction_value *ivn = NULL;
+ int x = 0;
+ int ii;
+ struct interact_params *iap = &cat->iap[i];
+
+ iap->base_subscript_short = idx_short;
+ iap->base_subscript_long = idx_long;
+
+ iap->reverse_interaction_value_map = pool_calloc (cat->pool, iap->n_cats,
+ sizeof *iap->reverse_interaction_value_map);
+
+ HMAP_FOR_EACH (ivn, struct interaction_value, node, &iap->ivmap)
+ {
+ iap->reverse_interaction_value_map[x++] = ivn;
+
+ }
+
+ assert (x <= iap->n_cats);
+
+ /* For some purposes (eg CONTRASTS in ONEWAY) the values need to be sorted */
+ sort (iap->reverse_interaction_value_map, x, sizeof (*iap->reverse_interaction_value_map),
+ compare_interaction_value_3way, iap);
+
+ /* Fill the remaining values with null */
+ for (ii = x ; ii < iap->n_cats; ++ii)
+ iap->reverse_interaction_value_map[ii] = NULL;
+
+ /* Populate the reverse variable maps. */
+ if (iap->df_prod)