aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/extent-sampling.sc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/extent-sampling.sc b/src/extent-sampling.sc
index c91c46c..69ea0a7 100644
--- a/src/extent-sampling.sc
+++ b/src/extent-sampling.sc
@@ -71,13 +71,16 @@
(gsl-rstat-n stats))))
(return volume))
+(sc-define-syntax (invoke-integrand integrand r x)
+ ((: integrand integrand) r x (: integrand params)))
+
(pre-let* (INTEGRATION-INTERVALS 1000)
(define (integral-per-direction integrand direction r n radius rtol neval)
- (double integrand-t (const gsl-vector*) (const gsl-rng*) (unsigned int) double double int*)
+ (double integrand-t* (const gsl-vector*) (const gsl-rng*) (unsigned int) double double int*)
(define (f r params) (double double void*)
(set+ (pointer-get neval) 1)
(return (* (gsl-pow-uint r (- n 1))
- (integrand r direction))))
+ (invoke-integrand integrand r direction))))
(declare gsl-f (struct-variable gsl-function (function (address-of f)))
result double
error double)
@@ -97,7 +100,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