New module src/math/categoricals .
[pspp-builds.git] / src / math / categoricals.h
1 #ifndef _CATEGORICALS__
2 #define _CATEGORICALS__
3
4 #include <stddef.h>
5
6 struct categoricals;
7 struct variable;
8 struct ccase;
9
10 union value ;
11
12 struct categoricals *categoricals_create (const struct variable **v, size_t n_vars,
13                                           const struct variable *wv);
14
15 void categoricals_update (struct categoricals *cat, const struct ccase *c);
16
17
18 /* Return the number of categories (distinct values) for variable N */
19 size_t categoricals_n_count (const struct categoricals *cat, size_t n);
20
21
22 /* Return the total number of categories */
23 size_t categoricals_total (const struct categoricals *cat);
24
25 /* Return the index for variable N */
26 int categoricals_index (const struct categoricals *cat, size_t n, const union value *val);
27
28 #endif