#include <string.h>
#include <math.h>
#include <float.h>
+#include <stdio.h>
// Read an integer char by char, and position the cursor to next character
char readInt(FILE* stream, int* integer)
nextChar = fgetc(stream);
ungetc(nextChar, stream);
while ((nextChar = fgetc(stream)) >= '0' && nextChar <= '9')
- *integer = 10 * (*integer) + (int) (nextChar - '0');
+ {
+
+ printf("next char: %c\n",nextChar);
+
+ *integer = 10 * (*integer) + (int) (nextChar - '0'); }
(*integer) *= sign;
+printf("INTEGER: %i\n",*integer);
return nextChar;
}
// Read current line
scan_line(ifile, sep, posID, &ID, posValue, &value);
+
+ printf("SCAN: %i %g\n",ID,value);
if (ID != lastID)
{
// Just starting a new time-series: must process the last one (if exists !)
if (lastID > 0)
{
- if (refTsLength == 0)
- refTsLength = tsLength; //first serie is considered clean
if (tsLength == refTsLength)
{
for (int i=0; i<tsLength; i++)
else
mismatchLengthCount++;
}
+ else
+ refTsLength = tsLength; //first serie is considered clean
// reinitialize flags
tsLength = 0;
lastID = ID;
}
-
+printf("LA %i %i\n",tsLength,refTsLength);
//We cannot write more than refTsLength values
if (tsLength < refTsLength)
tsBuffer[tsLength++] = value;