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 >
Wrap
C/C++ Source or Header
|
1995-01-30
|
2KB
|
55 lines
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <fcntl.h>
#include <sys/types.h> /* for data types */
#include <sys/stat.h>
#include <errno.h> /* for error messages */
#include <limits.h>
#define num_feat 4 /* # features */
#define large_num 10.0e+6 /* large number, for cov matrix diagonal init */
#define small_num 0.000005 /* a small number, for fudge factor in comparision */
#define non_class 9999 /* flag for node that is a test & not a class */
#define min_set_size 8 /* min set size to stop further division */
#define t_f_ratio 5 /* true to false ratio for deciding non-partitionable data */
#define num_actual 90160
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define LUT_file "LUT.dat"
#define RGB_min 0 /* min-max for pixels values -- better to avoid */
#define RGB_max 255 /* highest and lowest values due to specularities */
#define iRange (RGB_max-RGB_min) /* clipping and blooming */
#define CHAR_SIZE 8 /* num bits in a char -- for LUT compaction */
typedef short int feat_vect[num_feat];
typedef double LTU_vect [num_feat]; /* data type for the feature/ weight vectors */
typedef double LTU_vect_sqr [num_feat][num_feat]; /* data type for covariance matrix */
typedef short int RGB_LUT[iRange][iRange][iRange];
struct instance { /* an instance -- contains: */
double feat[num_feat]; /* - a feature vector, */
short int known_class; /* - the known class, */
short int LTU_class; /* - the estimated class */
};
struct tree_node { /* a tree node -- contains: */
LTU_vect weight_vect; /* - weight vector, if test */
int node_class; /* - class, if non-test */
struct tree_node *pos; /* - ptr to +ve subtree */
struct tree_node *neg; /* - ptr to -ve subtree */
};
int loop=0; /* global loop var */
int done=0; /* flag: if no further sub-division is possible */
int min_reg_size;
int tot_count=0;
int LUT_ret_class;