From 72fa3ad2e70c5b8baae1bd289b32b759485d94d9 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 8 Apr 2020 13:43:57 +0000 Subject: [PATCH] ex-1: use a constant for number of resamples --- ex-1/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ex-1/main.c b/ex-1/main.c index 9f37888..af414f1 100644 --- a/ex-1/main.c +++ b/ex-1/main.c @@ -81,8 +81,10 @@ int main(int argc, char** argv) { pdf.function = &landau_pdf; pdf.params = NULL; + const size_t boots = 100; + double mode_e = numeric_mode(min, max, &pdf, 1); - uncert mode_o = bootstrap_mode(r, sample, samples, 100); + uncert mode_o = bootstrap_mode(r, sample, samples, boots); // print the results fprintf(stderr, "\n## Results\n"); @@ -109,7 +111,7 @@ int main(int argc, char** argv) { fprintf(stderr, "\n\n# FWHM comparison\n"); double fwhm_e = numeric_fwhm(min, max, &pdf, 1); - uncert fwhm_o = bootstrap_fwhm(r, min, max, sample, samples, 100); + uncert fwhm_o = bootstrap_fwhm(r, min, max, sample, samples, boots); // print the results fprintf(stderr, "\n## Results\n"); @@ -131,7 +133,7 @@ int main(int argc, char** argv) { */ fprintf(stderr, "\n\n# Median comparison\n"); double med_e = landau_qdf(0.5); - uncert med_o = bootstrap_median(r, sample, samples, 100); + uncert med_o = bootstrap_median(r, sample, samples, boots); // print the results fprintf(stderr, "\n## Results\n");