- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-/*
- An interaction is a gsl_vector containing a "product" of other
- variables. The variables can be either categorical or numeric.
- If the variables are all numeric, the interaction is just the
- scalar product. If any of the variables are categorical, their
- product is a vector containing 0's in all but one entry. This entry
- is found by combining the vectors corresponding to the variables'
- OBS_VALS member. If there are K categorical variables, each with
- N_1, N_2, ..., N_K categories, then the interaction will have
- N_1 * N_2 * N_3 *...* N_K - 1 entries.
- */
-#include <assert.h>
-#include <libpspp/alloc.h>
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_vector.h>
-#include <data/category.h>
-#include <data/variable.h>
-
-/*
- Convert a list of values to a binary vector. The order of VALS must
- correspond to the order of V.
- */
-gsl_vector *
-get_interaction (union value **vals, const struct variable **v, size_t n_vars)
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "data/case.h"
+#include "interaction.h"
+
+#include "data/value.h"
+#include "data/variable.h"
+#include "libpspp/str.h"
+
+#include "gl/xalloc.h"
+
+#include <stdio.h>
+
+/* Creates and returns an interaction. If V is nonnull, then the interaction
+ initially contains V, otherwise it is initially empty. */
+struct interaction *
+interaction_create (const struct variable *v)