#include "cutoffs.h"
#include "efio.h"
#include "scanutils.h"
#include <stdio.h>
Go to the source code of this file.
#define MAX_CUTOFF 1000 |
** (c) Copyright Hewlett-Packard Company, 1988. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** http://www.apache.org/licenses/LICENSE-2.0 ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.
Definition at line 28 of file cutoffs.cpp.
Referenced by ReadNewCutoffs().
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 */