/**************************/ /* Type definitions Tree2 */ /**************************/ /***************/ /* Basic types */ /***************/ typedef char Boolean, *String; /*********/ /* Items */ /*********/ typedef union _attribute_value { DiscrValue _discr_val; float _cont_val; } AttValue, *Description; typedef Description ItemRec; #define CVal(Case,Attribute) Case[Attribute]._cont_val /* Value of the continuous Attribute of ItemRec Case */ #define DVal(Case,Attribute) Case[Attribute]._discr_val /* Value of the discrete Attribute of ItemRec Case */ /*****************************************************/ /* Types for constructing the optimal interval split */ /*****************************************************/ /* Segment of an interval split*/ typedef struct _segment { ItemCount Freq, Error; float Threshold; /* lefthand threshold, included in the segment */ ClassNo BestClass; /* class of the segment */ } Segment; /* An interval split */ typedef struct _intervals { ItemCount Freq, Error; ClassNo BestClass; int NoIntervals; Segment *Split; /* Split[0..NoIntervals], Split[0] contains the information on unknown attribute values */ } IntervalSplit; /* All possible interval splits */ typedef IntervalSplit ***AllIntervals; /* IntSpl[c1][k][c2] denotes the optimal split into k intervals such that the leftmost interval has class c1 and the rightmost interval has class c2 */ /* List of AllIntervals */ /* A proper AllList is sorted on the */ typedef struct _l_record *AllList; /* y-values and no y-value appears */ typedef struct _l_record /* twice in an AllList. The last element of */ { /* an AllList has y-value Infinity. */ float y_val; /* y-value */ AllIntervals allint_L; /* Splits of the */ AllIntervals allint_U; /* x-value */ AllList next; } ALRecord; /* List of AllLists */ /* A proper Superlist is sorted */ typedef struct _sl_record *SuperList; /* on the x-values of its AllLists, */ typedef struct _sl_record /* and the x-values of two AllLists in */ { /* the SuperList are distinct. */ AllList alllist; SuperList next; } SLRecord; /* List of items */ typedef struct _il_record *ItemList; typedef struct _il_record { ItemRec item; ItemList next; } ILRecord;