rebase merge
This commit is contained in:
commit
6b9de5f457
|
@ -12,7 +12,7 @@
|
||||||
void averageCalculation(long **p, double averageArray[])
|
void averageCalculation(long **p, double averageArray[])
|
||||||
{
|
{
|
||||||
// printArrayData(p, nRowRawData, nCol);
|
// printArrayData(p, nRowRawData, nCol);
|
||||||
printf("\n");
|
// printf("\n");
|
||||||
for (int i = 1; i < nCol; i++)
|
for (int i = 1; i < nCol; i++)
|
||||||
{
|
{
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
|
@ -24,10 +24,28 @@ double **getDoubleArray(int N, int M) /* Allocate the array */
|
||||||
array[i] = (double *)malloc(M * sizeof(double));
|
array[i] = (double *)malloc(M * sizeof(double));
|
||||||
return array;
|
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)
|
void fillArrayWithRawData(char *rawDataFileName, long **p, int N, int M)
|
||||||
{
|
{
|
||||||
|
<<<<<<< HEAD
|
||||||
int i = 0, j;
|
int i = 0, j;
|
||||||
|
=======
|
||||||
|
>>>>>>> 1c7d7edaaed0245806ce2b0f5538935709632a03
|
||||||
char *buffer;
|
char *buffer;
|
||||||
size_t bufsize = 200;
|
size_t bufsize = 200;
|
||||||
buffer = (char *)malloc(bufsize * sizeof(char));
|
buffer = (char *)malloc(bufsize * sizeof(char));
|
||||||
|
@ -162,6 +180,8 @@ void printArrayData(long **p, int N, int M)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
printArrayData(p);
|
||||||
|
fclose(f);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @brief verify if all the element of an array are not NULL, return
|
* @brief verify if all the element of an array are not NULL, return
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
long **getRawDataArray(char *rawDataFileName);
|
long **getRawDataArray(char *rawDataFileName);
|
||||||
void printArrayData(long **p, int N, int M);
|
void printArrayData(long **p);
|
||||||
void freeArray(long **p, int N);
|
void freeArray(long **p, int N);
|
||||||
bool checkArrayFullyFill(long **p, int N);
|
bool checkArrayFullyFill(long **p, int N);
|
||||||
double **getDoubleArray(int N, int M);
|
double **getDoubleArray(int N, int M);
|
|
@ -163,12 +163,12 @@ int main(int argc, char **argv)
|
||||||
// exit(1);
|
// exit(1);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
pthread_t calculGrowthRate;
|
// pthread_t calculGrowthRate;
|
||||||
if (pthread_create(&calculGrowthRate, NULL, threadCalculGrowthRate, "threadCalculGrowthRate"))
|
// if (pthread_create(&calculGrowthRate, NULL, threadCalculGrowthRate, "threadCalculGrowthRate"))
|
||||||
{
|
// {
|
||||||
perror("threadcalculGrowthRate() error");
|
// perror("threadcalculGrowthRate() error");
|
||||||
exit(1);
|
// exit(1);
|
||||||
}
|
// }
|
||||||
|
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
|
@ -212,6 +212,7 @@ void *threadSimulateFlux(void *vargp)
|
||||||
// prepare next file now
|
// prepare next file now
|
||||||
fileName = createNewRawDataFileName();
|
fileName = createNewRawDataFileName();
|
||||||
rawDataFile = fopen(fileName, "w+");
|
rawDataFile = fopen(fileName, "w+");
|
||||||
|
//add test to get p then print it here // p is gotten from fileName file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rawDataWriteFlag = false;
|
rawDataWriteFlag = false;
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
import numpy as np
|
|
||||||
|
|
Loading…
Reference in a new issue