diff options
Diffstat (limited to 'scm')
-rw-r--r-- | scm/nsmc/load-libs.scm.in (renamed from scm/extent-sampling/load-libs.scm.in) | 6 | ||||
-rw-r--r-- | scm/nsmc/wrap.scm (renamed from scm/extent-sampling/wrap.scm) | 52 |
2 files changed, 29 insertions, 29 deletions
diff --git a/scm/extent-sampling/load-libs.scm.in b/scm/nsmc/load-libs.scm.in index 1b99e53..cd2fbe3 100644 --- a/scm/extent-sampling/load-libs.scm.in +++ b/scm/nsmc/load-libs.scm.in @@ -1,9 +1,9 @@ -(define lib-extentsampling +(define lib-nsmc (catch #t (lambda () - (dynamic-link "@CMAKE_INSTALL_FULL_LIBDIR@/libextentsampling")) + (dynamic-link "@CMAKE_INSTALL_FULL_LIBDIR@/libnsmc")) (lambda _ - (dynamic-link "libextentsampling")))) + (dynamic-link "libnsmc")))) (define lib-gsl (catch #t diff --git a/scm/extent-sampling/wrap.scm b/scm/nsmc/wrap.scm index 306caa4..e6d9a47 100644 --- a/scm/extent-sampling/wrap.scm +++ b/scm/nsmc/wrap.scm @@ -1,4 +1,4 @@ -(define-module (extent-sampling wrap) +(define-module (nsmc wrap) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 match) @@ -17,17 +17,17 @@ (define-public pi ((pointer->procedure double - (dynamic-func "pi" lib-extentsampling) + (dynamic-func "pi" lib-nsmc) (list)))) (define-public volume-of-ball (pointer->procedure double - (dynamic-func "volume_of_ball" lib-extentsampling) + (dynamic-func "volume_of_ball" lib-nsmc) (list int))) (define-public surface-area-of-ball (pointer->procedure double - (dynamic-func "surface_area_of_ball" lib-extentsampling) + (dynamic-func "surface_area_of_ball" lib-nsmc) (list int))) (define-public (lower-incomplete-gamma s x) @@ -42,12 +42,12 @@ (define-public angle-between-vectors (pointer->procedure double - (dynamic-func "angle_between_vectors" lib-extentsampling) + (dynamic-func "angle_between_vectors" lib-nsmc) (list '* '*))) (define-public planar-angle->solid-angle (pointer->procedure double - (dynamic-func "planar_angle_to_solid_angle" lib-extentsampling) + (dynamic-func "planar_angle_to_solid_angle" lib-nsmc) (list double int))) ;; Random state @@ -138,7 +138,7 @@ ((n range bin) (let ((range (pointer->bytevector range (1+ n) 0 'f64))) ((pointer->procedure int - (dynamic-func "gsl_histogram_scale" lib-extentsampling) + (dynamic-func "gsl_histogram_scale" lib-nsmc) (list '* double)) histogram (/ n @@ -153,7 +153,7 @@ ((histogram) histogram) ((histogram input) ((pointer->procedure int - (dynamic-func "gsl_histogram_increment" lib-extentsampling) + (dynamic-func "gsl_histogram_increment" lib-nsmc) (list '* double)) histogram input) histogram))) @@ -165,7 +165,7 @@ (define-public rstat-n (pointer->procedure size_t - (dynamic-func "gsl_rstat_n" lib-extentsampling) + (dynamic-func "gsl_rstat_n" lib-nsmc) (list '*))) ;; Polynomial functions @@ -183,7 +183,7 @@ (define-public (random-direction-vector dimension) (let ((vector (vector-alloc dimension))) ((pointer->procedure void - (dynamic-func "random_direction_vector" lib-extentsampling) + (dynamic-func "random_direction_vector" lib-nsmc) (list '* '*)) %gsl-random-state vector) vector)) @@ -191,7 +191,7 @@ (define-public (subsampling-random-vector mean max-theta) (let ((vector (vector-alloc (vector-size mean)))) ((pointer->procedure void - (dynamic-func "subsampling_random_vector" lib-extentsampling) + (dynamic-func "subsampling_random_vector" lib-nsmc) (list '* '* double '*)) %gsl-random-state mean max-theta vector) vector)) @@ -200,14 +200,14 @@ (let* ((vector (vector-alloc (vector-size mean))) (cost ((pointer->procedure int - (dynamic-func "shifted_gaussian_random_vector" lib-extentsampling) + (dynamic-func "shifted_gaussian_random_vector" lib-nsmc) (list '* '* double double '*)) %gsl-random-state mean max-theta standard-deviation vector))) vector)) (define-public (shifted-gaussian-random-vector-cost mean max-theta standard-deviation) ((pointer->procedure int - (dynamic-func "shifted_gaussian_random_vector" lib-extentsampling) + (dynamic-func "shifted_gaussian_random_vector" lib-nsmc) (list '* '* double double '*)) %gsl-random-state mean max-theta standard-deviation (vector-alloc (vector-size mean)))) @@ -217,7 +217,7 @@ (define-public (shifted-gaussian-pdf theta mean max-theta standard-deviation) ((pointer->procedure double - (dynamic-func "shifted_gaussian_pdf" lib-extentsampling) + (dynamic-func "shifted_gaussian_pdf" lib-nsmc) (list double double double double unsigned-int '*)) theta (vector-norm2 mean) max-theta standard-deviation (vector-size mean) %integration-workspace)) @@ -232,12 +232,12 @@ (list p r0 r1))) (define-public (make-bernoulli-oracle p r0 r1) - (make-extent-oracle (dynamic-func "bernoulli_extent_oracle" lib-extentsampling) + (make-extent-oracle (dynamic-func "bernoulli_extent_oracle" lib-nsmc) (make-bernoulli-params p r0 r1))) (define (true-volume-procedure name) (pointer->procedure double - (dynamic-func name lib-extentsampling) + (dynamic-func name lib-nsmc) (list unsigned-int '*))) (define-public (bernoulli-true-volume p r0 r1 dimension) @@ -249,7 +249,7 @@ (list a b))) (define-public (make-uniform-oracle a b) - (make-extent-oracle (dynamic-func "uniform_extent_oracle" lib-extentsampling) + (make-extent-oracle (dynamic-func "uniform_extent_oracle" lib-nsmc) (make-uniform-params a b))) (define-public (uniform-true-volume a b dimension) @@ -261,7 +261,7 @@ (list alpha beta))) (define-public (make-beta-oracle alpha beta) - (make-extent-oracle (dynamic-func "beta_extent_oracle" lib-extentsampling) + (make-extent-oracle (dynamic-func "beta_extent_oracle" lib-nsmc) (make-beta-params alpha beta))) (define-public (beta-true-volume alpha beta dimension) @@ -272,7 +272,7 @@ (make-c-struct (list double) (list edge))) (define-public (make-cube-oracle edge) - (make-extent-oracle (dynamic-func "cube_extent_oracle" lib-extentsampling) + (make-extent-oracle (dynamic-func "cube_extent_oracle" lib-nsmc) (make-cube-params edge))) (define-public (cube-true-volume edge dimension) @@ -283,7 +283,7 @@ (make-c-struct (list double) (list eccentricity))) (define-public (make-spheroid-oracle eccentricity) - (make-extent-oracle (dynamic-func "spheroid_extent_oracle" lib-extentsampling) + (make-extent-oracle (dynamic-func "spheroid_extent_oracle" lib-nsmc) (make-spheroid-params eccentricity))) (define-public (spheroid-true-volume eccentricity dimension) @@ -297,18 +297,18 @@ (list integrand params))) (define-public (make-polynomial-integrand polynomial) - (make-integrand (dynamic-func "polynomial_integrand" lib-extentsampling) + (make-integrand (dynamic-func "polynomial_integrand" lib-nsmc) (make-c-struct (list '* int) (list (bytevector->pointer (list->typed-array 'f64 1 polynomial)) (1- (length polynomial)))))) (define-public gaussian-integrand - (make-integrand (dynamic-func "gaussian_integrand" lib-extentsampling) + (make-integrand (dynamic-func "gaussian_integrand" lib-nsmc) %null-pointer)) (define-public x-coordinate-integrand - (make-integrand (dynamic-func "x_coordinate_integrand" lib-extentsampling) + (make-integrand (dynamic-func "x_coordinate_integrand" lib-nsmc) %null-pointer)) ;; extent-sampling @@ -338,7 +338,7 @@ (define-public (volume extent-oracle true-volume dimension rtol) (let ((stats (rstat-alloc))) ((pointer->procedure double - (dynamic-func "volume" lib-extentsampling) + (dynamic-func "volume" lib-nsmc) (list '* double '* unsigned-int double '*)) (maybe-procedure->extent-oracle extent-oracle) true-volume %gsl-random-state dimension rtol stats) @@ -347,7 +347,7 @@ (define-public (volume-window extent-oracle true-volume dimension rtol) (let ((samples (make-c-struct (list unsigned-int) (list 0)))) ((pointer->procedure double - (dynamic-func "volume_window" lib-extentsampling) + (dynamic-func "volume_window" lib-nsmc) (list '* double '* unsigned-int double '*)) (maybe-procedure->extent-oracle extent-oracle) true-volume %gsl-random-state dimension rtol samples) @@ -357,7 +357,7 @@ (define-public (integral integrand extent-oracle true-integral dimension rtol) (let ((stats (rstat-alloc))) ((pointer->procedure double - (dynamic-func "integral" lib-extentsampling) + (dynamic-func "integral" lib-nsmc) (list '* '* double '* unsigned-int double '*)) (maybe-procedure->integrand integrand) (maybe-procedure->extent-oracle extent-oracle) |