ex-4: fixed typos
This commit is contained in:
parent
e7937a8c0d
commit
5a5cd927e3
14
ex-4/main.c
14
ex-4/main.c
@ -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 if (!strcmp(argv[i], "-o")) *go = 1;
|
||||||
else
|
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-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-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-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;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ int main(int argc, char **argv)
|
|||||||
double p_max = 10;
|
double p_max = 10;
|
||||||
size_t go = 0;
|
size_t go = 0;
|
||||||
int res = parser(&N, &n, &p_max, argc, argv, &go);
|
int res = parser(&N, &n, &p_max, argc, argv, &go);
|
||||||
if (go == 0)
|
if (go == 0 && res == 1)
|
||||||
{
|
{
|
||||||
printf("\nGenerating histogram with:\n"
|
printf("\nGenerating histogram with:\n"
|
||||||
"%ld points\n"
|
"%ld points\n"
|
||||||
@ -145,12 +145,12 @@ int main(int argc, char **argv)
|
|||||||
func.function = &chi2;
|
func.function = &chi2;
|
||||||
func.params = ¶ms;
|
func.params = ¶ms;
|
||||||
|
|
||||||
double min_p = 5;
|
double min_p = p_max - 5;
|
||||||
double max_p = 15;
|
double max_p = p_max + 5;
|
||||||
|
|
||||||
// Initialize minimization.
|
// Initialize minimization.
|
||||||
//
|
//
|
||||||
double x = 10;
|
double x = p_max;
|
||||||
int max_iter = 100;
|
int max_iter = 100;
|
||||||
double prec = 1e-7;
|
double prec = 1e-7;
|
||||||
int status = GSL_CONTINUE;
|
int status = GSL_CONTINUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user