Added pointer to residual variable to linreg cache
[pspp] / src / math / linreg / linreg.c
index 3e299157691c938b578aa4e7d51ba1b8525f4fb9..2945b26d87002f9983d1267d041ca5433ce6ac25 100644 (file)
@@ -116,14 +116,16 @@ pspp_linreg_cache_alloc (size_t n, size_t p)
    */
   c->method = PSPP_LINREG_SWEEP;
   c->predict = pspp_linreg_predict;
-  c->residual = pspp_linreg_residual;
+  c->residual = pspp_linreg_residual; /* The procedure to comput my residuals. */
+  c->resid = NULL; /* The variable storing my residuals. */
 
   return c;
 }
 
 bool
-pspp_linreg_cache_free (pspp_linreg_cache * c)
+pspp_linreg_cache_free (void * m)
 {
+  pspp_linreg_cache *c = m;
   gsl_vector_free (c->indep_means);
   gsl_vector_free (c->indep_std);
   gsl_vector_free (c->ss_indeps);