From 6ebe3d0004ac8b19cf4a6fcfc3b2fba16bdc6b97 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 11 Feb 2021 15:31:16 +0530 Subject: Pass extent-oracle-t as pointer. * include/extent-sampling.h (volume, volume_window, integral, volume_cone, volume_experiment): Pass extent_oracle_t as pointer. * src/extent-sampling.sc: Likewise. --- include/extent-sampling.h | 10 +++++----- src/extent-sampling.sc | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/extent-sampling.h b/include/extent-sampling.h index fd11bc4..27314a3 100644 --- a/include/extent-sampling.h +++ b/include/extent-sampling.h @@ -15,27 +15,27 @@ typedef double (*integrand_t) (double, const gsl_vector*); void init_random (void); double volume -(extent_oracle_t extent_oracle, double true_volume, +(extent_oracle_t *extent_oracle, double true_volume, const gsl_rng* r, unsigned int dimension, double rtol, gsl_rstat_workspace* stats); double volume_window -(extent_oracle_t extent_oracle, double true_volume, +(extent_oracle_t *extent_oracle, double true_volume, const gsl_rng* r, unsigned int dimension, double rtol, unsigned int* number_of_samples); double integral -(integrand_t integrand, extent_oracle_t extent_oracle, double true_integral, +(integrand_t integrand, extent_oracle_t *extent_oracle, double true_integral, const gsl_rng* r, unsigned int dimension, double rtol, gsl_rstat_workspace* stats); double volume_cone -(extent_oracle_t extent_oracle, const gsl_rng* r, +(extent_oracle_t *extent_oracle, const gsl_rng* r, const gsl_vector* mean, double omega_min, double omega_max, unsigned int number_of_samples, double* variance); double volume_experiment -(extent_oracle_t extent_oracle, const gsl_rng* r, +(extent_oracle_t *extent_oracle, const gsl_rng* r, const gsl_vector* mean, unsigned int samples_per_cone, double solid_angle_factor, double solid_angle_threshold_exponent_factor, unsigned int* number_of_samples); diff --git a/src/extent-sampling.sc b/src/extent-sampling.sc index b54c44b..c91c46c 100644 --- a/src/extent-sampling.sc +++ b/src/extent-sampling.sc @@ -26,13 +26,13 @@ body ...)) (sc-define-syntax (invoke-extent-oracle extent-oracle r x) - ((struct-get extent-oracle oracle) r x (struct-get extent-oracle params))) + ((: extent-oracle oracle) r x (: extent-oracle params))) (pre-define CONFIDENCE-INTERVAL-FACTOR 1.96) (pre-let* (VOLUME-MINIMUM-SAMPLES 100) (define (volume extent-oracle true-volume r dimension rtol stats) - (double extent-oracle-t double (const gsl-rng*) (unsigned int) double gsl-rstat-workspace*) + (double extent-oracle-t* double (const gsl-rng*) (unsigned int) double gsl-rstat-workspace*) (declare volume double) (let* ((vn double (ln-volume-of-ball dimension))) (with-vector x dimension @@ -49,7 +49,7 @@ (return volume))) (define (volume-window extent-oracle true-volume r dimension rtol number-of-samples) - (double extent-oracle-t double (const gsl-rng*) (unsigned int) double (unsigned int*)) + (double extent-oracle-t* double (const gsl-rng*) (unsigned int) double (unsigned int*)) (declare volume double) (let* ((vn double (ln-volume-of-ball dimension)) ;; This is the window length used in Volume.m of @@ -97,7 +97,7 @@ (pre-let* (INTEGRAL-MINIMUM-SAMPLES 100) (define (integral integrand extent-oracle true-integral r dimension rtol stats) - (double integrand-t extent-oracle-t double (const gsl-rng*) (unsigned int) double gsl-rstat-workspace*) + (double integrand-t extent-oracle-t* double (const gsl-rng*) (unsigned int) double gsl-rstat-workspace*) (declare integral double error double) (with-vector x dimension @@ -119,7 +119,7 @@ (return integral))) (define (volume-cone extent-oracle r mean omega-min omega-max number-of-samples variance) - (double extent-oracle-t (const gsl-rng*) (const gsl-vector*) double double (unsigned int) double*) + (double extent-oracle-t* (const gsl-rng*) (const gsl-vector*) double double (unsigned int) double*) (declare volume double) (let* ((dimension (unsigned int) (: mean size)) (vn double (ln-volume-of-ball dimension)) @@ -139,7 +139,7 @@ (define (volume-experiment extent-oracle r mean samples-per-cone solid-angle-factor solid-angle-threshold-exponent-factor number-of-samples) - (double extent-oracle-t (const gsl-rng*) (const gsl-vector*) + (double extent-oracle-t* (const gsl-rng*) (const gsl-vector*) (unsigned int) double double (unsigned int*)) (define volume double 0 -- cgit v1.2.3