diff --git a/Code-C/Makefile b/Code-C/Makefile index 8a6b768..eed5e98 100644 --- a/Code-C/Makefile +++ b/Code-C/Makefile @@ -3,10 +3,8 @@ CC = gcc all: # rm powerData.csv $(CC) b2hd.c -o b2hd - $(CC) fileGestion.c getArray.c -o getArray -# $(CC) fileGestion.c getArray.c power.c -lm -o power + $(CC) fileGestion.c getArray.c power.c -lm -o power # getArray.c fileGestion.c power.c main.c -o main - ./b2hd < ../02400031.TXT > rawData.csv - ./getArray -#./power \ No newline at end of file + ./b2hd < ../02400001.TXT > rawData.csv + ./power \ No newline at end of file diff --git a/Code-C/b2hd b/Code-C/b2hd index 9fc905c..bdb7e90 100755 Binary files a/Code-C/b2hd and b/Code-C/b2hd differ diff --git a/Code-C/b2hd.c b/Code-C/b2hd.c index 81408cb..761273e 100644 --- a/Code-C/b2hd.c +++ b/Code-C/b2hd.c @@ -11,7 +11,7 @@ void b2hd() quartet value; while (fread(&buff, 26, 1, stdin)) { - fprintf(stdout , "%ld,", millis()); + fprintf(stdout , "%d,", millis()); for (int i = 1; i < 9; i++){ /*buff[25] = '\0';*/ if (strncmp(buff, "#################\n", (size_t)18) == 0) { diff --git a/Code-C/getArray b/Code-C/getArray deleted file mode 100755 index 50f8901..0000000 Binary files a/Code-C/getArray and /dev/null differ diff --git a/Code-C/getArray.c b/Code-C/getArray.c index 054564f..3770199 100644 --- a/Code-C/getArray.c +++ b/Code-C/getArray.c @@ -24,13 +24,16 @@ void fillRawData(long** p, int N, int M) { FILE *f = fopen("rawData.csv","r"); for(i = 0 ; i < N ; i++){ if (!getline(&buffer, &bufsize, f)) break; // condition d'arret de la boucle si fichier fini - printf("%s",buffer); + //printf("buffer : %s token : ",buffer); j = 0; while((token = strsep(&buffer,",")) != NULL){ // séparation valeur par virgule initiale : csv - //printf("%s ," , token); + //printf(token); p[i][j] = atoi(token); + //printf("%d,", p[i][j]); + //printf("%d, " , p[i][j]); j++; } + //printf("\n\n"); /* for(j = 1 ; j < M ; j++){ @@ -46,7 +49,7 @@ void fillRawData(long** p, int N, int M) { void printArrayData(long** p, int N, int M) { int i, j; for(i = 0 ; i < N ; i++){ - printf("line n°%d : %d , %d , %d , %d , %d , %d , %d , %d \n" ,i,p[i][0],p[i][1],p[i][2],p[i][3],p[i][4],p[i][5],p[i][6],p[i][7]); + printf("line n°%d : %d , %d , %d , %d , %d , %d , %d , %d , %d\n" ,i,p[i][0],p[i][1],p[i][2],p[i][3],p[i][4],p[i][5],p[i][6],p[i][7],p[i][8]); } } @@ -62,10 +65,4 @@ long **getRawDataArray(int N , int M){ p = get(N, M); fillRawData(p ,N, M); return p; -} - -void main(int argc , char argv[]){ - long **p; - p = getRawDataArray(10,9); - printArrayData(p,10,9); } \ No newline at end of file diff --git a/Code-C/power b/Code-C/power index 86f2cfb..b0bf721 100755 Binary files a/Code-C/power and b/Code-C/power differ diff --git a/Code-C/power.c b/Code-C/power.c index 24750b8..dcc7148 100644 --- a/Code-C/power.c +++ b/Code-C/power.c @@ -25,8 +25,7 @@ void power(long **p, double a[]){ } } int main(int argc , char** argv){ - printf("Get raw data mat"); - int32_t **p = getRawDataArray(nRow, nCol); + long **p = getRawDataArray(nRow, nCol); //printArray(p,nRow,nCol); double pw[8]; power(p,pw); diff --git a/Code-C/power.h b/Code-C/power.h index 14ca295..12caf6a 100644 --- a/Code-C/power.h +++ b/Code-C/power.h @@ -1,3 +1,3 @@ #include -void power(int **p, double a[]); \ No newline at end of file +void power(long **p, double a[]); \ No newline at end of file