1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2009 Free Software Foundation, Inc.
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.
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.
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/>. */
18 #ifndef _CATEGORICALS__
19 #define _CATEGORICALS__
22 #include <data/missing-values.h>
30 struct categoricals *categoricals_create (const struct variable **v, size_t n_vars,
31 const struct variable *wv, enum mv_class exclude);
33 void categoricals_destroy (struct categoricals *);
35 void categoricals_update (struct categoricals *cat, const struct ccase *c);
38 /* Return the number of categories (distinct values) for variable N */
39 size_t categoricals_n_count (const struct categoricals *cat, size_t n);
42 /* Return the total number of categories */
43 size_t categoricals_total (const struct categoricals *cat);
45 /* Return the index for variable N */
46 int categoricals_index (const struct categoricals *cat, size_t n, const union value *val);
48 void categoricals_done (struct categoricals *cat);
50 const struct variable * categoricals_get_variable_by_subscript (const struct categoricals *cat, int subscript);
52 const union value * categoricals_get_value_by_subscript (const struct categoricals *cat, int subscript);
54 double categoricals_get_binary_by_subscript (const struct categoricals *cat, int subscript,
55 const struct ccase *c);