29 #define TOKENSIZE 80 //< max size of tokens read from an input file
30 #define MAXSAMPLESIZE 65535 //< max num of dimensions in feature space
46 if ((
tfscanf(File,
"%d", &SampleSize) != 1) ||
72 for (i = 0; i < N; i++) {
73 if (
tfscanf(File,
"%s", Token) != 1)
75 "Illegal circular/linear specification");
81 if (
tfscanf(File,
"%s", Token) != 1)
83 "Illegal essential/non-essential spec");
88 if (
tfscanf(File,
"%f%f", &(ParamDesc[i].Min), &(ParamDesc[i].Max)) != 2)
90 ParamDesc[i].
Range = ParamDesc[i].
Max - ParamDesc[i].
Min;
120 if ((Status =
tfscanf(File,
"%s", Token)) == 1) {
130 if ((
tfscanf(File,
"%d", &SampleCount) != 1) || (SampleCount < 0))
138 switch (Proto->
Style) {
159 for (i = 0; i < N; i++) {
173 for (i = 0; i < N; i++) {
174 if (
tfscanf(File,
"%s", Token) != 1)
176 "Illegal prototype distribution");
189 "Illegal prototype distribution");
200 for (i = 0; i < N; i++) {
224 else if (Status == EOF)
245 if (
tfscanf(File,
"%s", Token) != 1)
288 for (i = 0; i < N; i++) {
289 NumFloatsRead =
tfscanf(File,
"%f", &(Buffer[i]));
290 if (NumFloatsRead != 1) {
291 if ((NumFloatsRead == EOF) && (i == 0)) {
317 for (i = 0; i < N; i++) {
318 if (ParamDesc[i].Circular)
319 fprintf (File,
"circular ");
321 fprintf (File,
"linear ");
323 if (ParamDesc[i].NonEssential)
324 fprintf (File,
"non-essential ");
326 fprintf (File,
"essential ");
328 fprintf (File,
"%10.6f %10.6f\n", ParamDesc[i].Min, ParamDesc[i].Max);
347 fprintf (File,
"significant ");
349 fprintf (File,
"insignificant ");
353 fprintf (File,
"\t");
355 switch (Proto->
Style) {
363 for (i = 0; i < N; i++)
366 fprintf (File,
" %9s",
"normal");
369 fprintf (File,
" %9s",
"uniform");
372 fprintf (File,
" %9s",
"random");
377 fprintf (File,
"\n\t");
394 for (
int i = 0; i < N; i++)
395 fprintf(File,
" %9.6f", Array[i]);
411 switch (ProtoStyle) {
413 fprintf (File,
"spherical");
416 fprintf (File,
"elliptical");
419 fprintf (File,
"mixed");
422 fprintf (File,
"automatic");
449 BOOL8 WriteSigProtos,
450 BOOL8 WriteInsigProtos)
455 fprintf(File,
"%0d\n",N);
void WritePrototype(FILE *File, uinT16 N, PROTOTYPE *Proto)
#define ILLEGALSIGNIFICANCESPEC
int tfscanf(FILE *stream, const char *format,...)
FLOAT32 * ReadNFloats(FILE *File, uinT16 N, FLOAT32 Buffer[])
uinT16 ReadSampleSize(FILE *File)
#define ILLEGALMINMAXSPEC
#define ILLEGALESSENTIALSPEC
void WriteNFloats(FILE *File, uinT16 N, FLOAT32 Array[])
#define ILLEGALVARIANCESPEC
#define ILLEGALDISTRIBUTION
#define ILLEGALSAMPLESIZE
#define ILLEGALSAMPLECOUNT
PROTOSTYLE ReadProtoStyle(FILE *File)
void DoError(int Error, const char *Message)
PARAM_DESC * ReadParamDesc(FILE *File, uinT16 N)
void WriteParamDesc(FILE *File, uinT16 N, PARAM_DESC ParamDesc[])
void WriteProtoList(FILE *File, uinT16 N, PARAM_DESC ParamDesc[], LIST ProtoList, BOOL8 WriteSigProtos, BOOL8 WriteInsigProtos)
#define ILLEGALCIRCULARSPEC
PROTOTYPE * ReadPrototype(FILE *File, uinT16 N)
void WriteProtoStyle(FILE *File, PROTOSTYLE ProtoStyle)