X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Froc.c;h=d1461a599f0724471a37aaf41a1120c336670f52;hb=6ccced652fb274a08361fb844fb1c435a4c654d1;hp=1f2691d8919e01eac157688d053f218c426581af;hpb=7c08a6e1009cf60847e770a77a73c650e9326379;p=pspp-builds.git diff --git a/src/language/stats/roc.c b/src/language/stats/roc.c index 1f2691d8..d1461a59 100644 --- a/src/language/stats/roc.c +++ b/src/language/stats/roc.c @@ -18,28 +18,24 @@ #include -#include -#include -#include -#include -#include - #include #include #include #include #include -#include +#include #include - - +#include +#include +#include +#include #include +#include +#include +#include +#include #include -#include - -#include -#include #include "gettext.h" #define _(msgid) gettext (msgid) @@ -51,7 +47,7 @@ struct cmd_roc const struct variable **vars; const struct dictionary *dict; - const struct variable *state_var ; + const struct variable *state_var; union value state_value; /* Plot the roc curve */ @@ -97,7 +93,9 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) roc.pos = roc.pos_weighted = 0; roc.neg = roc.neg_weighted = 0; roc.dict = dataset_dict (ds); + roc.state_var = NULL; + lex_match (lexer, '/'); if (!parse_variables_const (lexer, dict, &roc.vars, &roc.n_vars, PV_APPEND | PV_NO_DUPLICATE | PV_NUMERIC)) goto error; @@ -279,7 +277,8 @@ cmd_roc (struct lexer *lexer, struct dataset *ds) return CMD_SUCCESS; error: - value_destroy (&roc.state_value, var_get_width (roc.state_var)); + if ( roc.state_var) + value_destroy (&roc.state_value, var_get_width (roc.state_var)); free (roc.vars); return CMD_FAILURE; } @@ -939,7 +938,6 @@ show_auc (struct roc_state *rs, const struct cmd_roc *roc) tab_headers (tbl, n_cols - n_fields, 0, 1, 0); - tab_dim (tbl, tab_natural_dimensions, NULL, NULL); tab_text (tbl, n_cols - n_fields, 1, TAT_TITLE, _("Area")); @@ -1031,8 +1029,6 @@ show_summary (const struct cmd_roc *roc) tab_headers (tbl, 1, 0, 2, 0); - tab_dim (tbl, tab_natural_dimensions, NULL, NULL); - tab_box (tbl, TAL_2, TAL_2, -1, -1, @@ -1093,8 +1089,6 @@ show_coords (struct roc_state *rs, const struct cmd_roc *roc) tab_headers (tbl, 1, 0, 1, 0); - tab_dim (tbl, tab_natural_dimensions, NULL, NULL); - tab_hline (tbl, TAL_2, 0, n_cols - 1, 1); if ( roc->n_vars > 1) @@ -1171,7 +1165,7 @@ output_roc (struct roc_state *rs, const struct cmd_roc *roc) for (i = 0; i < roc->n_vars; i++) roc_chart_add_var (rc, var_get_name (roc->vars[i]), rs[i].cutpoint_rdr); - chart_submit (roc_chart_get_chart (rc)); + roc_chart_submit (rc); } show_auc (rs, roc);