Tidying types
authorJason Stover <jhs@math.gcsu.edu>
Mon, 9 Jan 2006 00:53:31 +0000 (00:53 +0000)
committerJason Stover <jhs@math.gcsu.edu>
Mon, 9 Jan 2006 00:53:31 +0000 (00:53 +0000)
src/cat.c
src/design-matrix.h

index c4bd17a85d16d459f0da83cff9458edc3e892ba3..9b8ed9661d6c0e3fb8c60c85d8cf561be47df864 100644 (file)
--- a/src/cat.c
+++ b/src/cat.c
@@ -130,3 +130,13 @@ cat_subscript_to_value (const size_t s, struct variable *v)
       return NULL;
     }
 }
+
+/*
+  Return the number of categories of a categorical variable.
+ */
+size_t 
+cat_get_n_categories (const struct variable *v)
+{
+  return v->obs_vals->n_categories;
+}
+
index 55e4c73cbcfc54384ecd7bd499097baa5709997a..8cd8195c41bbd90eac949433290db1c2841ffc80 100644 (file)
@@ -30,7 +30,7 @@
 #include "cat-routines.h"
 struct design_matrix_var
 {
-  int first_column;            /* First column for this variable in
+  size_t first_column;         /* First column for this variable in
                                   the design_matix. If this variable
                                   is categorical, its values are
                                   stored in multiple, contiguous
@@ -38,7 +38,7 @@ struct design_matrix_var
                                   encoding in the variable's struct
                                   cat_vals.
                                 */
-  int last_column;
+  size_t last_column;
   const struct variable *v;
 };
 struct design_matrix