aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-02-23 16:37:31 +0530
committerArun Isaac2021-02-23 16:37:31 +0530
commitc9bbe9be613e0a035a4d030778d85f4effc4cfaa (patch)
tree3c0369d4dddba9762a0cba586d7bddc0adb4ee65
parent1c7aaabffddeb10b2f43552ec8766d47a570464f (diff)
downloadnsmc-c9bbe9be613e0a035a4d030778d85f4effc4cfaa.tar.gz
nsmc-c9bbe9be613e0a035a4d030778d85f4effc4cfaa.tar.lz
nsmc-c9bbe9be613e0a035a4d030778d85f4effc4cfaa.zip
Wrap integrands.
* scm/extent-sampling/wrap.scm (make-integrand, make-polynomial-integrand, gaussian-integrand, x-coordinate-integrand): New functions.
-rw-r--r--scm/extent-sampling/wrap.scm21
1 files changed, 21 insertions, 0 deletions
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))
+