
240 Chapter Six—Neural Network Implementations
Listing 6.9 LVQ main() routine.
void main (int argc, char *argv[])
{
// check command line
if (argc != 2)
{
printf("Usage: exe_file run_file");
exit(1);
}
main_start_up(argv[1]);
LVQ_Main_Loop();
main_clean_up();
}
static void main_start_up (char *dataFile)
{
LVQ_Start_Up(dataFile);
}
static void main_clean_up (void)
{
LVQ_Clean_Up();
}
We now consider the LVQ_Main_Loop() routine. Before running this routine,
we define several LVQ file scope variables.
static LVQ_Type lvq;
static LVQ_Pattern_Set_Type patset;
static LVQ_State_Type lvq_cur_state;
As in the back-propagation implementation, these three variables are defined as