+
+ /* Tally up the sums for all the encodings */
+ for (i = 0 ; i < cat->n_iap; ++i)
+ {
+ int x, y;
+ struct interact_params *iap = &cat->iap[i];
+ const struct interaction *iact = iap->iact;
+
+ const int df = iap->df_prod [iact->n_vars - 1];
+
+ iap->enc_sum = xcalloc (df, sizeof (*(iap->enc_sum)));
+
+ for (y = 0; y < hmap_count (&iap->ivmap); ++y)
+ {
+ struct interaction_value *iv = iap->reverse_interaction_value_map[y];
+ for (x = iap->base_subscript_short; x < iap->base_subscript_short + df ;++x)
+ {
+ const double bin = categoricals_get_binary_by_subscript (cat, x, iv->ccase); \
+ iap->enc_sum [x - iap->base_subscript_short] += bin * iv->cc;
+ }
+ }
+ }