X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcategoricals.h;h=5e49b4504ab1b9338c19fe089b861fa8d82a328f;hb=2ba9563cb1fddad9430be0c415dc81456f006281;hp=f427c473b788d854317e47be8e891aabed055a16;hpb=6590347b1a0ed5037743f671ab846813c89f9112;p=pspp diff --git a/src/math/categoricals.h b/src/math/categoricals.h index f427c473b7..5e49b4504a 100644 --- a/src/math/categoricals.h +++ b/src/math/categoricals.h @@ -53,8 +53,8 @@ union value; /* Creating and destroying categoricals. */ struct categoricals *categoricals_create (struct interaction *const *, size_t n, - const struct variable *wv, - enum mv_class fctr_excl); + const struct variable *wv, + enum mv_class fctr_excl); void categoricals_destroy (struct categoricals *); /* Updating categoricals. */ @@ -62,7 +62,7 @@ void categoricals_update (struct categoricals *, const struct ccase *); void categoricals_done (const struct categoricals *); bool categoricals_is_complete (const struct categoricals *); -/* Counting categories. +/* Categories. A variable's number of categories is the number of unique values observed in the data passed to categoricals_update(). @@ -76,6 +76,9 @@ bool categoricals_is_complete (const struct categoricals *); size_t categoricals_n_count (const struct categoricals *, size_t idx); size_t categoricals_n_total (const struct categoricals *); +union value *categoricals_get_var_values (const struct categoricals *, + const struct variable *, size_t *n); + /* Degrees of freedom. A categorical variable with N_CATS categories has N_CATS - 1 degrees of @@ -142,6 +145,9 @@ const struct ccase *categoricals_get_case_by_category_real ( void *categoricals_get_user_data_by_category_real ( const struct categoricals *, int iact, int n); +int categoricals_get_value_index_by_category_real ( + const struct categoricals *, int iact_idx, int cat_idx, int var_idx); + void *categoricals_get_user_data_by_category (const struct categoricals *, int category); const struct ccase *categoricals_get_case_by_category (