- union value value; /* The value being labeled. */
- double cc; /* The total of the weights of cases with this value */
- int subscript; /* A zero based integer, unique within the variable.
- Can be used as an index into an array */
+
+ union value val; /* The value */
+
+ int index; /* A zero based unique index for this value */
+};
+
+struct interaction_value
+{
+ struct hmap_node node; /* Node in hash map */
+
+ struct ccase *ccase; /* A case (probably the first in the dataset) which matches this value */
+
+ double cc; /* Total of the weights of cases matching this interaction */
+
+ void *user_data; /* A pointer to data which the caller can store stuff */
+};
+
+static struct value_node *
+lookup_value (const struct hmap *map, const union value *val, unsigned int hash, int width)
+{
+ struct value_node *vn = NULL;
+ HMAP_FOR_EACH_WITH_HASH (vn, struct value_node, node, hash, map)
+ {
+ if (value_equal (&vn->val, val, width))
+ break;
+ }
+
+ return vn;
+}
+
+struct variable_node
+{
+ struct hmap_node node; /* Node in hash map. */
+ const struct variable *var; /* The variable */
+
+ struct hmap valmap; /* A map of value nodes */
+ int n_vals; /* Number of values for this variable */