+
+/* Default design: all possible interactions */
+static void
+design_full (struct glm_spec *glm)
+{
+ int sz;
+ int i = 0;
+ glm->n_interactions = (1 << glm->n_factor_vars) - 1;
+
+ glm->interactions = xcalloc (glm->n_interactions, sizeof *glm->interactions);
+
+ /* All subsets, with exception of the empty set, of [0, glm->n_factor_vars) */
+ for (sz = 1; sz <= glm->n_factor_vars; ++sz)
+ {
+ gsl_combination *c = gsl_combination_calloc (glm->n_factor_vars, sz);
+
+ do
+ {
+ struct interaction *iact = interaction_create (NULL);
+ int e;
+ for (e = 0 ; e < gsl_combination_k (c); ++e)
+ interaction_add_variable (iact, glm->factor_vars [gsl_combination_get (c, e)]);
+
+ glm->interactions[i++] = iact;
+ }
+ while (gsl_combination_next (c) == GSL_SUCCESS);
+
+ gsl_combination_free (c);
+ }
+}
+