From: John Darrington Date: Mon, 28 Nov 2011 20:27:41 +0000 (+0100) Subject: categoricals.c: Rename function to more accurately reflect its purpose X-Git-Tag: v0.7.9~70 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2414a9e37882fd23d9e50f916bb9e6a7cc2f6bad;p=pspp-builds.git categoricals.c: Rename function to more accurately reflect its purpose --- diff --git a/src/math/categoricals.c b/src/math/categoricals.c index af79023a..2ec1dc19 100644 --- a/src/math/categoricals.c +++ b/src/math/categoricals.c @@ -561,7 +561,7 @@ categoricals_done (const struct categoricals *cat_) struct interaction_value *iv = iap->reverse_interaction_value_map[y]; for (x = iap->base_subscript_short; x < iap->base_subscript_short + df ;++x) { - const double bin = categoricals_get_binary_by_subscript (cat, x, iv->ccase); \ + const double bin = categoricals_get_code_for_case (cat, x, iv->ccase); \ iap->enc_sum [x - iap->base_subscript_short] += bin * iv->cc; } } @@ -620,8 +620,7 @@ categoricals_get_sum_by_subscript (const struct categoricals *cat, int subscript /* Returns unity if the value in case C at SUBSCRIPT is equal to the category for that subscript */ double -categoricals_get_binary_by_subscript (const struct categoricals *cat, - int subscript, +categoricals_get_code_for_case (const struct categoricals *cat, int subscript, const struct ccase *c) { const struct interaction *iact = categoricals_get_interaction_by_subscript (cat, subscript); diff --git a/src/math/categoricals.h b/src/math/categoricals.h index 91767270..ec708efa 100644 --- a/src/math/categoricals.h +++ b/src/math/categoricals.h @@ -86,8 +86,7 @@ const struct interaction *categoricals_get_interaction_by_subscript (const struc double categoricals_get_sum_by_subscript (const struct categoricals *cat, int subscript); -double categoricals_get_binary_by_subscript (const struct categoricals *cat, int subscript, - const struct ccase *c); +double categoricals_get_code_for_case (const struct categoricals *cat, int subscript, const struct ccase *c); /* These use the long map. Useful for descriptive statistics. */ diff --git a/src/math/covariance.c b/src/math/covariance.c index 9bc8eb72..2f4f525a 100644 --- a/src/math/covariance.c +++ b/src/math/covariance.c @@ -268,7 +268,7 @@ get_val (const struct covariance *cov, int i, const struct ccase *c) return val->f; } - return categoricals_get_binary_by_subscript (cov->categoricals, i - cov->n_vars, c); + return categoricals_get_code_for_case (cov->categoricals, i - cov->n_vars, c); } #if 0