comment c code
This commit is contained in:
parent
05a9142c7e
commit
2080c37eef
|
@ -3,8 +3,14 @@
|
||||||
#include "fileGestion.h"
|
#include "fileGestion.h"
|
||||||
#include "initialParameters.h"
|
#include "initialParameters.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include <assert.h>
|
/**
|
||||||
|
* @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){
|
void averageCalculation(long **p, double averageArray[] , int N, int M){
|
||||||
for(int i = 0; i < M-1; i++){
|
for(int i = 0; i < M-1; i++){
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
@ -17,16 +23,20 @@ void averageCalculation(long **p, double averageArray[] , int N, int M){
|
||||||
//printf("%f\n", powerArray[i]);
|
//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);
|
long **p = getRawDataArray(rawDataFileName,N, M);
|
||||||
double aver[8];
|
double aver[8];
|
||||||
if(p !=NULL){
|
if(p !=NULL){
|
||||||
averageCalculation(p,aver,N,M);
|
averageCalculation(p,aver,N,M);
|
||||||
writeDataInFile("averageData.csv",aver,8);
|
writeDataInFile("averageData.csv",aver,8);
|
||||||
freeArray(p,N);
|
freeArray(p,N);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue