From ca38a1520726cd7532407e9ca969cc102216d667 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 26 Feb 2021 16:03:47 +0530 Subject: Remove unused neval variable. * src/extent-sampling.sc (integral-per-direction): Remove neval from function arguments. (integral): Adjust integral-per-direction function call. --- src/extent-sampling.sc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/extent-sampling.sc b/src/extent-sampling.sc index 69ea0a7..2110243 100644 --- a/src/extent-sampling.sc +++ b/src/extent-sampling.sc @@ -75,10 +75,9 @@ ((: 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*) + (define (integral-per-direction integrand direction r n radius rtol) + (double integrand-t* (const gsl-vector*) (const gsl-rng*) (unsigned int) double double) (define (f r params) (double double void*) - (set+ (pointer-get neval) 1) (return (* (gsl-pow-uint r (- n 1)) (invoke-integrand integrand r direction)))) (declare gsl-f (struct-variable gsl-function (function (address-of f))) @@ -107,12 +106,10 @@ (do-while (or (> error rtol) (> (rerror integral true-integral) rtol) (< (gsl-rstat-n stats) INTEGRAL-MINIMUM-SAMPLES)) - ;; TODO: If this neval is not used anywhere, remove it. - (let* ((neval int 0)) - (random-direction-vector r x) - (gsl-rstat-add (integral-per-direction integrand x r dimension - (invoke-extent-oracle extent-oracle r x) rtol (address-of neval)) - stats)) + (random-direction-vector r x) + (gsl-rstat-add (integral-per-direction integrand x r dimension + (invoke-extent-oracle extent-oracle r x) rtol) + stats) (set integral (gsl-rstat-mean stats)) (set error (/ (* CONFIDENCE-INTERVAL-FACTOR (gsl-rstat-sd-mean stats)) integral)))) -- cgit v1.2.3