From c9bbe9be613e0a035a4d030778d85f4effc4cfaa Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 23 Feb 2021 16:37:31 +0530 Subject: Wrap integrands. * scm/extent-sampling/wrap.scm (make-integrand, make-polynomial-integrand, gaussian-integrand, x-coordinate-integrand): New functions. --- scm/extent-sampling/wrap.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'scm') diff --git a/scm/extent-sampling/wrap.scm b/scm/extent-sampling/wrap.scm index e22e299..25b9970 100644 --- a/scm/extent-sampling/wrap.scm +++ b/scm/extent-sampling/wrap.scm @@ -290,3 +290,24 @@ ((true-volume-procedure "spheroid_true_volume") dimension (make-spheroid-params eccentricity))) +;; integrands + +(define (make-integrand integrand params) + (make-c-struct (list '* '*) + (list integrand params))) + +(define-public (make-polynomial-integrand polynomial) + (make-integrand (dynamic-func "polynomial_integrand" lib-extentsampling) + (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) + %null-pointer)) + +(define-public x-coordinate-integrand + (make-integrand (dynamic-func "x_coordinate_integrand" lib-extentsampling) + %null-pointer)) + -- cgit v1.2.3