X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Flinreg%2Fpredict.c;h=6ac7167c8d636583024430e62b5b97ab5bcc1a08;hb=17a93d686c5a26be3477b08f878cac491b6f6e17;hp=0bab23c8cd89f0b9bcd66ac6fb1cf69cbce72a7b;hpb=fcd8d5f89fe81347a0e4ab4e5256fb89d6bb61c1;p=pspp-builds.git diff --git a/src/math/linreg/predict.c b/src/math/linreg/predict.c index 0bab23c8..6ac7167c 100644 --- a/src/math/linreg/predict.c +++ b/src/math/linreg/predict.c @@ -31,8 +31,9 @@ double pspp_linreg_predict (const struct variable **predictors, const union value **vals, - const pspp_linreg_cache * c, int n_vals) + const void *c_, int n_vals) { + const pspp_linreg_cache *c = c_; int i; int j; const struct pspp_linreg_coeff **found; @@ -62,7 +63,7 @@ pspp_linreg_predict (const struct variable **predictors, { coe = pspp_linreg_get_coeff (c, predictors[j], vals[j]); i = 1; - while (found[i] != coe && i < c->n_coeffs) + while (found[i] == coe && i < c->n_coeffs) { i++; } @@ -86,7 +87,7 @@ double pspp_linreg_residual (const struct variable **predictors, const union value **vals, const union value *obs, - const pspp_linreg_cache * c, int n_vals) + const void *c, int n_vals) { double pred; double result;