projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't crash if all categorical variables are empty
[pspp-builds.git]
/
src
/
math
/
categoricals.c
diff --git
a/src/math/categoricals.c
b/src/math/categoricals.c
index d0762831a9b22e8c2766fbbd0010105be5601136..b1f0ce84d9a397bdca0c71062dab79988d9eef0f 100644
(file)
--- a/
src/math/categoricals.c
+++ b/
src/math/categoricals.c
@@
-104,9
+104,7
@@
categoricals_dump (const struct categoricals *cat)
struct hmap_node *node ;
int x;
struct hmap_node *node ;
int x;
- printf ("\n%s (%d) CC=%g:\n", var_get_name (vp->var), vp->base_subscript, vp->cc);
-
- assert (vp->reverse_value_map);
+ printf ("\n%s (%d) CC=%g n_cats=%d:\n", var_get_name (vp->var), vp->base_subscript, vp->cc, vp->n_cats);
printf ("Reverse map\n");
for (x = 0 ; x < vp->n_cats; ++x)
printf ("Reverse map\n");
for (x = 0 ; x < vp->n_cats; ++x)
@@
-215,7
+213,7
@@
categoricals_update (struct categoricals *cat, const struct ccase *c)
node->cc = 0.0;
hmap_insert (&cat->vp[i].map, &node->node, hash);
node->cc = 0.0;
hmap_insert (&cat->vp[i].map, &node->node, hash);
- cat->n_cats_total
++;
+ cat->n_cats_total++;
node->subscript = cat->vp[i].n_cats++ ;
}
node->subscript = cat->vp[i].n_cats++ ;
}