From 33115049f6eab1d4e886814c7d5b21c21da7ca7f Mon Sep 17 00:00:00 2001 From: "quentin.perret" Date: Wed, 15 Jun 2022 10:49:21 +0200 Subject: [PATCH] threads clean , captors choice ok --- Code-C/average.c | 4 ++-- Code-C/getArray.c | 12 +++++------- Code-C/getArray.h | 2 +- Code-C/initialParameters.h | 2 ++ Code-C/main | Bin 39640 -> 40128 bytes Code-C/main.c | 3 +-- Code-C/simulateFlux.c | 13 ++++++++++++- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Code-C/average.c b/Code-C/average.c index dd83fe7..425419c 100644 --- a/Code-C/average.c +++ b/Code-C/average.c @@ -10,10 +10,10 @@ * @param averageArray array where results are stocked */ void averageCalculation(long **p, double averageArray[]){ - for(int i = 0; i < nCol-1; i++){ + for(int i = 1; i < nCol; i++){ int j = 0; averageArray[i] = 0; - while(j < nRow){ + while(j < nRow -1){ averageArray[i] += p[i][j]; j++; } diff --git a/Code-C/getArray.c b/Code-C/getArray.c index 77a71ba..eeaac8e 100644 --- a/Code-C/getArray.c +++ b/Code-C/getArray.c @@ -70,9 +70,9 @@ bool checkArrayFullyFill(long **p, int N){ * @param N number of rows in array */ void freeArray(long **p, int N) { - int i; - for(i = 0 ; i < N ; i++) + for(int i = 0 ; i < N ; i++){ free(p[i]); + } free(p); } @@ -87,14 +87,12 @@ void freeArray(long **p, int N) { long **getRawDataArray(char* rawDataFileName){ long **p; p = get(nRow, nCol); - printf("before fill\n"); fillArrayWithRawData(rawDataFileName,p ,nRow, nCol); - printf("after fill\n"); - if(checkArrayFullyFill(p,nRow, nCol)){ + //if(checkArrayFullyFill(p,nRow)){ //clearRawData(N); return p; - } + /*} else{ return NULL; - } + }*/ } \ No newline at end of file diff --git a/Code-C/getArray.h b/Code-C/getArray.h index 6a0c836..02810a9 100644 --- a/Code-C/getArray.h +++ b/Code-C/getArray.h @@ -8,4 +8,4 @@ long **getRawDataArray(char *rawDataFileName); void printArrayData(long** p, int N, int M); void freeArray(long **p, int N); -bool checkArrayFullyFill(long **p, int N , int M); \ No newline at end of file +bool checkArrayFullyFill(long **p, int N ); \ No newline at end of file diff --git a/Code-C/initialParameters.h b/Code-C/initialParameters.h index 546b17a..96201f5 100644 --- a/Code-C/initialParameters.h +++ b/Code-C/initialParameters.h @@ -6,6 +6,8 @@ extern int nRow; extern int nCol; extern double freqEch; +extern int cptFile; + extern double period; extern double invTimeBandWidth; diff --git a/Code-C/main b/Code-C/main index 7652bd45e2c84a2e894b391e4ab9b663e3d55698..46f740e740872bbff6a062446db9ba1ab0f986be 100755 GIT binary patch delta 9432 zcmaJ{34B!5xxeSm+*vZ2%uGU($wC$gkOfJAK*A;j2uxT5B$B8|@+7PQ0wh8NGeAHX z$7td~K%2I>JeN`}HZF(=iBgF>RBN%%1uQ1u&wfu+zdsP^@fQX>?3Bk3O!4e&uQMMOTCT>zYYdv>3eRtO?=Xd5#G7Ms zy$L@AgS|w5686560R#BWZ@ymY@qOuOyqMxaOn>xSV-&@&wd2?K5p>4>6byQNh24Jp zb0mm<62BgQU3bXGE|U8TyLC5k;qld-Mcx$t>$CVd$#02m3jZo!Q5pkmOkwvHKktf- zXB|A;eS>iy*nE;Z$F}QVB2K4YE9aZt+lPLXrzlOuA0-OFB4Em#A zgbadC-$x!~*zglSo{-23Dr%R zu~KWT)T$>f18HGH`Ag6Hoc_Y|p8dyY>8P@9emQZ;#5QOh@kqlzM~dK|00dV3UAVt2 z-8Yd|k<@xlYMmghLeBfA$K6WOo20ZxO6y2!$ zrSzXJ5kCkJxR1|B8j$t&mAT zh4zliq8i;a{TKL@&RN+XOeH6R8P`2DUFuWc#=L%z8dd3D@(h8w4Rq*mmDGkGifzmM#^dY&Xi5z ztHBmMAn^7j{;!nSxcVN(Qwb=t{9uI4ibmV2Xmn5T$oB$A!+beuI1Stq20hdln$ zGqA&BEFag4RJYR3UaW(p=`TGD)*)T1OlqOW^{{pdt-?dIeCIt)RcCK0-~-b-Su4Mo zHr}iE$&-cMw0AEgp&?PbjQ(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