X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fstats%2Ffrequencies.q;h=39882e76c527c8d46e51bb708bcb3f7c5bfb6af2;hb=eca977e618f2d4c6d55d9851b9714fd60e55559b;hp=c3b3a497de24d5d03e6d196a3144bd0fab0da5cf;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp-builds.git diff --git a/src/language/stats/frequencies.q b/src/language/stats/frequencies.q index c3b3a497..39882e76 100644 --- a/src/language/stats/frequencies.q +++ b/src/language/stats/frequencies.q @@ -24,35 +24,39 @@ */ #include -#include "message.h" + #include #include #include -#include "alloc.h" -#include "bit-vector.h" -#include "case.h" -#include "dictionary.h" -#include "hash.h" -#include "pool.h" -#include "command.h" -#include "lexer.h" -#include "moments.h" -#include "message.h" -#include "array.h" -#include "magic.h" -#include "misc.h" -#include "output.h" -#include "manager.h" -#include "str.h" -#include "table.h" -#include "value-labels.h" -#include "variable.h" -#include "procedure.h" -#include "settings.h" -#include "piechart.h" -#include "chart.h" -#include "plot-hist.h" +#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 #include "gettext.h" #define _(msgid) gettext (msgid) @@ -60,8 +64,6 @@ /* (headers) */ -#include "debug-print.h" - /* (specification) FREQUENCIES (frq_): *variables=custom; @@ -266,8 +268,8 @@ static void determine_charts (void); static void calc_stats (struct variable *v, double d[frq_n_stats]); -static void precalc (void *); -static bool calc (struct ccase *, void *); +static void precalc (const struct ccase *, void *); +static bool calc (const struct ccase *, void *); static void postcalc (void *); static void postprocess_freq_tab (struct variable *); @@ -493,7 +495,7 @@ determine_charts (void) /* Add data from case C to the frequency table. */ static bool -calc (struct ccase *c, void *aux UNUSED) +calc (const struct ccase *c, void *aux UNUSED) { double weight; size_t i; @@ -548,10 +550,12 @@ calc (struct ccase *c, void *aux UNUSED) /* Prepares each variable that is the target of FREQUENCIES by setting up its hash table. */ static void -precalc (void *aux UNUSED) +precalc (const struct ccase *first, void *aux UNUSED) { size_t i; + output_split_file_values (first); + pool_destroy (gen_pool); gen_pool = pool_create (); @@ -1213,7 +1217,7 @@ dump_full (struct variable *v) } tab_box (t, TAL_1, TAL_1, - cmd.spaces == FRQ_SINGLE ? -1 : (TAL_1 | TAL_SPACING), TAL_1, + cmd.spaces == FRQ_SINGLE ? -1 : TAL_GAP, TAL_1, 0, 0, 4 + lab, r); tab_hline (t, TAL_2, 0, 4 + lab, 2); tab_hline (t, TAL_2, 0, 4 + lab, r); @@ -1223,7 +1227,7 @@ dump_full (struct variable *v) tab_float (t, 2 + lab, r, TAB_NONE, 100.0, 5, 1); tab_float (t, 3 + lab, r, TAB_NONE, 100.0, 5, 1); - tab_title (t, 1, "%s: %s", v->name, v->label ? v->label : ""); + tab_title (t, "%s: %s", v->name, v->label ? v->label : ""); tab_submit (t); } @@ -1233,9 +1237,9 @@ dump_full (struct variable *v) static void condensed_dim (struct tab_table *t, struct outp_driver *d) { - int cum_w = max (outp_string_width (d, _("Cum")), - max (outp_string_width (d, _("Cum")), - outp_string_width (d, "000"))); + int cum_w = max (outp_string_width (d, _("Cum"), OUTP_PROPORTIONAL), + max (outp_string_width (d, _("Cum"), OUTP_PROPORTIONAL), + outp_string_width (d, "000", OUTP_PROPORTIONAL))); int i; @@ -1294,10 +1298,10 @@ dump_condensed (struct variable *v) } tab_box (t, TAL_1, TAL_1, - cmd.spaces == FRQ_SINGLE ? -1 : (TAL_1 | TAL_SPACING), TAL_1, + cmd.spaces == FRQ_SINGLE ? -1 : TAL_GAP, TAL_1, 0, 0, 3, r - 1); tab_hline (t, TAL_2, 0, 3, 2); - tab_title (t, 1, "%s: %s", v->name, v->label ? v->label : ""); + tab_title (t, "%s: %s", v->name, v->label ? v->label : ""); tab_columns (t, SOM_COL_DOWN, 1); tab_submit (t); } @@ -1499,7 +1503,7 @@ dump_statistics (struct variable *v, int show_varname) tab_vline (t, TAL_1 , 2, 0, tab_nr(t) - 1); - tab_vline (t, TAL_1 | TAL_SPACING , 1, 0, tab_nr(t) - 1 ) ; + tab_vline (t, TAL_GAP , 1, 0, tab_nr(t) - 1 ) ; r=2; /* N missing and N valid are always dumped */ @@ -1536,9 +1540,9 @@ dump_statistics (struct variable *v, int show_varname) if (show_varname) { if (v->label) - tab_title (t, 1, "%s: %s", v->name, v->label); + tab_title (t, "%s: %s", v->name, v->label); else - tab_title (t, 0, v->name); + tab_title (t, "%s", v->name); } else tab_flags (t, SOMF_NO_TITLE);