projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
oneway.c: Use the categoricals struct to calculate number of groups
[pspp]
/
src
/
language
/
stats
/
oneway.c
diff --git
a/src/language/stats/oneway.c
b/src/language/stats/oneway.c
index f481c69dc13c765cfd55cbc346ca2089a15df7f2..e88a9542ecd33855f4370c6b10cd76a8ef86ffc0 100644
(file)
--- a/
src/language/stats/oneway.c
+++ b/
src/language/stats/oneway.c
@@
-400,17
+400,13
@@
run_oneway (const struct oneway_spec *cmd,
struct ccase *c;
struct oneway_workspace ws;
struct ccase *c;
struct oneway_workspace ws;
-
- {
- ws.vws = xmalloc (cmd->n_vars * sizeof (*ws.vws));
- ws.dd_total = xmalloc (sizeof (struct descriptive_data) * cmd->n_vars);
+ ws.actual_number_of_groups = 0;
+ ws.vws = xmalloc (cmd->n_vars * sizeof (*ws.vws));
+ ws.dd_total = xmalloc (sizeof (struct descriptive_data) * cmd->n_vars);
- for (v = 0 ; v < cmd->n_vars; ++v)
- {
- ws.dd_total[v] = dd_create (cmd->vars[v]);
- }
- }
+ for (v = 0 ; v < cmd->n_vars; ++v)
+ ws.dd_total[v] = dd_create (cmd->vars[v]);
for (v = 0; v < cmd->n_vars; ++v)
{
for (v = 0; v < cmd->n_vars; ++v)
{
@@
-565,11
+561,15
@@
run_oneway (const struct oneway_spec *cmd,
postcalc (cmd);
postcalc (cmd);
+
for (v = 0; v < cmd->n_vars; ++v)
{
struct categoricals *cats = covariance_get_categoricals (ws.vws[v].cov);
categoricals_done (cats);
for (v = 0; v < cmd->n_vars; ++v)
{
struct categoricals *cats = covariance_get_categoricals (ws.vws[v].cov);
categoricals_done (cats);
+
+ if (categoricals_total (cats) > ws.actual_number_of_groups)
+ ws.actual_number_of_groups = categoricals_total (cats);
}
if ( cmd->stats & STATS_HOMOGENEITY )
}
if ( cmd->stats & STATS_HOMOGENEITY )
@@
-578,8
+578,6
@@
run_oneway (const struct oneway_spec *cmd,
casereader_destroy (input);
casereader_destroy (input);
- ws.actual_number_of_groups = hsh_count (ws.group_hash);
-
if (!taint_has_tainted_successor (taint))
output_oneway (cmd, &ws);
if (!taint_has_tainted_successor (taint))
output_oneway (cmd, &ws);