From: John Darrington Date: Sat, 9 Jul 2011 07:53:53 +0000 (+0200) Subject: QUICK CLUSTER: Add MISSING=EXCLUDE for consistency with other commands X-Git-Tag: v0.7.9~219 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba1e1587fc7d5e6851a7eb9f9e8d7956dca0f936;p=pspp-builds.git QUICK CLUSTER: Add MISSING=EXCLUDE for consistency with other commands --- 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; }