Various bug fixes.
[pspp-builds.git] / src / group.h
index 951e58eda4ab02744bafe6d9cf48737150a10746..954418a872af25dadb99378c227d31e19759afb5 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    02111-1307, USA. */
 
+
 #ifndef GROUP_H
 #define GROUP_H
 
-#include "val.h"
-
 
-enum comparison
-  {
-    CMP_LE = -2,
-    CMP_LT = -1,
-    CMP_EQ = 0,
-    CMP_GT = 1,
-    CMP_GE = 2
-  };
+#include "val.h"
 
 
 /* Statistics for grouped data */
@@ -39,11 +31,6 @@ struct group_statistics
     /* The value of the independent variable for this group */
     union value id;
 
-    /* The criterium matching for comparing with id 
-       (applicable only to T-TEST) FIXME: therefore it shouldn't be here
-     */
-    enum comparison criterion;
-
     /* The arithmetic mean */
     double mean;
 
@@ -85,4 +72,20 @@ struct group_statistics
   };
 
 
+
+
+/* These funcs are useful for hash tables */
+
+/* Return -1 if the id of a is less than b; +1 if greater than and 
+   0 if equal */
+int  compare_group(const struct group_statistics *a, 
+                  const struct group_statistics *b, 
+                  int width);
+
+unsigned hash_group(const struct group_statistics *g, int width);
+
+void  free_group(struct group_statistics *v, void *aux);
+
+
+
 #endif