diff options
author | Arun Isaac | 2021-02-23 16:09:02 +0530 |
---|---|---|
committer | Arun Isaac | 2021-02-23 16:09:02 +0530 |
commit | 50a7e81541b7b10a09df6cf5e85e8569ea3cec77 (patch) | |
tree | 041cbf7912e2f662d6213bc5ce3f0ab11c1e3ec1 /scm/extent-sampling | |
parent | 13a224b6a3497b448eac4ffb86b0db707f6957a7 (diff) | |
download | nsmc-50a7e81541b7b10a09df6cf5e85e8569ea3cec77.tar.gz nsmc-50a7e81541b7b10a09df6cf5e85e8569ea3cec77.tar.lz nsmc-50a7e81541b7b10a09df6cf5e85e8569ea3cec77.zip |
Wrap gsl polynomial evaluation function.
* scm/extent-sampling/wrap.scm (polyval): New function.
Diffstat (limited to 'scm/extent-sampling')
-rw-r--r-- | scm/extent-sampling/wrap.scm | 10 |
1 files changed, 10 insertions, 0 deletions
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) |