moved xError to heap.;

This commit is contained in:
gurkenhabicht 2018-06-14 15:12:32 +02:00
parent dd325b47be
commit 2f06ec67b7
2 changed files with 8 additions and 4 deletions

View File

@ -202,7 +202,7 @@ void standardNLMS( mldata_t *mlData, point_t points[] ) {
char fileName[512];
const unsigned xErrorLength = mlData->samplesCount;
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount);
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount + 1);
unsigned i, xCount = 0;
mkFileName ( fileName, sizeof(fileName), STANDARD_NLMS);
@ -280,7 +280,7 @@ void localMean ( mldata_t *mlData, point_t points[] ) {
char fileName[512];
const unsigned xErrorLength = mlData->samplesCount;
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount);
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount + 1);
unsigned i, xCount = 0; // Runtime vars
@ -363,7 +363,7 @@ void directPredecessor( mldata_t *mlData, point_t points[]) {
char fileName[512];
const unsigned xErrorLength = mlData->samplesCount;
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount);
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount + 1);
unsigned xCount = 0, i;
double xActual = 0.0;
@ -443,7 +443,7 @@ void differentialPredecessor ( mldata_t *mlData, point_t points[] ) {
memcpy(localWeights, mlData->weights, sizeof(double) * mlData->windowSize + 1);
const unsigned xErrorLength = mlData->samplesCount;
char fileName[512];
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount);
double *xError = (double *) malloc ( sizeof(double) *mlData->samplesCount + 1);
unsigned xCount = 0, i;
double xPredicted = 0.0;

View File

@ -270,6 +270,7 @@ void standardNLMS(mldata_t *mlData, point_t points[]) {
fprintf(fp01, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean);
free(localWeights);
free(xError);
}
@ -354,6 +355,7 @@ void localMean(mldata_t *mlData, point_t points[]) {
fclose(fp4);
free(localWeights);
free(xError);
}
/*
@ -435,6 +437,7 @@ void directPredecessor(mldata_t *mlData, point_t points[]) {
fclose(fp3);
free(localWeights);
free(xError);
}
/*
@ -522,6 +525,7 @@ void differentialPredecessor(mldata_t *mlData, point_t points[]) {
fclose(fp6);
free(localWeights);
free(xError);
}
/*