X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Fnpar.q;h=bbccce671f075b161b1e95170d07197c6a3ac69d;hb=b5c82cc9aabe7e641011130240ae1b2e84348e23;hp=34e03677dc9bc145568a910c05a1ea83a063d4e5;hpb=015e221b0f8578afee769528572c76387f26c629;p=pspp-builds.git diff --git a/src/language/stats/npar.q b/src/language/stats/npar.q index 34e03677..bbccce67 100644 --- a/src/language/stats/npar.q +++ b/src/language/stats/npar.q @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. -*-c-*- - Copyright (C) 2006, 2008 Free Software Foundation, Inc. + Copyright (C) 2006, 2008, 2009 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 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -159,7 +160,7 @@ cmd_npar_tests (struct lexer *lexer, struct dataset *ds) test->insert_variables (test, var_hash); } - npar_specs.vv = (const struct variable **) const_hsh_data (var_hash); + npar_specs.vv = (const struct variable **) const_hsh_sort (var_hash); npar_specs.n_vars = const_hsh_count (var_hash); if ( cmd.sbc_statistics ) @@ -356,27 +357,24 @@ npar_custom_binomial (struct lexer *lexer, struct dataset *ds, { lex_force_num (lexer); btp->category1 = lex_number (lexer); - lex_get (lexer); - if ( ! lex_force_match (lexer, ',')) return 2; - if ( ! lex_force_num (lexer) ) return 2; - btp->category2 = lex_number (lexer); - lex_get (lexer); + lex_get (lexer); + if ( lex_match (lexer, ',')) + { + if ( ! lex_force_num (lexer) ) return 2; + btp->category2 = lex_number (lexer); + lex_get (lexer); + } + else + { + btp->cutpoint = btp->category1; + } + lex_force_match (lexer, ')'); } } else return 2; } - else - { - if ( lex_match (lexer, '(') ) - { - lex_force_num (lexer); - btp->cutpoint = lex_number (lexer); - lex_get (lexer); - lex_force_match (lexer, ')'); - } - } specs->n_tests++; specs->test = pool_realloc (specs->pool, @@ -560,8 +558,7 @@ npar_custom_sign (struct lexer *lexer, struct dataset *ds, struct npar_specs *specs = aux; struct two_sample_test *tp = pool_alloc(specs->pool, sizeof(*tp)); - ((struct npar_test *)tp)->execute = NULL; - + ((struct npar_test *) tp)->execute = sign_execute; if (!parse_two_sample_related_test (lexer, dataset_dict (ds), cmd, tp, specs->pool) )