From: Jason Stover Date: Tue, 22 Nov 2005 22:10:25 +0000 (+0000) Subject: Categorical value cache added X-Git-Tag: v0.6.0~1139 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17896e38991000673747aa115b3f7aeb9a57a40f;p=pspp-builds.git Categorical value cache added --- diff --git a/src/dictionary.c b/src/dictionary.c index c3ed8ac0..f916fd0c 100644 --- a/src/dictionary.c +++ b/src/dictionary.c @@ -24,6 +24,7 @@ #include "algorithm.h" #include "alloc.h" #include "case.h" +#include "cat.h" #include "error.h" #include "hash.h" #include "misc.h" @@ -299,6 +300,7 @@ dict_create_var (struct dictionary *d, const char *name, int width) var_clear_short_name (v); v->aux = NULL; v->aux_dtor = NULL; + v->obs_vals = NULL; /* Update dictionary. */ if (d->var_cnt >= d->var_cap) @@ -471,6 +473,7 @@ dict_delete_var (struct dictionary *d, struct variable *v) /* Free memory. */ val_labs_destroy (v->val_labs); + cat_stored_values_destroy (v); free (v->label); free (v); } diff --git a/src/var.h b/src/var.h index ae81fa8c..2219dfb3 100644 --- a/src/var.h +++ b/src/var.h @@ -24,7 +24,7 @@ #include #include "config.h" #include - +#include "cat.h" #include "format.h" #include "missing-values.h" @@ -74,6 +74,11 @@ struct variable /* Each command may use these fields as needed. */ void *aux; void (*aux_dtor) (struct variable *); + + /* Values of a categorical variable which. Procedures need + vectors with binary entries, so any variable of type ALPHA will + have its values stored here. */ + struct cat_vals *obs_vals; }; /* Variable names. */