From 98780edcc33b536d75b5ce3a55b8f2d1a363d99c Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 22 Jul 2011 15:03:10 +0200 Subject: [PATCH] Move call to categoricals_done earlier in the covariance code --- src/language/stats/glm.c | 2 -- src/math/covariance.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/language/stats/glm.c b/src/language/stats/glm.c index 8e3b07f4..1eaf1a98 100644 --- a/src/language/stats/glm.c +++ b/src/language/stats/glm.c @@ -427,8 +427,6 @@ run_glm (struct glm_spec *cmd, struct casereader *input, } casereader_destroy (reader); - categoricals_done (ws.cats); - for (reader = input; (c = casereader_read (reader)) != NULL; case_unref (c)) { diff --git a/src/math/covariance.c b/src/math/covariance.c index b37da3d2..f64e89d1 100644 --- a/src/math/covariance.c +++ b/src/math/covariance.c @@ -347,6 +347,9 @@ covariance_accumulate_pass2 (struct covariance *cov, const struct ccase *c) assert (cov->state == 1); cov->state = 2; + if (cov->categoricals) + categoricals_done (cov->categoricals); + cov->dim = cov->n_vars; if (cov->categoricals) @@ -362,9 +365,6 @@ covariance_accumulate_pass2 (struct covariance *cov, const struct ccase *c) cov->moments[i] = resize_matrix (cov->moments[i], cov->dim); } - // if (cov->categoricals) - // categoricals_done (cov->categoricals); - /* Populate the moments matrices with the categorical value elements */ for (i = cov->n_vars; i < cov->dim; ++i) { -- 2.30.2