added function to retrieve variable list used in linear model
[pspp-builds.git] / src / math / linreg / linreg.h
index 67a422ea3fcaed0ab7497606b7f0920929de9496..f0141f809f47f8c72638861197f583da7292a1a9 100644 (file)
@@ -42,8 +42,6 @@ enum
  */
 struct pspp_linreg_opts_struct
 {
-  int resid;                   /* Should the residuals be returned? */
-
   int get_depvar_mean_std;
   int *get_indep_mean_std;     /* Array of booleans
                                   dictating which
@@ -165,6 +163,13 @@ struct pspp_linreg_cache_struct
                      const union value **,
                      const union value *,
                      const void *, int);
+  /*
+    Returns pointers to the variables used in the model.
+   */
+  int (*get_vars) (const void *, struct variable **);
+  struct variable *resid;
+  struct variable *pred;
+
 };
 
 typedef struct pspp_linreg_cache_struct pspp_linreg_cache;
@@ -178,7 +183,7 @@ typedef struct pspp_linreg_cache_struct pspp_linreg_cache;
  */
 pspp_linreg_cache *pspp_linreg_cache_alloc (size_t n, size_t p);
 
-bool pspp_linreg_cache_free (pspp_linreg_cache * c);
+bool pspp_linreg_cache_free (void *);
 
 /*
   Fit the linear model via least squares. All pointers passed to pspp_linreg
@@ -195,4 +200,8 @@ pspp_linreg_predict (const struct variable **, const union value **,
 double
 pspp_linreg_residual (const struct variable **, const union value **,
                      const union value *, const void *, int);
+/*
+  All variables used in the model.
+ */
+int pspp_linreg_get_vars (const void *, struct variable **);
 #endif