Added a function to clone an interaction.
[pspp-builds.git] / 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 struct interaction * interaction_create (const struct variable *);
36 struct interaction * interaction_clone (const struct interaction *);
37 void interaction_destroy (struct interaction *);
38 void interaction_add_variable (struct interaction *, const struct variable *);
39 void interaction_dump (const struct interaction *);
40 void interaction_to_string (const struct interaction *iact, struct string *str);
41 bool interaction_is_proper_subset (const struct interaction *x, const struct interaction *y);
42 bool interaction_is_subset (const struct interaction *x, const struct interaction *y);
43
44
45 struct ccase;
46 unsigned int interaction_case_hash (const struct interaction *, const struct ccase *, unsigned int base);
47 bool interaction_case_equal (const struct interaction *, const struct ccase *, const struct ccase *);
48 bool interaction_case_is_missing (const struct interaction *, const struct ccase *, enum mv_class);
49 int interaction_case_cmp_3way (const struct interaction *, const struct ccase *, const struct ccase *);
50
51
52 #endif