39 #define PROTO_INCREMENT 32 40 #define CONFIG_INCREMENT 16 118 for (Bit = Class->
NumProtos; Bit < NewNumProtos; Bit++)
124 tprintf(
"Ouch! number of protos = %d, vs max of %d!",
141 float TotalLength = 0;
143 for (Pid = 0; Pid < Class->
NumProtos; Pid++) {
146 TotalLength += (
ProtoIn (Class, Pid))->Length;
149 return (TotalLength);
162 float TotalLength = 0;
164 for (Pid = 0; Pid < Class->
NumProtos; Pid++) {
165 TotalLength += (
ProtoIn (Class, Pid))->Length;
167 return (TotalLength);
196 float Slope, Intercept, Normalizer;
198 Slope = tan(Proto->
Angle * 2.0 * M_PI);
199 Intercept = Proto->
Y - Slope * Proto->
X;
200 Normalizer = 1.0 / sqrt (Slope * Slope + 1.0);
201 Proto->
A = Slope * Normalizer;
202 Proto->
B = -Normalizer;
203 Proto->
C = Intercept * Normalizer;
272 for (Pid = 0; Pid < Class->
NumProtos; Pid++) {
void FreeClassFields(CLASS_TYPE Class)
float ClassConfigLength(CLASS_TYPE Class, BIT_VECTOR Config)
void cprintf(const char *format,...)
#define STRING_VAR(name, val, comment)
#define WordsInVectorOfSize(NumBits)
CLASS_STRUCT TrainingData[NUMBER_OF_CLASSES]
#define zero_all_bits(array, length)
void PrintProtos(CLASS_TYPE Class)
void FreeBitVector(BIT_VECTOR BitVector)
#define ProtoIn(Class, Pid)
void FreeClass(CLASS_TYPE Class)
float ClassProtoLength(CLASS_TYPE Class)
BIT_VECTOR NewBitVector(int NumBits)
int AddProtoToClass(CLASS_TYPE Class)
#define NUMBER_OF_CLASSES
int AddConfigToClass(CLASS_TYPE Class)
DLLSYM void tprintf(const char *format,...)
void CopyProto(PROTO Src, PROTO Dest)
BIT_VECTOR ExpandBitVector(BIT_VECTOR Vector, int NewNumBits)
#define PrintProtoLine(Proto)
void FillABC(PROTO Proto)
#define reset_bit(array, bit)
void * Erealloc(void *ptr, int size)
CLASS_TYPE NewClass(int NumProtos, int NumConfigs)
#define PrintProto(Proto)
#define test_bit(array, bit)
char * classify_training_file