From: Jason H Stover Date: Fri, 21 Nov 2008 15:48:57 +0000 (-0500) Subject: pspp_linreg_with_cov: Accept struct covariance_matrix as first argument. X-Git-Tag: v0.7.1~50^2~12 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=0bc7ad7a02ccb75b428dd4ce511986845c2a6c04 pspp_linreg_with_cov: Accept struct covariance_matrix as first argument. rearrange_covariance_matrix: Accept struct covariance_matrix as first argument. --- diff --git a/src/math/linreg.c b/src/math/linreg.c index 48db78a8..a50aa7d8 100644 --- a/src/math/linreg.c +++ b/src/math/linreg.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -661,15 +660,18 @@ void pspp_linreg_set_indep_variable_mean (pspp_linreg_cache *c, const struct var only variables in the model are in the covariance matrix. */ static struct design_matrix * -rearrange_covariance_matrix (const struct design_matrix *cov, pspp_linreg_cache *c) +rearrange_covariance_matrix (const struct covariance_matrix *cm, pspp_linreg_cache *c) { const struct variable **model_vars; + struct design_matrix *cov; struct design_matrix *result; size_t *permutation; size_t i; size_t j; size_t k; + assert (cm != NULL); + cov = covariance_to_design (cm); assert (cov != NULL); assert (c != NULL); assert (cov->m->size1 > 0); @@ -720,7 +722,7 @@ rearrange_covariance_matrix (const struct design_matrix *cov, pspp_linreg_cache set CACHE->N_COEFFS. */ void -pspp_linreg_with_cov (const struct design_matrix *full_cov, +pspp_linreg_with_cov (const struct covariance_matrix *full_cov, pspp_linreg_cache * cache) { struct design_matrix *cov; @@ -732,6 +734,6 @@ pspp_linreg_with_cov (const struct design_matrix *full_cov, cache_init (cache); reg_sweep (cov->m); post_sweep_computations (cache, cov, cov->m); - covariance_matrix_destroy (cov); + design_matrix_destroy (cov); } diff --git a/src/math/linreg.h b/src/math/linreg.h index bab3205f..53f47a61 100644 --- a/src/math/linreg.h +++ b/src/math/linreg.h @@ -21,6 +21,7 @@ #include #include #include +#include enum { @@ -220,5 +221,5 @@ void pspp_linreg_set_indep_variable_mean (pspp_linreg_cache *, const struct vari /* Regression using only the covariance matrix. */ -void pspp_linreg_with_cov (const struct design_matrix *, pspp_linreg_cache *); +void pspp_linreg_with_cov (const struct covariance_matrix *, pspp_linreg_cache *); #endif