X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Finteraction.c;h=87f4836da23479ced8fa9a2069841ada800408d9;hb=81579d9e9f994fb2908f50af41c3eb033d216e58;hp=f2831d27680d26033965a756c0aebf5c808fd177;hpb=8e16ce856374ec440157b80ac19ef6dd724a0bd1;p=pspp-builds.git diff --git a/src/math/interaction.c b/src/math/interaction.c index f2831d27..87f4836d 100644 --- a/src/math/interaction.c +++ b/src/math/interaction.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ along with this program. If not, see . */ /* - An interaction is a gsl_vector containing a "product" of other + An interaction is a structure 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 @@ -30,14 +30,18 @@ */ #include + +#include "math/interaction.h" + #include -#include -#include -#include -#include -#include #include -#include +#include + +#include "data/dictionary.h" +#include "data/value.h" +#include "data/variable.h" + +#include "gl/xalloc.h" struct interaction_variable { @@ -85,14 +89,14 @@ interaction_variable_create (const struct variable **vars, int n_vars) width += var_get_width (vars[i]); } } - result->intr = var_create_internal (0, width); + result->intr = dict_create_internal_var (0, width); } return result; } void interaction_variable_destroy (struct interaction_variable *iv) { - var_destroy (iv->intr); + dict_destroy_internal_var (iv->intr); free (iv->members); free (iv); } @@ -268,7 +272,7 @@ is_interaction (const struct variable *var, const struct interaction_variable ** for (i = 0; i < n_intr; i++) { intr = interaction_get_variable (iv[i]); - if (var_get_dict_index (intr) == var_get_dict_index (var)) + if (intr == var) { return true; }