diff --git a/Code-C/average.c b/Code-C/average.c index e913de7..3da32f2 100644 --- a/Code-C/average.c +++ b/Code-C/average.c @@ -12,7 +12,7 @@ void averageCalculation(long **p, double averageArray[]) { // printArrayData(p, nRowRawData, nCol); - printf("\n"); + // printf("\n"); for (int i = 1; i < nCol; i++) { int j = 0; diff --git a/Code-C/getArray.c b/Code-C/getArray.c index 1fe1691..51e26db 100644 --- a/Code-C/getArray.c +++ b/Code-C/getArray.c @@ -24,10 +24,28 @@ double **getDoubleArray(int N, int M) /* Allocate the array */ array[i] = (double *)malloc(M * sizeof(double)); return array; } - +/** + * @brief print all the element of a bidimensionnal array p of shape : N x M + */ +void printArrayData(long **p) +{ + for (int i = 0; i < nRowRawData; i++) + { + printf("line n°%d : ", i); + for (int j = 0; j < nCol; j++) + { + printf("%ld , ", p[i][j]); + if (j == (nCol - 1)) + printf("\n"); + } + } +} void fillArrayWithRawData(char *rawDataFileName, long **p, int N, int M) { +<<<<<<< HEAD int i = 0, j; +======= +>>>>>>> 1c7d7edaaed0245806ce2b0f5538935709632a03 char *buffer; size_t bufsize = 200; buffer = (char *)malloc(bufsize * sizeof(char)); @@ -162,6 +180,8 @@ void printArrayData(long **p, int N, int M) printf("\n"); } } + printArrayData(p); + fclose(f); } /** * @brief verify if all the element of an array are not NULL, return diff --git a/Code-C/getArray.h b/Code-C/getArray.h index 6cd847e..556d0ee 100644 --- a/Code-C/getArray.h +++ b/Code-C/getArray.h @@ -6,7 +6,7 @@ #include long **getRawDataArray(char *rawDataFileName); -void printArrayData(long **p, int N, int M); +void printArrayData(long **p); void freeArray(long **p, int N); bool checkArrayFullyFill(long **p, int N); double **getDoubleArray(int N, int M); \ No newline at end of file diff --git a/Code-C/main.c b/Code-C/main.c index ec59c73..d1ed804 100644 --- a/Code-C/main.c +++ b/Code-C/main.c @@ -163,12 +163,12 @@ int main(int argc, char **argv) // exit(1); // } - pthread_t calculGrowthRate; - if (pthread_create(&calculGrowthRate, NULL, threadCalculGrowthRate, "threadCalculGrowthRate")) - { - perror("threadcalculGrowthRate() error"); - exit(1); - } + // pthread_t calculGrowthRate; + // if (pthread_create(&calculGrowthRate, NULL, threadCalculGrowthRate, "threadCalculGrowthRate")) + // { + // perror("threadcalculGrowthRate() error"); + // exit(1); + // } pthread_exit(NULL); } \ No newline at end of file diff --git a/Code-C/simulateFlux.c b/Code-C/simulateFlux.c index fb93392..fbe6337 100644 --- a/Code-C/simulateFlux.c +++ b/Code-C/simulateFlux.c @@ -212,6 +212,7 @@ void *threadSimulateFlux(void *vargp) // prepare next file now fileName = createNewRawDataFileName(); rawDataFile = fopen(fileName, "w+"); + //add test to get p then print it here // p is gotten from fileName file } } rawDataWriteFlag = false; diff --git a/Py-Script/data.py b/Py-Script/data.py deleted file mode 100644 index 07ff604..0000000 --- a/Py-Script/data.py +++ /dev/null @@ -1,2 +0,0 @@ -import numpy as np -