home *** CD-ROM | disk | FTP | other *** search
/ vis-ftp.cs.umass.edu / vis-ftp.cs.umass.edu.tar / vis-ftp.cs.umass.edu / pub / Software / ASCENDER / umass_foa.tar / mdt_NEW / mdtree / mdtree.h < prev    next >
C/C++ Source or Header  |  1995-01-30  |  2KB  |  55 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <fcntl.h>
  5. #include <sys/types.h>                /* for data types */
  6. #include <sys/stat.h>
  7. #include <errno.h>                    /* for error messages */
  8. #include <limits.h>
  9.  
  10. #define num_feat 4                       /* # features */
  11. #define large_num 10.0e+6                /* large number, for cov matrix diagonal init */
  12. #define small_num 0.000005               /* a small number, for fudge factor in comparision */
  13. #define non_class 9999                   /* flag for node that is a test & not a class */
  14. #define min_set_size 8                   /* min set size to stop further division */
  15. #define t_f_ratio 5                      /* true to false ratio for deciding non-partitionable data */
  16.  
  17.  
  18. #define num_actual 90160
  19. #define MAX(A, B) ((A) > (B) ? (A) : (B))
  20. #define MIN(A, B) ((A) < (B) ? (A) : (B))
  21.  
  22. #define LUT_file "LUT.dat"
  23. #define RGB_min 0                    /* min-max for pixels values -- better to avoid */
  24. #define RGB_max 255                  /* highest and lowest values due to specularities */
  25. #define iRange (RGB_max-RGB_min)     /* clipping and blooming */
  26.  
  27. #define CHAR_SIZE 8                  /* num bits in a char -- for LUT compaction */
  28.  
  29. typedef short int feat_vect[num_feat];
  30. typedef double LTU_vect [num_feat];       /* data type for the feature/ weight vectors */
  31. typedef double LTU_vect_sqr [num_feat][num_feat]; /* data type for covariance matrix */
  32. typedef short int RGB_LUT[iRange][iRange][iRange];
  33.  
  34. struct instance {                        /* an instance -- contains: */
  35.   double feat[num_feat];                    /*         - a feature vector, */
  36.   short int known_class;                       /*         - the known class, */
  37.   short int LTU_class;                         /*         - the estimated class */
  38. };
  39.  
  40. struct tree_node {                       /* a tree node -- contains: */
  41.   LTU_vect weight_vect;                  /*        - weight vector, if test */
  42.   int node_class;                        /*        - class, if non-test */
  43.   struct tree_node *pos;                 /*        - ptr to +ve subtree */
  44.   struct tree_node *neg;                 /*        - ptr to -ve subtree */
  45. };
  46.  
  47. int loop=0;                     /* global loop var */
  48. int done=0;                     /* flag: if no further sub-division is possible */
  49.  
  50. int min_reg_size;
  51. int tot_count=0;
  52. int LUT_ret_class;
  53.  
  54.  
  55.