diff options
-rw-r--r-- | include/utils.h | 1 | ||||
-rw-r--r-- | scm/extent-sampling/wrap.scm | 10 | ||||
-rw-r--r-- | src/utils.sc | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/include/utils.h b/include/utils.h index e28ee91..5cec86c 100644 --- a/include/utils.h +++ b/include/utils.h @@ -10,7 +10,6 @@ double volume_of_ball (unsigned int dimension); double ln_volume_of_ball (unsigned int dimension); double surface_area_of_ball (unsigned int dimension); double ln_surface_area_of_ball (unsigned int dimension); -double lower_incomplete_gamma (double s, double x); double angle_between_vectors (const gsl_vector* x, const gsl_vector* y); double dot_product (const gsl_vector* x, const gsl_vector* y); diff --git a/scm/extent-sampling/wrap.scm b/scm/extent-sampling/wrap.scm index 65fd7ad..0e32452 100644 --- a/scm/extent-sampling/wrap.scm +++ b/scm/extent-sampling/wrap.scm @@ -30,6 +30,16 @@ (dynamic-func "surface_area_of_ball" lib-extentsampling) (list int))) +(define-public (lower-incomplete-gamma s x) + (* ((pointer->procedure double + (dynamic-func "gsl_sf_gamma" lib-gsl) + (list double)) + s) + ((pointer->procedure double + (dynamic-func "gsl_sf_gamma_inc_P" lib-gsl) + (list double double)) + s x))) + (define-public angle-between-vectors (pointer->procedure double (dynamic-func "angle_between_vectors" lib-extentsampling) diff --git a/src/utils.sc b/src/utils.sc index a481109..3d96b40 100644 --- a/src/utils.sc +++ b/src/utils.sc @@ -39,10 +39,6 @@ sphere, etc." 2 corresponds to a circle, 3 corresponds to a sphere, etc." (return (* dimension (volume-of-ball dimension)))) -(define (lower-incomplete-gamma s x) (double double double) - (return (* (gsl-sf-gamma s) - (gsl-sf-gamma-inc-P s x)))) - (define (angle-between-vectors x y) (double (const gsl-vector*) (const gsl-vector*)) "Return the angle between vectors X and Y. The returned value is in the range [0,pi]." |