Starting November 9th, common-lisp.net's Gitlab instance has implemented a more open account policy, allowing anyone with a GitHub or Google account to create an account on our instance.

At the same time, the login policy has started to require 2-factor authentication (2FA).

See https://mailman.common-lisp.net/pipermail/clo-devel/2018-October/001232.html for discussion.

Commit 18e08e4e authored by Liam M. Healy's avatar Liam M. Healy

Foreign structure with CFFI's new syntax

Specify the foreign structures with CFFI's new syntax, (:struct foo),
and fix #'creturn-st so that it will not take :struct (or any other
keyword) as a return variable name.  GSLL now compiles and loads
without error or warning, but it has not been tested.
parent 121e475d
;; Expand the body of a defmfun
;; Liam Healy 2009-04-13 22:07:13EDT body-expand.lisp
;; Time-stamp: <2011-10-29 18:52:05EDT body-expand.lisp>
;; Time-stamp: <2011-10-30 00:35:29EDT body-expand.lisp>
;;
;; Copyright 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -22,13 +22,16 @@
(defun creturn-st (c-return)
"The symbol-type of the return from the C function."
(grid:make-st
(if (listp c-return)
(grid:st-symbol c-return)
(make-symbol "CRETURN"))
(if (member c-return *special-c-return*)
:int
(if (listp c-return) (grid:st-type c-return) c-return))))
(let ((supplied-symbol-p ; return symbol supplied
(and (listp c-return) ; accommodate (:struct foo) type spec
(not (eq (symbol-package (first c-return)) (find-package :keyword))))))
(grid:make-st
(if supplied-symbol-p
(grid:st-symbol c-return)
(make-symbol "CRETURN"))
(if (member c-return *special-c-return*)
:int
(if supplied-symbol-p (grid:st-type c-return) c-return)))))
(defun cl-convert-form (decl)
"Generate a form that calls the appropriate converter from C/GSL to CL."
......
This diff is collapsed.
;; Polynomials
;; Liam Healy, Tue Mar 21 2006 - 18:33
;; Time-stamp: <2011-01-10 17:47:56EST polynomial.lisp>
;; Time-stamp: <2011-10-29 23:21:19EDT polynomial.lisp>
;;
;; Copyright 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -47,11 +47,11 @@
&key)
"gsl_poly_complex_eval"
(((grid:foreign-pointer coefficients) :pointer) ((dim0 coefficients) sizet)
(x grid:complex-double-c))
(x (:struct grid:complex-double-c)))
:definition :method
:gsl-version (1 11)
:inputs (coefficients)
:c-return grid:complex-double-c
:c-return (:struct grid:complex-double-c)
:documentation ; FDL
"Evaluate the polyonomial with coefficients at the complex value x.")
......@@ -61,11 +61,11 @@
&key)
"gsl_complex_poly_complex_eval"
(((grid:foreign-pointer coefficients) :pointer) ((dim0 coefficients) sizet)
(x grid:complex-double-c))
(x (:struct grid:complex-double-c)))
:definition :method
:gsl-version (1 11)
:inputs (coefficients)
:c-return grid:complex-double-c
:c-return (:struct grid:complex-double-c)
:documentation ; FDL
"Evaluate the polyonomial with coefficients at the complex value x.")
......@@ -128,7 +128,8 @@
(defmfun solve-quadratic-complex (a b c)
"gsl_poly_complex_solve_quadratic"
((a :double) (b :double) (c :double)
(root1 (:pointer grid:complex-double-c)) (root2 (:pointer grid:complex-double-c)))
(root1 (:pointer (:struct grid:complex-double-c)))
(root2 (:pointer (:struct grid:complex-double-c))))
:c-return :number-of-answers
:documentation ; FDL
"The complex roots of the quadratic equation a x^2 + b x + c = 0.
......@@ -154,8 +155,9 @@
(defmfun solve-cubic-complex (a b c)
"gsl_poly_complex_solve_cubic"
((a :double) (b :double) (c :double)
(root1 (:pointer grid:complex-double-c)) (root2 (:pointer grid:complex-double-c))
(root3 (:pointer grid:complex-double-c)))
(root1 (:pointer (:struct grid:complex-double-c)))
(root2 (:pointer (:struct grid:complex-double-c)))
(root3 (:pointer (:struct grid:complex-double-c))))
:c-return :number-of-answers
:documentation ; FDL
"Find the complex roots of the cubic equation, x^3 + a x^2 + b x + c = 0
......
;; Airy functions
;; Liam Healy, Fri Mar 17 2006 - 18:41
;; Time-stamp: <2009-12-27 10:10:07EST airy.lisp>
;; Time-stamp: <2011-10-29 23:30:34EDT airy.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -25,69 +25,77 @@
;;;;****************************************************************************
(defmfun airy-Ai (x &optional (mode :double))
"gsl_sf_airy_Ai_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Ai_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Airy function Ai(x).")
(defmfun airy-Bi (x &optional (mode :double))
"gsl_sf_airy_Bi_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Bi_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Airy function Bi(x).")
(defmfun airy-Ai-scaled (x &optional (mode :double))
"gsl_sf_airy_Ai_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Ai_scaled_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The scaled Airy function S_A(x) Ai(x).
For x>0 the scaling factor S_A(x) is \exp(+(2/3) x^(3/2)),
and is 1 for x<0.")
(defmfun airy-Bi-scaled (x &optional (mode :double))
"gsl_sf_airy_Bi_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Bi_scaled_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The scaled Airy function S_B(x) Bi(x).
For x>0 the scaling factor S_B(x) is exp(-(2/3) x^(3/2)),
and is 1 for x<0.")
(defmfun airy-Ai-deriv (x &optional (mode :double))
"gsl_sf_airy_Ai_deriv_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Ai_deriv_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Airy function derivative Ai'(x).")
(defmfun airy-Bi-deriv (x &optional (mode :double))
"gsl_sf_airy_Bi_deriv_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Bi_deriv_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation "The Airy function derivative Bi'(x).")
(defmfun airy-Ai-deriv-scaled (x &optional (mode :double))
"gsl_sf_airy_Ai_deriv_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Ai_deriv_scaled_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The scaled Airy function derivative S_A(x) Ai'(x).
For x>0 the scaling factor S_A(x) is exp(+(2/3) x^(3/2)),
and is 1 for x<0.")
(defmfun airy-Bi-deriv-scaled (x &optional (mode :double))
"gsl_sf_airy_Bi_deriv_scaled_e" ((x :double) (mode sf-mode) (ret sf-result))
"gsl_sf_airy_Bi_deriv_scaled_e"
((x :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The scaled Airy function derivative S_B(x) Bi'(x).
For x>0 the scaling factor S_B(x) is
exp(-(2/3) x^(3/2)), and is 1 for x<0.")
(defmfun airy-zero-Ai (s)
"gsl_sf_airy_zero_Ai_e" ((s sizet) (ret sf-result))
"gsl_sf_airy_zero_Ai_e" ((s sizet) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The location of the s-th zero of the Airy function Ai(x).")
(defmfun airy-zero-Bi (s)
"gsl_sf_airy_zero_Bi_e" ((s sizet) (ret sf-result))
"gsl_sf_airy_zero_Bi_e" ((s sizet) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The location of the s-th zero of the Airy function Bi(x).")
(defmfun airy-zero-Ai-deriv (s)
"gsl_sf_airy_zero_Ai_deriv_e" ((s sizet) (ret sf-result))
"gsl_sf_airy_zero_Ai_deriv_e" ((s sizet) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The location of the s-th zero of the Airy function derivative Ai'(x).")
(defmfun airy-zero-Bi-deriv (s)
"gsl_sf_airy_zero_Bi_deriv_e" ((s sizet) (ret sf-result))
"gsl_sf_airy_zero_Bi_deriv_e" ((s sizet) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The location of the s-th zero of the Airy function derivative Bi'(x).")
......
This diff is collapsed.
;; Clausen function
;; Liam Healy, Sat Mar 18 2006 - 23:18
;; Time-stamp: <2009-12-27 10:10:07EST clausen.lisp>
;; Time-stamp: <2011-10-29 23:31:30EDT clausen.lisp>
;;
;; Copyright 2006, 2007, 2008 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
(in-package :gsl)
(defmfun clausen (x)
"gsl_sf_clausen_e" ((x :double) (ret sf-result))
"gsl_sf_clausen_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Clausen integral Cl_2(x).")
......
;; Coulumb functions
;; Liam Healy, Sat Mar 18 2006 - 23:23
;; Time-stamp: <2011-10-23 22:04:09EDT coulomb.lisp>
;; Time-stamp: <2011-10-29 23:32:13EDT coulomb.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -27,14 +27,15 @@
;;;;****************************************************************************
(defmfun hydrogenicR-1 (x r)
"gsl_sf_hydrogenicR_1_e" ((x :double) (r :double) (ret sf-result))
"gsl_sf_hydrogenicR_1_e"
((x :double) (r :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The lowest-order normalized hydrogenic bound state radial
wavefunction R_1 := 2Z \sqrt{Z} \exp(-Z r).")
(defmfun hydrogenicR (n l x r)
"gsl_sf_hydrogenicR_e"
((n :int) (l :int) (x :double) (r :double) (ret sf-result))
((n :int) (l :int) (x :double) (r :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The n-th normalized hydrogenic bound state radial wavefunction,
R_n := {2 Z^{3/2} \over n^2} \left({2Z \over n}\right)^l
......@@ -49,7 +50,8 @@
(defmfun coulomb-wave-FG (eta x L-F k)
"gsl_sf_coulomb_wave_FG_e"
((eta :double) (x :double) (L-F :double) (k :int)
(F sf-result) (Fp sf-result) (G sf-result) (Gp sf-result)
(F (:pointer (:struct sf-result))) (Fp (:pointer (:struct sf-result)))
(G (:pointer (:struct sf-result))) (Gp (:pointer (:struct sf-result)))
(exp-F (:pointer :double)) (exp-G (:pointer :double)))
:return
((let ((vl (multiple-value-list (values-with-errors F Fp G Gp))))
......@@ -150,7 +152,8 @@
;;;;****************************************************************************
(defmfun coulomb-CL (L eta)
"gsl_sf_coulomb_CL_e" ((L :double) (eta :double) (ret sf-result))
"gsl_sf_coulomb_CL_e"
((L :double) (eta :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Coulomb wave function normalization constant C_L(\eta)
for L > -1.")
......
;; Coupling coefficients
;; Liam Healy, Sun Mar 19 2006 - 13:30
;; Time-stamp: <2009-12-27 10:10:06EST coupling.lisp>
;; Time-stamp: <2011-10-29 23:24:21EDT coupling.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -35,7 +35,7 @@ section are declared in the header file gsl_sf_coupling.h.
"gsl_sf_coupling_3j_e"
((two-ja :int) (two-jb :int) (two-jc :int)
(two-ma :int) (two-mb :int) (two-mc :int)
(ret sf-result))
(ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Wigner 3-j coefficient,
\pmatrix{ja & jb & jc\cr
......@@ -47,7 +47,7 @@ section are declared in the header file gsl_sf_coupling.h.
"gsl_sf_coupling_6j_e"
((two-ja :int) (two-jb :int) (two-jc :int)
(two-jd :int) (two-je :int) (two-jf :int)
(ret sf-result))
(ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Wigner 6-j coefficient,
ja & jb & jc
......@@ -61,7 +61,7 @@ section are declared in the header file gsl_sf_coupling.h.
((two-ja :int) (two-jb :int) (two-jc :int)
(two-jd :int) (two-je :int) (two-jf :int)
(two-jg :int) (two-jh :int) (two-ji :int)
(ret sf-result))
(ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Wigner 9-j coefficient,
ja & jb & jc
......
;; Dawson function
;; Liam Healy, Sun Mar 19 2006 - 14:31
;; Time-stamp: <2009-12-27 10:10:06EST dawson.lisp>
;; Time-stamp: <2011-10-29 23:34:56EDT dawson.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -29,7 +29,7 @@ gsl_sf_dawson.h.
(in-package :gsl)
(defmfun dawson (x)
"gsl_sf_dawson_e" ((x :double) (ret sf-result))
"gsl_sf_dawson_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"Dawson's integral for x.")
......
;; Deybe functions
;; Liam Healy, Sun Mar 19 2006 - 14:34
;; Time-stamp: <2009-12-27 10:10:05EST debye.lisp>
;; Time-stamp: <2011-10-29 23:35:07EDT debye.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -29,24 +29,24 @@ Stegun, Section 27.1.
(in-package :gsl)
(defmfun debye-1 (x)
"gsl_sf_debye_1_e" ((x :double) (ret sf-result))
"gsl_sf_debye_1_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The first-order Debye function D_1(x) = (1/x) \int_0^x dt (t/(e^t - 1)).")
(defmfun debye-2 (x)
"gsl_sf_debye_2_e" ((x :double) (ret sf-result))
"gsl_sf_debye_2_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The second-order Debye function
D_2(x) = (2/x^2) \int_0^x dt (t^2/(e^t - 1)).")
(defmfun debye-3 (x)
"gsl_sf_debye_3_e" ((x :double) (ret sf-result))
"gsl_sf_debye_3_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The third-order Debye function
D_3(x) = (3/x^3) \int_0^x dt (t^3/(e^t - 1)).")
(defmfun debye-4 (x)
"gsl_sf_debye_4_e" ((x :double) (ret sf-result))
"gsl_sf_debye_4_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The fourth-order Debye function
D_4(x) = (4/x^4) \int_0^x dt (t^4/(e^t - 1)).")
......
;; Dilogarithm
;; Liam Healy, Fri Mar 17 2006 - 18:44
;; Time-stamp: <2010-12-04 11:51:29EST dilogarithm.lisp>
;; Time-stamp: <2011-10-29 23:35:35EDT dilogarithm.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009, 2010 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2010, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -27,12 +27,15 @@
"The dilogarithm."))
(defmfun dilogarithm ((x float))
"gsl_sf_dilog_e" ((x :double) (ret sf-result))
"gsl_sf_dilog_e" ((x :double) (ret (:pointer (:struct sf-result))))
:definition :method)
(defmfun dilogarithm ((x complex))
"gsl_sf_complex_dilog_e"
(((abs x) :double) ((phase x) :double) (re sf-result) (im sf-result))
(((abs x) :double)
((phase x) :double)
(re (:pointer (:struct sf-result)))
(im (:pointer (:struct sf-result))))
:definition :method
:return ((complex-with-error re im)))
......
;; Elementary functions
;; Liam Healy, Mon Mar 20 2006 - 21:43
;; Time-stamp: <2009-12-27 10:10:05EST elementary.lisp>
;; Time-stamp: <2011-10-29 23:35:51EDT elementary.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -22,13 +22,14 @@
(defmfun multiply (x y)
"gsl_sf_multiply_e"
((x :double) (y :double) (ret sf-result))
((x :double) (y :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"Multiplies x and y returning the product and associated error.")
(defmfun multiply-err (x dx y dy)
"gsl_sf_multiply_err_e"
((x :double) (dx :double) (y :double) (dy :double) (ret sf-result))
((x :double) (dx :double) (y :double) (dy :double)
(ret (:pointer (:struct sf-result))))
:documentation ; FDL
"Multiplies x and y with associated absolute
errors dx and dy. The product xy +/- xy \sqrt((dx/x)^2 +(dy/y)^2)
......
;; Elliptic integrals
;; Liam Healy, Mon Mar 20 2006 - 21:50
;; Time-stamp: <2009-12-27 10:10:04EST elliptic-integrals.lisp>
;; Time-stamp: <2011-10-29 23:36:10EDT elliptic-integrals.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -25,14 +25,14 @@
;;;;****************************************************************************
(defmfun elliptic-integral-K-complete (k &optional (mode :double))
"gsl_sf_ellint_Kcomp_e" ((k :double) (mode sf-mode) (ret sf-result))
"gsl_sf_ellint_Kcomp_e" ((k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The complete elliptic integral of the first kind, K(k). Note that
Abramowitz & Stegun define this function in terms of the parameter m
= k^2.")
(defmfun elliptic-integral-E-complete (k &optional (mode :double))
"gsl_sf_ellint_Ecomp_e" ((k :double) (mode sf-mode) (ret sf-result))
"gsl_sf_ellint_Ecomp_e" ((k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The complete elliptic integral of the second kind, E(k).
Note that Abramowitz & Stegun define this function in terms of the
......@@ -43,14 +43,14 @@
;;;;****************************************************************************
(defmfun elliptic-integral-F (phi k &optional (mode :double))
"gsl_sf_ellint_F_e" ((phi :double) (k :double) (mode sf-mode) (ret sf-result))
"gsl_sf_ellint_F_e" ((phi :double) (k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral of the first kind, F(phi,k). Note
that Abramowitz & Stegun define this function in terms of the
parameter m = k^2.")
(defmfun elliptic-integral-E (phi k &optional (mode :double))
"gsl_sf_ellint_E_e" ((phi :double) (k :double) (mode sf-mode) (ret sf-result))
"gsl_sf_ellint_E_e" ((phi :double) (k :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral of the second kind, E(phi,k). Note
that Abramowitz & Stegun define this function in terms of the
......@@ -58,7 +58,7 @@
(defmfun elliptic-integral-P (phi k n &optional (mode :double))
"gsl_sf_ellint_P_e"
((phi :double) (k :double) (n :double) (mode sf-mode) (ret sf-result))
((phi :double) (k :double) (n :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral of the third kind, P(phi,k,n).
Note that Abramowitz & Stegun define this function in terms of the
......@@ -67,7 +67,7 @@
(defmfun elliptic-integral-D (phi k n &optional (mode :double))
"gsl_sf_ellint_D_e"
((phi :double) (k :double) (n :double) (mode sf-mode) (ret sf-result))
((phi :double) (k :double) (n :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral D(phi,k,n) which is
defined through the Carlson form RD(x,y,z)
......@@ -79,25 +79,26 @@
;;;;****************************************************************************
(defmfun elliptic-integral-RC (x y &optional (mode :double))
"gsl_sf_ellint_RC_e" ((x :double) (y :double) (mode sf-mode) (ret sf-result))
"gsl_sf_ellint_RC_e" ((x :double) (y :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral RC(x,y).")
(defmfun elliptic-integral-RD (x y z &optional (mode :double))
"gsl_sf_ellint_RD_e"
((x :double) (y :double) (z :double) (mode sf-mode) (ret sf-result))
((x :double) (y :double) (z :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral RD(x,y,z).")
(defmfun elliptic-integral-RF (x y z &optional (mode :double))
"gsl_sf_ellint_RF_e"
((x :double) (y :double) (z :double) (mode sf-mode) (ret sf-result))
((x :double) (y :double) (z :double) (mode sf-mode) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral RF(x,y,z).")
(defmfun elliptic-integral-RJ (x y z p &optional (mode :double))
"gsl_sf_ellint_RJ_e"
((x :double) (y :double) (z :double) (p :double) (mode sf-mode) (ret sf-result))
((x :double) (y :double) (z :double) (p :double) (mode sf-mode)
(ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The incomplete elliptic integral RJ(x,y,z,p).")
......
;; Error functions
;; Liam Healy, Mon Mar 20 2006 - 22:31
;; Time-stamp: <2009-12-27 10:10:04EST error-functions.lisp>
;; Time-stamp: <2011-10-29 23:36:27EDT error-functions.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -21,36 +21,36 @@
(in-package :gsl)
(defmfun erf (x)
"gsl_sf_erf_e" ((x :double) (ret sf-result))
"gsl_sf_erf_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The error function erf(x), where
erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2).")
(defmfun erfc (x)
"gsl_sf_erfc_e" ((x :double) (ret sf-result))
"gsl_sf_erfc_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The complementary error function
erfc(x) = 1 - erf(x) = (2/\sqrt(\pi)) \int_x^\infty \exp(-t^2).")
(defmfun log-erfc (x)
"gsl_sf_log_erfc_e" ((x :double) (ret sf-result))
"gsl_sf_log_erfc_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The logarithm of the complementary error function \log(\erfc(x)).")
(defmfun erf-Z (x)
"gsl_sf_erf_Z_e" ((x :double) (ret sf-result))
"gsl_sf_erf_Z_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The Gaussian probability density function
Z(x) = (1/sqrt{2\pi}) \exp(-x^2/2)}.")
(defmfun erf-Q (x)
"gsl_sf_erf_Q_e" ((x :double) (ret sf-result))
"gsl_sf_erf_Q_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The upper tail of the Gaussian probability function
Q(x) = (1/\sqrt{2\pi}) \int_x^\infty dt \exp(-t^2/2)}.")
(defmfun hazard (x)
"gsl_sf_hazard_e" ((x :double) (ret sf-result))
"gsl_sf_hazard_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The hazard function for the normal distribution.")
......
;; Exponential functions
;; Liam Healy, Tue Mar 21 2006 - 17:05
;; Time-stamp: <2010-05-31 23:32:15EDT exponential-functions.lisp>
;; Time-stamp: <2011-10-29 23:37:02EDT exponential-functions.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -25,7 +25,7 @@
;;;;****************************************************************************
(defmfun gsl-exp (x)
"gsl_sf_exp_e" ((x :double) (ret sf-result))
"gsl_sf_exp_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The exponential function.")
......@@ -36,7 +36,8 @@
of exp(x) would overflow the numeric range of double.")
(defmfun exp-mult (x y)
"gsl_sf_exp_mult_e" ((x :double) (y :double) (ret sf-result))
"gsl_sf_exp_mult_e"
((x :double) (y :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"Exponentiate x and multiply by the factor y to
return the product y \exp(x).")
......@@ -51,26 +52,26 @@
;;;;****************************************************************************
(defmfun expm1 (x)
"gsl_sf_expm1_e" ((x :double) (ret sf-result))
"gsl_sf_expm1_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"\exp(x)-1 using an algorithm that is accurate for small x.")
(defmfun exprel (x)
"gsl_sf_exprel_e" ((x :double) (ret sf-result))
"gsl_sf_exprel_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"(\exp(x)-1)/x using an algorithm that is accurate for small x.
For small x the algorithm is based on the expansion
(\exp(x)-1)/x = 1 + x/2 + x^2/(2*3) + x^3/(2*3*4) + ...")
(defmfun exprel-2 (x)
"gsl_sf_exprel_2_e" ((x :double) (ret sf-result))
"gsl_sf_exprel_2_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"2(\exp(x)-1-x)/x^2 using an algorithm that is accurate for small
x. For small x the algorithm is based on the expansion
2(\exp(x)-1-x)/x^2 = 1 + x/3 + x^2/(3*4) + x^3/(3*4*5) + ...")
(defmfun exprel-n (n x)
"gsl_sf_exprel_n_e" ((n :int) (x :double) (ret sf-result))
"gsl_sf_exprel_n_e" ((n :int) (x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"N-relative exponential, which is the n-th generalization
of the functions #'exprel and #'exprel-2.")
......@@ -80,7 +81,8 @@
;;;;****************************************************************************
(defmfun exp-err (x dx)
"gsl_sf_exp_err_e" ((x :double) (dx :double) (ret sf-result))
"gsl_sf_exp_err_e"
((x :double) (dx :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"Exponentiate x with an associated absolute error dx.")
......@@ -93,7 +95,8 @@
(defmfun exp-mult-err (x dx y dy)
"gsl_sf_exp_mult_err_e"
((x :double) (dx :double) (y :double) (dy :double) (ret sf-result))
((x :double) (dx :double) (y :double) (dy :double)
(ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The product y \exp(x) for the quantities x, y
with associated absolute errors dx, dy.")
......
;; Exponential integrals
;; Liam Healy, Tue Mar 21 2006 - 17:37
;; Time-stamp: <2009-12-27 10:10:03EST exponential-integrals.lisp>
;; Time-stamp: <2011-10-29 23:38:04EDT exponential-integrals.lisp>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009, 2011 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
......@@ -25,19 +25,20 @@
;;;;****************************************************************************
(defmfun exponential-integral-E1 (x)
"gsl_sf_expint_E1_e" ((x :double) (ret sf-result))
"gsl_sf_expint_E1_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The exponential integral
E_1(x)}, E_1(x) := \Re \int_1^\infty dt \exp(-xt)/t..")
(defmfun exponential-integral-E2 (x)
"gsl_sf_expint_E2_e" ((x :double) (ret sf-result))
"gsl_sf_expint_E2_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The second-order exponential integral
E_2(x)}, E_2(x) := \Re \int_1^\infty dt \exp(-xt)/t^2.")
(defmfun exponential-integral-En (n x)
"gsl_sf_expint_En_e" ((n :int) (x :double) (ret sf-result))
"gsl_sf_expint_En_e"
((n :int) (x :double) (ret (:pointer (:struct sf-result))))
:gsl-version (1 10)
:documentation ; FDL
"The exponential integral E_n(x) of order n,
......@@ -49,7 +50,7 @@
;;;;****************************************************************************
(defmfun exponential-integral-Ei (x)
"gsl_sf_expint_Ei_e" ((x :double) (ret sf-result))
"gsl_sf_expint_Ei_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The exponential integral Ei(x),
Ei(x) := - PV\left(\int_{-x}^\infty dt \exp(-t)/t\right).")
......@@ -59,12 +60,12 @@
;;;;****************************************************************************
(defmfun Shi (x)
"gsl_sf_Shi_e" ((x :double) (ret sf-result))
"gsl_sf_Shi_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The integral Shi(x) = \int_0^x dt \sinh(t)/t.")
(defmfun Chi (x)
"gsl_sf_Chi_e" ((x :double) (ret sf-result))
"gsl_sf_Chi_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The integral
Chi(x) := \Re[ \gamma_E + \log(x) + \int_0^x dt (\cosh[t]-1)/t],
......@@ -75,7 +76,7 @@
;;;;****************************************************************************
(defmfun exponential-integral-3 (x)
"gsl_sf_expint_3_e" ((x :double) (ret sf-result))
"gsl_sf_expint_3_e" ((x :double) (ret (:pointer (:struct sf-result))))
:documentation ; FDL
"The third-order exponential integral Ei_3(x) = \int_0^xdt \exp(-t^3)
for x >= 0.")
......@@ -85,12 +86,12 @@
;;;;****************************************************************************