From ba1e1587fc7d5e6851a7eb9f9e8d7956dca0f936 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 9 Jul 2011 09:53:53 +0200 Subject: [PATCH] QUICK CLUSTER: Add MISSING=EXCLUDE for consistency with other commands --- src/language/stats/quick-cluster.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/language/stats/quick-cluster.c b/src/language/stats/quick-cluster.c index 10572cee..e6987f4b 100644 --- a/src/language/stats/quick-cluster.c +++ b/src/language/stats/quick-cluster.c @@ -227,11 +227,12 @@ kmeans_recalculate_centers (struct Kmeans *kmeans, const struct casereader *read { const union value *val = case_data (c, qc->vars[v]); double x = val->f * weight; + double curval; if ( var_is_value_missing (qc->vars[v], val, qc->exclude)) continue; - double curval = gsl_matrix_get (kmeans->centers, index, v); + curval = gsl_matrix_get (kmeans->centers, index, v); gsl_matrix_set (kmeans->centers, index, v, curval + x); } i++; @@ -528,6 +529,10 @@ cmd_quick_cluster (struct lexer *lexer, struct dataset *ds) { qc.exclude = MV_SYSTEM; } + else if (lex_match_id (lexer, "EXCLUDE")) + { + qc.exclude = MV_ANY; + } else goto error; } -- 2.30.2