pspp_coeff_var_to_coeff: Guard against a null pointer in coefs[i]->v_info.
[pspp-builds.git] / src / math / linreg.h
index 3a0b3694d65838901b8e8bd6135376c2f3173ee7..5a5c4c8eb3e8db543b1db068ae5670dd6f62f1da 100644 (file)
@@ -96,10 +96,10 @@ struct pspp_linreg_cache_struct
                                   coefficient here. */
 
   /*
-     The variable struct is ignored during estimation. It is here so
-     the calling procedure can find the variable used in the model.
+    Pointers to the variables.
    */
   const struct variable *depvar;
+  const struct variable **indep_vars;
 
   gsl_vector *residuals;
   struct pspp_coeff **coeff;
@@ -176,7 +176,8 @@ typedef struct pspp_linreg_cache_struct pspp_linreg_cache;
   to it. n is the number of cases, p is the number of
   independent variables.
  */
-pspp_linreg_cache *pspp_linreg_cache_alloc (size_t n, size_t p);
+pspp_linreg_cache *pspp_linreg_cache_alloc (const struct variable *, const struct variable **, 
+                                           size_t, size_t);
 
 bool pspp_linreg_cache_free (void *);
 
@@ -198,7 +199,7 @@ pspp_linreg_residual (const struct variable **, const union value **,
 /*
   All variables used in the model.
  */
-int pspp_linreg_get_vars (const void *, const struct variable **);
+int pspp_linreg_get_vars (const void *, struct variable **);
 
 struct pspp_coeff *pspp_linreg_get_coeff (const pspp_linreg_cache
                                                       *,