#include "matchdefs.h"
Go to the source code of this file.
void ReadNewCutoffs | ( | char * | Filename, | |
CLASS_TO_INDEX | ClassMapper, | |||
CLASS_CUTOFF_ARRAY | Cutoffs | |||
) |
Open Filename, read in all of the class-id/cutoff pairs and insert them into the Cutoffs array.
Filename | Name of file containing cutoff definitions | |
ClassMapper | Array which maps class id's to class indexes | |
Cutoffs | Array to put cutoffs into |
Definition at line 48 of file cutoffs.cpp.
References Efopen(), fscanf(), MAX_CUTOFF, and MAX_NUM_CLASSES.
Referenced by InitAdaptiveClassifier().
00050 { 00051 FILE *CutoffFile; 00052 char Class[2]; 00053 CLASS_ID ClassId; 00054 int Cutoff; 00055 int i; 00056 00057 CutoffFile = Efopen (Filename, "r"); 00058 00059 for (i = 0; i < MAX_NUM_CLASSES; i++) 00060 Cutoffs[i] = MAX_CUTOFF; 00061 00062 while (fscanf (CutoffFile, "%1s %d", Class, &Cutoff) == 2) { 00063 ClassId = Class[0]; 00064 Cutoffs[ClassMapper[ClassId]] = Cutoff; 00065 } 00066 fclose(CutoffFile); 00067 00068 } /* ReadNewCutoffs */