GLM: Rewrite interactions module and update glm.c to use it in some places
[pspp] / src / math / interaction.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2011 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17
18 #ifndef _INTERACTION_H__
19 #define _INTERACTION_H__ 1
20
21 #include <stdbool.h>
22 #include "data/missing-values.h"
23
24 struct interaction;
25 struct variable;
26 struct string;
27
28 #include <stddef.h>
29 struct interaction
30 {
31   size_t n_vars;
32   const struct variable **vars;
33 };
34
35
36
37 struct interaction * interaction_create (const struct variable *);
38 void interaction_destroy (struct interaction *);
39 void interaction_add_variable (struct interaction *, const struct variable *);
40 void interaction_dump (const struct interaction *);
41 void interaction_to_string (const struct interaction *iact, struct string *str);
42
43
44 union value;
45
46 unsigned int interaction_value_hash (const struct interaction *, const union value *);
47 bool interaction_value_equal (const struct interaction *, const union value *, const union value *);
48 bool interaction_value_is_missing (const struct interaction *, const union value *, enum mv_class);
49
50 #endif