commit 2744136d68ab1cceed4737c54c9d5ee3f02367bf
parent d78a5cd18286522b998bf287c4af7f31cade60f6
Author: NunoSempere <nuno.sempere@protonmail.com>
Date: Wed, 31 Jan 2024 15:19:12 +0100
fix: add type to squiggle_more.h; fix type
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/squiggle_more.c b/squiggle_more.c
@@ -300,13 +300,13 @@ void array_print_histogram(double* xs, int n_samples, int n_bins) {
free(bins);
}
-void array_print_90_ci_histogram(double* xs, int n){
+void array_print_90_ci_histogram(double* xs, int n_samples, int n_bins){
// Code duplicated from previous function
// I'll consider simplifying it at some future point
// Possible ideas:
// - having only one function that takes any confidence interval?
// - having a utility function that is called by both functions?
- ci ci_90 = array_get_90_ci(xs, n);
+ ci ci_90 = array_get_90_ci(xs, n_samples);
if (n_bins <= 1) {
fprintf(stderr, "Number of bins must be greater than 1.\n");
diff --git a/squiggle_more.h b/squiggle_more.h
@@ -12,8 +12,10 @@ typedef struct ci_t {
} ci;
ci array_get_ci(ci interval, double* xs, int n);
ci array_get_90_ci(double xs[], int n);
+
void array_print_stats(double xs[], int n);
void array_print_histogram(double* xs, int n_samples, int n_bins);
+void array_print_90_ci_histogram(double* xs, int n, int n_bins);
// Deprecated: get confidence intervals directly from samplers
ci sampler_get_ci(ci interval, double (*sampler)(uint64_t*), int n, uint64_t* seed);