X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Flinreg.c;h=63d1a0f976ee420ca52b476e67aa85cd94ff4a5e;hb=aaf7e27cbda4b400b6a98360fa7bab08e26c8696;hp=e74646b97145b44720a2419b3bf5ff0a1f64cc1d;hpb=5f68c60b8283f6a410de20f927e9b12792ea58b3;p=pspp diff --git a/src/math/linreg.c b/src/math/linreg.c index e74646b971..63d1a0f976 100644 --- a/src/math/linreg.c +++ b/src/math/linreg.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2010 Free Software Foundation, Inc. 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 @@ -74,6 +74,7 @@ linreg_alloc (const struct variable *depvar, const struct variable **indep_vars, c = xmalloc (sizeof (*c)); c->depvar = depvar; c->indep_vars = xnmalloc (p, sizeof (*indep_vars)); + c->dependent_column = p; for (i = 0; i < p; i++) { c->indep_vars[i] = indep_vars[i]; @@ -375,7 +376,7 @@ linreg_fit (const gsl_matrix *cov, linreg *l) gsl_matrix *params; params = gsl_matrix_calloc (cov->size1, cov->size2); gsl_matrix_memcpy (params, cov); - reg_sweep (params); + reg_sweep (params, l->dependent_column); post_sweep_computations (l, params); gsl_matrix_free (params); }