update
This commit is contained in:
parent
fd44e6890b
commit
9955d5871b
BIN
bin/CPP_NLMS.exe
BIN
bin/CPP_NLMS.exe
Binary file not shown.
|
@ -116,7 +116,8 @@ int main( int argc, char **argv ) {
|
||||||
sscanf(&argv[1][3], "%s", xBuffer);
|
sscanf(&argv[1][3], "%s", xBuffer);
|
||||||
if (strstr(xBuffer, istrue)) {
|
if (strstr(xBuffer, istrue)) {
|
||||||
include = 1;
|
include = 1;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
printf("Wrong Argruments: %s\n", argv[1]);
|
printf("Wrong Argruments: %s\n", argv[1]);
|
||||||
usage(argv);
|
usage(argv);
|
||||||
}
|
}
|
||||||
|
@ -150,7 +151,8 @@ int main( int argc, char **argv ) {
|
||||||
if ((seed != NULL)) {
|
if ((seed != NULL)) {
|
||||||
srand(*seed); // Seed for random number generating
|
srand(*seed); // Seed for random number generating
|
||||||
printf("srand is reproducable\n");
|
printf("srand is reproducable\n");
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
printf("srand depends on time\n"); // Default seed is time(NULL)
|
printf("srand depends on time\n"); // Default seed is time(NULL)
|
||||||
}
|
}
|
||||||
|
@ -265,7 +267,7 @@ void localMean ( mldata_t *mlData, point_t points[] ) {
|
||||||
deviation /= xErrorLength; // Deviation
|
deviation /= xErrorLength; // Deviation
|
||||||
printf("mean:%lf, devitation:%lf\t\tlocal Mean\n", mean, deviation);
|
printf("mean:%lf, devitation:%lf\t\tlocal Mean\n", mean, deviation);
|
||||||
fprintf(fp4, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean); // Write to logfile
|
fprintf(fp4, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean); // Write to logfile
|
||||||
free(localWeights);
|
//free(localWeights);
|
||||||
free(xErrorPtr);
|
free(xErrorPtr);
|
||||||
free(xError);
|
free(xError);
|
||||||
|
|
||||||
|
@ -353,7 +355,7 @@ void directPredecessor( mldata_t *mlData, point_t points[]) {
|
||||||
printf("mean:%lf, devitation:%lf\t\tdirect Predecessor\n", mean, deviation);
|
printf("mean:%lf, devitation:%lf\t\tdirect Predecessor\n", mean, deviation);
|
||||||
fprintf(fp3, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean);
|
fprintf(fp3, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean);
|
||||||
fclose(fp3);
|
fclose(fp3);
|
||||||
free(localWeights);
|
//free(localWeights);
|
||||||
free(xErrorPtr);
|
free(xErrorPtr);
|
||||||
free(xError);
|
free(xError);
|
||||||
}
|
}
|
||||||
|
@ -438,7 +440,7 @@ void differentialPredecessor ( mldata_t *mlData, point_t points[] ) {
|
||||||
printf("mean:%lf, devitation:%lf\t\tdifferential Predecessor\n", mean, deviation);
|
printf("mean:%lf, devitation:%lf\t\tdifferential Predecessor\n", mean, deviation);
|
||||||
fprintf(fp6, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean);
|
fprintf(fp6, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean);
|
||||||
fclose(fp6);
|
fclose(fp6);
|
||||||
free(localWeights);
|
//free(localWeights);
|
||||||
free(xErrorPtr);
|
free(xErrorPtr);
|
||||||
free(xError);
|
free(xError);
|
||||||
|
|
||||||
|
@ -803,16 +805,19 @@ int ppmColorChannel(FILE* fp, imagePixel_t *image, char *colorChannel, mldata_t
|
||||||
for (i = 0; i < mlData->samplesCount - 1; i++) {
|
for (i = 0; i < mlData->samplesCount - 1; i++) {
|
||||||
fprintf(fp, "%d\n", image->data[i].green);
|
fprintf(fp, "%d\n", image->data[i].green);
|
||||||
}
|
}
|
||||||
} else if ( strcmp(colorChannel, "red") == 0 ){
|
}
|
||||||
|
else if (strcmp(colorChannel, "red") == 0) {
|
||||||
for (i = 0; i < mlData->samplesCount - 1; i++) {
|
for (i = 0; i < mlData->samplesCount - 1; i++) {
|
||||||
fprintf(fp, "%d\n", image->data[i].red);
|
fprintf(fp, "%d\n", image->data[i].red);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( strcmp(colorChannel, "blue") == 0 ) {
|
}
|
||||||
|
else if (strcmp(colorChannel, "blue") == 0) {
|
||||||
for (i = 0; i < mlData->samplesCount - 1; i++) {
|
for (i = 0; i < mlData->samplesCount - 1; i++) {
|
||||||
fprintf(fp, "%d\n", image->data[i].blue);
|
fprintf(fp, "%d\n", image->data[i].blue);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
printf("Colorchannels are red, green and blue. Pick one of them!");
|
printf("Colorchannels are red, green and blue. Pick one of them!");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue