X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Flinreg%2Fpredict.c;h=876b2d863478d81a598dcdb4695985e9237bb5de;hb=60401d43dd6915c6eaa0fc6cf01fd361dcc323d1;hp=6562d321e6c18e465c4aab41b0e396b88ac69fc9;hpb=2e5ba1599578af2f13aa483db3ee49d591aed42f;p=pspp-builds.git diff --git a/src/math/linreg/predict.c b/src/math/linreg/predict.c index 6562d321..876b2d86 100644 --- a/src/math/linreg/predict.c +++ b/src/math/linreg/predict.c @@ -1,23 +1,20 @@ -/* - lib/linreg/predict.c - +/* PSPP - a program for statistical analysis. Copyright (C) 2005 Free Software Foundation, Inc. Written by Jason H. Stover. - This program is free software; you can redistribute it and/or modify it under - the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program; if not, write to the Free Software Foundation, Inc., 51 - Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. - */ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ +#include #include #include #include @@ -35,8 +32,8 @@ pspp_linreg_predict (const struct variable **predictors, const pspp_linreg_cache *c = c_; int i; int j; - const struct pspp_linreg_coeff **found; - const struct pspp_linreg_coeff *coe; + const struct pspp_coeff **found; + const struct pspp_coeff *coe; double result; double tmp; @@ -69,8 +66,8 @@ pspp_linreg_predict (const struct variable **predictors, if (i < c->n_coeffs) { found[i] = coe; - tmp = pspp_linreg_coeff_get_est (coe); - if (predictors[j]->type == NUMERIC) + tmp = pspp_coeff_get_est (coe); + if (var_is_numeric (predictors[j])) { tmp *= vals[j]->f; }