X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fquick-cluster.c;h=bc66cce795caf06932ed3da6269b306bd0a6cd52;hb=6da9ed01e15953f12bc1ba35fbee53a7a7e46da0;hp=10572cee5e260a8a1590c56742489586741f1053;hpb=3ec4ce83403f756f2c983ca2b5544cb1dcf9dfe0;p=pspp diff --git a/src/language/stats/quick-cluster.c b/src/language/stats/quick-cluster.c index 10572cee5e..bc66cce795 100644 --- a/src/language/stats/quick-cluster.c +++ b/src/language/stats/quick-cluster.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2011 Free Software Foundation, Inc. + Copyright (C) 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -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++; @@ -389,11 +390,10 @@ static void quick_cluster_show_centers (struct Kmeans *kmeans, bool initial, const struct qc *qc) { struct tab_table *t; - int nc, nr, heading_columns, currow; + int nc, nr, currow; int i, j; nc = qc->ngroups + 1; nr = qc->n_vars + 4; - heading_columns = 1; t = tab_create (nc, nr); tab_headers (t, 0, nc - 1, 0, 1); currow = 0; @@ -528,6 +528,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; }