From 2080c37eef92a974986b82bdf325135c542650d2 Mon Sep 17 00:00:00 2001 From: "quentin.perret" Date: Tue, 14 Jun 2022 10:46:04 +0200 Subject: [PATCH] comment c code --- Code-C/average.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Code-C/average.c b/Code-C/average.c index 7d228fd..79dbf4a 100644 --- a/Code-C/average.c +++ b/Code-C/average.c @@ -3,8 +3,14 @@ #include "fileGestion.h" #include "initialParameters.h" #include "queue.h" -#include - +/** + * @brief realize the average calcul + * + * @param p array with all the values that will be used for the calcul + * @param averageArray array where results are stocked + * @param N number of rows in p + * @param M number of columns in p + */ void averageCalculation(long **p, double averageArray[] , int N, int M){ for(int i = 0; i < M-1; i++){ int j = 0; @@ -17,16 +23,20 @@ void averageCalculation(long **p, double averageArray[] , int N, int M){ //printf("%f\n", powerArray[i]); } } -bool average(char* rawDataFileName,int N , int M){ + +/** + * @brief function that realize all the action to write one lign in the file averageData.csv + * + * @param rawDataFileName name of the raw data file to use to realize the calcul + * @param N number of rows in the file + * @param M number of columns in the file + */ +void average(char* rawDataFileName,int N , int M){ long **p = getRawDataArray(rawDataFileName,N, M); double aver[8]; if(p !=NULL){ averageCalculation(p,aver,N,M); writeDataInFile("averageData.csv",aver,8); freeArray(p,N); - return true; - } - else{ - return false; } } \ No newline at end of file