From 50a7e81541b7b10a09df6cf5e85e8569ea3cec77 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 23 Feb 2021 16:09:02 +0530 Subject: Wrap gsl polynomial evaluation function. * scm/extent-sampling/wrap.scm (polyval): New function. --- scm/extent-sampling/wrap.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scm/extent-sampling/wrap.scm b/scm/extent-sampling/wrap.scm index 63d3d9e..65fd7ad 100644 --- a/scm/extent-sampling/wrap.scm +++ b/scm/extent-sampling/wrap.scm @@ -158,6 +158,16 @@ (dynamic-func "gsl_rstat_n" lib-extentsampling) (list '*))) +;; Polynomial functions + +(define-public (polyval coefficients x) + ((pointer->procedure double + (dynamic-func "gsl_poly_eval" lib-gsl) + (list '* int double)) + (bytevector->pointer (list->typed-array 'f64 1 coefficients)) + (length coefficients) + x)) + ;; nd-random (define-public (random-direction-vector dimension) -- cgit v1.2.3