/* PSPP - a program for statistical analysis.
- Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012, 2013 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
const struct layer *lyr = &table->layers[l];
const int n_vars = lyr->n_factor_vars;
table->interactions[l] = interaction_create (NULL);
- for (v = 0 ; v < n_vars ; ++v)
+ for (v = 0; v < n_vars ; ++v)
{
interaction_add_variable (table->interactions[l],
lyr->factor_vars[v]);
ok = proc_commit (ds) && ok;
}
+ for (t = 0; t < means.n_tables; ++t)
+ {
+ int l;
+ struct mtable *table = &means.table[t];
+ for (l = 0; l < table->n_layers; ++l)
+ {
+ interaction_destroy (table->interactions[l]);
+ }
+ }
pool_destroy (means.pool);
return CMD_SUCCESS;
error:
+ for (t = 0; t < means.n_tables; ++t)
+ {
+ int l;
+ struct mtable *table = &means.table[t];
+ for (l = 0; l < table->n_layers; ++l)
+ {
+ interaction_destroy (table->interactions[l]);
+ }
+ }
+
pool_destroy (means.pool);
return CMD_FAILURE;
}
if (vn->var == var)
break;
- fprintf (stderr, "Warning: Hash table collision\n");
+ fprintf (stderr, "%s:%d Warning: Hash table collision\n", __FILE__, __LINE__);
}
return vn;
/* A map of cases indexed by a interaction_value */
struct hmap ivmap;
- struct interaction *iact;
+ const struct interaction *iact;
int base_subscript_short;
int base_subscript_long;
int i;
if (NULL == cat)
return;
+
for (i = 0; i < cat->n_iap; ++i)
{
struct interaction_value *iv = NULL;
free (cat->iap[i].enc_sum);
free (cat->iap[i].df_prod);
hmap_destroy (&cat->iap[i].ivmap);
- interaction_destroy (cat->iap[i].iact);
}
/* Interate over each variable and delete its value map */
union value ;
-struct categoricals *categoricals_create (struct interaction *const *, size_t n_int,
+struct categoricals *categoricals_create (struct interaction *const*, size_t n_int,
const struct variable *wv, enum mv_class dep_excl,
enum mv_class fctr_excl);