This commit is contained in:
kbecke23 2018-05-24 11:33:52 +02:00
parent fd44e6890b
commit 9955d5871b
2 changed files with 244 additions and 239 deletions

Binary file not shown.

View File

@ -116,7 +116,8 @@ int main( int argc, char **argv ) {
sscanf(&argv[1][3], "%s", xBuffer);
if (strstr(xBuffer, istrue)) {
include = 1;
} else {
}
else {
printf("Wrong Argruments: %s\n", argv[1]);
usage(argv);
}
@ -150,7 +151,8 @@ int main( int argc, char **argv ) {
if ((seed != NULL)) {
srand(*seed); // Seed for random number generating
printf("srand is reproducable\n");
} else {
}
else {
srand((unsigned int)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
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
free(localWeights);
//free(localWeights);
free(xErrorPtr);
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);
fprintf(fp3, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean);
fclose(fp3);
free(localWeights);
//free(localWeights);
free(xErrorPtr);
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);
fprintf(fp6, "\nQuadratische Varianz(x_error): %f\nMittelwert:(x_error): %f\n\n", deviation, mean);
fclose(fp6);
free(localWeights);
//free(localWeights);
free(xErrorPtr);
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++) {
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++) {
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++) {
fprintf(fp, "%d\n", image->data[i].blue);
}
} else {
}
else {
printf("Colorchannels are red, green and blue. Pick one of them!");
exit(EXIT_FAILURE);
}