ex-4: fixed typos

This commit is contained in:
Giù Marcer 2020-04-30 22:28:06 +02:00 committed by rnhmjoj
parent e7937a8c0d
commit 5a5cd927e3
2 changed files with 8 additions and 8 deletions

View File

@ -19,12 +19,12 @@ int parser(size_t *N, size_t *n, double *p_max, char argc, char **argv, size_t *
else if (!strcmp(argv[i], "-o")) *go = 1;
else
{
fprintf(stderr, "Usage: %s -[hnbp]\n", argv[0]);
fprintf(stderr, "Usage: %s -[hnbpo]\n", argv[0]);
fprintf(stderr, "\t-h\tShow this message.\n");
fprintf(stderr, "\t-n N\tThe number of events to generate. (default: 50000)\n");
fprintf(stderr, "\t-n N\tThe number of particles to generate. (default: 50000)\n");
fprintf(stderr, "\t-b N\tThe number of bins of the histogram. (default: 50)\n");
fprintf(stderr, "\t-p PMAX\tThe maximum value of momentum. (default: 10)\n");
fprintf(stderr, "\t-o \tPrint histogram to stdout.\n");
fprintf(stderr, "\t-o\tPrint histogram to stdout.\n");
return 0;
}
}
@ -42,7 +42,7 @@ int main(int argc, char **argv)
double p_max = 10;
size_t go = 0;
int res = parser(&N, &n, &p_max, argc, argv, &go);
if (go == 0)
if (go == 0 && res == 1)
{
printf("\nGenerating histogram with:\n"
"%ld points\n"
@ -145,12 +145,12 @@ int main(int argc, char **argv)
func.function = &chi2;
func.params = &params;
double min_p = 5;
double max_p = 15;
double min_p = p_max - 5;
double max_p = p_max + 5;
// Initialize minimization.
//
double x = 10;
double x = p_max;
int max_iter = 100;
double prec = 1e-7;
int status = GSL_CONTINUE;

View File

@ -24,7 +24,7 @@ ex-4: ex-4/bin/main
ex-4/bin/main: ex-4/main.c ex-4/lib.c
$(CCOMPILE)
ex-5: ex-5/bin/casino ex-5/bin/manual ex-5/bin/trifecta
ex-5: ex-5/bin/main
ex-5/bin/%: ex-5/%.c
$(CCOMPILE)