Skip to content
Snippets Groups Projects
Commit 64409537 authored by lhealy's avatar lhealy Committed by Liam Healy
Browse files

Ported special functions to new defmfun. Rearrangement of definitions

to load correctly.


git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/branches/ffa@67 af03a46b-e846-0410-96e5-d5653c316fd0
parent 8b763e87
No related branches found
No related tags found
No related merge requests found
Showing
with 169 additions and 141 deletions
;; Functions for both vectors and matrices. ;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp ;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <2008-06-30 22:53:27EDT both.lisp> ;; Time-stamp: <2008-07-12 13:48:13EDT both.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
(defmfun m/ ((a matrix) (b matrix)) (defmfun m/ ((a matrix) (b matrix))
("gsl_" :category :type "_div_elements") ("gsl_" :category :type "_div_elements")
(((mpointer a) :pointer) ((mpointer b) :pointer)) (((mpointer a) :pointer) ((mpointer b) :pointer))
:definition :generic :definition :methods
:element-types :no-complex ; Question for GSL: why no complex? :element-types :no-complex ; Question for GSL: why no complex?
:inputs (a b) :inputs (a b)
:outputs (a) :outputs (a)
......
;; Data using ffa ;; Data using ffa
;; Liam Healy 2008-04-06 21:23:41EDT data-ffa.lisp ;; Liam Healy 2008-04-06 21:23:41EDT data-ffa.lisp
;; Time-stamp: <2008-07-07 21:26:18EDT data.lisp> ;; Time-stamp: <2008-07-12 14:19:59EDT data.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -67,15 +67,6 @@ ...@@ -67,15 +67,6 @@
:gsl) :gsl)
category)) category))
(defparameter *array-element-types*
(remove-duplicates (all-types *cstd-cl-type-mapping* t) :test 'equal)
;;(all-types ffa::*cffi-and-lisp-types* t)
"All the array element types supported.")
(defparameter *array-element-types-no-complex*
(remove-if (lambda (tp) (subtypep tp 'complex)) *array-element-types*)
"All the array element types supported except for complex types.")
(defun data-defclass (category superclass) (defun data-defclass (category superclass)
"Define all the subclasses based on the known element types." "Define all the subclasses based on the known element types."
(cons 'progn (cons 'progn
......
;; Permutations ;; Permutations
;; Liam Healy, Sun Mar 26 2006 - 11:51 ;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-07-05 14:48:43EDT permutation.lisp> ;; Time-stamp: <2008-07-12 14:12:36EDT permutation.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -17,9 +17,10 @@ ...@@ -17,9 +17,10 @@
;;; The following three forms take the place of a data-defclass call ;;; The following three forms take the place of a data-defclass call
(eval-when (:compile-toplevel :load-toplevel :execute)
(defmethod letm-expansion (defmethod letm-expansion
(symbol (type (eql 'permutation)) args body) (symbol (type (eql 'permutation)) args body)
(expand-data symbol type (first args) (second args) body)) (expand-data symbol type (first args) (second args) body)))
(arglist-only permutation (arglist-only permutation
"A permutation." "A permutation."
...@@ -88,10 +89,14 @@ ...@@ -88,10 +89,14 @@
"A pointer to the array of elements in the "A pointer to the array of elements in the
permutation p.") permutation p.")
(defgeneric data-valid (object)
(:documentation ; FDL
"Check that the object p is valid."))
(defmfun data-valid ((permutation permutation)) (defmfun data-valid ((permutation permutation))
"gsl_permutation_valid" "gsl_permutation_valid"
(((mpointer permutation) :pointer)) (((mpointer permutation) :pointer))
:definition :generic :definition :method
:c-return :boolean :c-return :boolean
:documentation ; FDL :documentation ; FDL
"Check that the permutation p is valid. The n "Check that the permutation p is valid. The n
......
;; Definition of GSLL system ;; Definition of GSLL system
;; Liam Healy ;; Liam Healy
;; Time-stamp: <2008-07-07 20:29:37EDT gsll.asd> ;; Time-stamp: <2008-07-12 14:20:01EDT gsll.asd>
;; $Id$ ;; $Id$
(asdf:defsystem "gsll" (asdf:defsystem "gsll"
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
(:file "element-types" :depends-on (init)) (:file "element-types" :depends-on (init))
(:file "number-conversion" :depends-on (init)) (:file "number-conversion" :depends-on (init))
(:file "interface" :depends-on (init conditions element-types number-conversion)) (:file "interface" :depends-on (init conditions element-types number-conversion))
(:file "defmfun" :depends-on (init)) (:file "defmfun" :depends-on (init element-types))
(:file "callback" :depends-on (init)) (:file "callback" :depends-on (init))
;; http://www.cs.northwestern.edu/academics/courses/325/readings/lisp-unit.html ;; http://www.cs.northwestern.edu/academics/courses/325/readings/lisp-unit.html
(:file "lisp-unit") (:file "lisp-unit")
...@@ -36,14 +36,13 @@ ...@@ -36,14 +36,13 @@
((:file "foreign-friendly") ((:file "foreign-friendly")
(:file "data") (:file "data")
(:file "vector" :depends-on (data)) (:file "vector" :depends-on (data))
(:file "matrix" :depends-on (data)) (:file "matrix" :depends-on (data vector))
(:file "both" :depends-on (data vector matrix)) (:file "both" :depends-on (data vector matrix))
(:file "permutation" :depends-on (data)) (:file "permutation" :depends-on (data))
(:file "combination" (:file "combination"
:depends-on (data matrix both permutation)) ; preload defgeneric :depends-on (data matrix both permutation)) ; preload defgeneric
)) ))
(:file "polynomial" :depends-on (init data)) (:file "polynomial" :depends-on (init data))
#+no
(:module special-functions (:module special-functions
:depends-on (init) :depends-on (init)
:components :components
......
;; Macro for defining GSL functions. ;; Macro for defining GSL functions.
;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp ;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp
;; Time-stamp: <2008-06-29 19:16:23EDT defmfun.lisp> ;; Time-stamp: <2008-07-08 21:37:09EDT defmfun.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
(setf indexed-functions (list)) (setf indexed-functions (list))
(wrap-index-export (wrap-index-export
(cond (cond
((member '&optional arglist) ((and (member '&optional arglist) (listp gsl-name))
(expand-defmfun-optional name arglist gsl-name c-arguments key-args)) (expand-defmfun-optional name arglist gsl-name c-arguments key-args))
((eq definition :function) ((eq definition :function)
(setf defn 'cl:defun) (setf defn 'cl:defun)
......
;; Mapping of element type names ;; Mapping of element type names
;; Liam Healy 2008-04-13 11:22:46EDT element-types.lisp ;; Liam Healy 2008-04-13 11:22:46EDT element-types.lisp
;; Time-stamp: <2008-06-29 22:40:33EDT element-types.lisp> ;; Time-stamp: <2008-07-12 14:21:59EDT element-types.lisp>
;; $Id$ ;; $Id$
;;; The different element type forms: ;;; The different element type forms:
...@@ -250,6 +250,19 @@ ...@@ -250,6 +250,19 @@
:c-return :double) :c-return :double)
|# |#
;;;;****************************************************************************
;;;; Element types
;;;;****************************************************************************
(defparameter *array-element-types*
(remove-duplicates (all-types *cstd-cl-type-mapping* t) :test 'equal)
;;(all-types ffa::*cffi-and-lisp-types* t)
"All the array element types supported.")
(defparameter *array-element-types-no-complex*
(remove-if (lambda (tp) (subtypep tp 'complex)) *array-element-types*)
"All the array element types supported except for complex types.")
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Types for CFFI (will eventually be in CFFI) ;;;; Types for CFFI (will eventually be in CFFI)
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Macros to interface GSL functions, including definitions necessary for defmfun. ;; Macros to interface GSL functions, including definitions necessary for defmfun.
;; Liam Healy ;; Liam Healy
;; Time-stamp: <2008-05-12 21:00:47EDT interface.lisp> ;; Time-stamp: <2008-07-10 21:39:43EDT interface.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -94,13 +94,17 @@ ...@@ -94,13 +94,17 @@
;;;; Argument check ;;;; Argument check
;;;;**************************************************************************** ;;;;****************************************************************************
(defun cl-symbols (arglist)
"The symbols in the arglist."
(mapcar (lambda (s) (if (listp s) (first s) s)) arglist))
;;; (cl-argument-types '(a b) '((a :double) (b :int32))) ;;; (cl-argument-types '(a b) '((a :double) (b :int32)))
(defun cl-argument-types (cl-arguments c-arguments-types) (defun cl-argument-types (cl-arguments c-arguments-types)
"Create CL argument and types from the C arguments." "Create CL argument and types from the C arguments."
(loop for sd in c-arguments-types (loop for sd in c-arguments-types
for cl-type = (cffi-cl (st-type sd)) for cl-type = (cffi-cl (st-type sd))
append append
(when (and cl-type (member (st-symbol sd) cl-arguments)) (when (and cl-type (member (st-symbol sd) (cl-symbols cl-arguments)))
(list (list (st-symbol sd) cl-type))))) (list (list (st-symbol sd) cl-type)))))
(defun declaration-form (cl-argument-types) (defun declaration-form (cl-argument-types)
......
;; Polynomials ;; Polynomials
;; Liam Healy, Tue Mar 21 2006 - 18:33 ;; Liam Healy, Tue Mar 21 2006 - 18:33
;; Time-stamp: <2008-03-17 21:35:52EDT polynomial.lisp> ;; Time-stamp: <2008-07-06 16:57:52EDT polynomial.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
(defmfun polynomial-eval (coefficients x) (defmfun polynomial-eval (coefficients x)
"gsl_poly_eval" "gsl_poly_eval"
(((gsl-array coefficients) :pointer) ((dim0 coefficients) size) (x :double)) (((c-pointer coefficients) :pointer) ((dim0 coefficients) sizet) (x :double))
:documentation ; FDL :documentation ; FDL
"Evaluate the polyonomial with coefficients at the point x." "Evaluate the polyonomial with coefficients at the point x."
:c-return :double) :c-return :double)
...@@ -25,17 +25,26 @@ ...@@ -25,17 +25,26 @@
(defmfun divided-difference (dd xa ya) (defmfun divided-difference (dd xa ya)
"gsl_poly_dd_init" "gsl_poly_dd_init"
(((gsl-array dd) :pointer) (((c-pointer dd) :pointer)
((gsl-array xa) :pointer) ((gsl-array ya) :pointer) ((c-pointer xa) :pointer) ((c-pointer ya) :pointer)
((dim0 xa) size)) ((dim0 xa) sizet))
:return (dd)) :inputs (xa ya)
:outputs (dd)
:return (dd)
:documentation ; FDL
"Compute a divided-difference representation of the
interpolating polynomial for the points (xa, ya) stored in
the arrays of equal length. On output the
divided-differences of (@var{xa},@var{ya}) are stored in the array
dd, of the same length.")
(defmfun polynomial-eval-divided-difference (dd xa x) (defmfun polynomial-eval-divided-difference (dd xa x)
"gsl_poly_dd_eval" "gsl_poly_dd_eval"
(((gsl-array dd) :pointer) (((c-pointer dd) :pointer)
((gsl-array xa) :pointer) ((c-pointer xa) :pointer)
((dim0 xa) size) ((dim0 xa) sizet)
(x :double)) (x :double))
:inputs (dd xa)
:c-return :double :c-return :double
:documentation ; FDL :documentation ; FDL
"Evaluate the polynomial stored in divided-difference form "Evaluate the polynomial stored in divided-difference form
...@@ -43,20 +52,21 @@ ...@@ -43,20 +52,21 @@
(defmfun taylor-divided-difference (coefs xp dd xa workspace) (defmfun taylor-divided-difference (coefs xp dd xa workspace)
"gsl_poly_dd_taylor" "gsl_poly_dd_taylor"
(((gsl-array coefs) :pointer) (((c-pointer coefs) :pointer)
(xp :double) (xp :double)
((gsl-array dd) :pointer) ((c-pointer dd) :pointer)
((gsl-array xa) :pointer) ((c-pointer xa) :pointer)
((dim0 xa) size) ((dim0 xa) sizet)
((gsl-array workspace) :pointer)) ((c-pointer workspace) :pointer))
:invalidate (coefs) :inputs (coefs xa)
:outputs (coefs)
:documentation ; FDL :documentation ; FDL
"Convert the divided-difference representation of a "Convert the divided-difference representation of a
polynomial to a Taylor expansion. The divided-difference representation polynomial to a Taylor expansion. The divided-difference representation
is supplied in the arrays dd and xa of the same length. is supplied in the arrays dd and xa of the same length.
On output the Taylor coefficients of the polynomial expanded about the On output the Taylor coefficients of the polynomial expanded about the
point xp are stored in the array coefs which has the same length point xp are stored in the array coefs which has the same length
as xa and dd. A workspace of length must be provided.") as xa and dd. A workspace of that length must be provided.")
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Quadratic Equations ;;;; Quadratic Equations
...@@ -73,7 +83,8 @@ ...@@ -73,7 +83,8 @@
(defmfun solve-quadratic-complex (a b c) (defmfun solve-quadratic-complex (a b c)
"gsl_poly_complex_solve_quadratic" "gsl_poly_complex_solve_quadratic"
((a :double) (b :double) (c :double) (root1 gsl-complex) (root2 gsl-complex)) ((a :double) (b :double) (c :double)
(root1 complex-double-c) (root2 complex-double-c))
:c-return :number-of-answers :c-return :number-of-answers
:documentation ; FDL :documentation ; FDL
"The complex roots of the quadratic equation a x^2 + b x + c = 0. "The complex roots of the quadratic equation a x^2 + b x + c = 0.
...@@ -98,7 +109,7 @@ ...@@ -98,7 +109,7 @@
(defmfun solve-cubic-complex (a b c) (defmfun solve-cubic-complex (a b c)
"gsl_poly_complex_solve_cubic" "gsl_poly_complex_solve_cubic"
((a :double) (b :double) (c :double) ((a :double) (b :double) (c :double)
(root1 gsl-complex) (root2 gsl-complex) (root3 gsl-complex)) (root1 complex-double-c) (root2 complex-double-c) (root3 complex-double-c))
:c-return :number-of-answers :c-return :number-of-answers
:documentation ; FDL :documentation ; FDL
"Find the complex roots of the cubic equation, x^3 + a x^2 + b x + c = 0 "Find the complex roots of the cubic equation, x^3 + a x^2 + b x + c = 0
...@@ -113,7 +124,7 @@ ...@@ -113,7 +124,7 @@
allocate-complex-workspace free-complex-workspace) allocate-complex-workspace free-complex-workspace)
(defmfun allocate-complex-workspace (n) (defmfun allocate-complex-workspace (n)
"gsl_poly_complex_workspace_alloc" ((n size)) "gsl_poly_complex_workspace_alloc" ((n sizet))
:c-return :pointer :c-return :pointer
:export nil :export nil
:index (letm complex-workspace)) :index (letm complex-workspace))
...@@ -124,6 +135,7 @@ ...@@ -124,6 +135,7 @@
:export nil :export nil
:index (letm complex-workspace)) :index (letm complex-workspace))
(export 'polynomial-solve)
(defun polynomial-solve (coefficients) (defun polynomial-solve (coefficients)
;; FDL ;; FDL
"The roots of the general polynomial "The roots of the general polynomial
...@@ -142,17 +154,17 @@ ...@@ -142,17 +154,17 @@
(defmfun polynomial-solve-ws (coefficients workspace answer-pd) (defmfun polynomial-solve-ws (coefficients workspace answer-pd)
"gsl_poly_complex_solve" "gsl_poly_complex_solve"
(((gsl-array coefficients) :pointer) ((dim0 coefficients) size) (((c-pointer coefficients) :pointer) ((dim0 coefficients) sizet)
(workspace :pointer) ((gsl-array answer-pd) :pointer)) (workspace :pointer) ((c-pointer answer-pd) :pointer))
:return :return
((loop for i from 0 below (dim0 answer-pd) by 2 ((loop for i from 0 below (dim0 answer-pd) by 2
collect (complex (maref answer-pd i) collect (complex (maref answer-pd i)
(maref answer-pd (1+ i))))) (maref answer-pd (1+ i)))))
:export nil
:index polynomial-solve
:documentation ; FDL :documentation ; FDL
"Arguments are: "Arguments are:
a GSL array of coefficients, a workspace, a gsl-array of doubles." a GSL array of coefficients, a workspace, a gsl-array of doubles.")
:export nil
:index polynomial-solve)
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Airy functions ;; Airy functions
;; Liam Healy, Fri Mar 17 2006 - 18:41 ;; Liam Healy, Fri Mar 17 2006 - 18:41
;; Time-stamp: <2008-02-16 17:57:19EST airy.lisp> ;; Time-stamp: <2008-07-10 21:20:39EDT airy.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -57,22 +57,22 @@ ...@@ -57,22 +57,22 @@
exp(-(2/3) x^(3/2)), and is 1 for x<0.") exp(-(2/3) x^(3/2)), and is 1 for x<0.")
(defmfun airy-zero-Ai (s) (defmfun airy-zero-Ai (s)
"gsl_sf_airy_zero_Ai_e" ((s size) (ret sf-result)) "gsl_sf_airy_zero_Ai_e" ((s sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The location of the s-th zero of the Airy function Ai(x).") "The location of the s-th zero of the Airy function Ai(x).")
(defmfun airy-zero-Bi (s) (defmfun airy-zero-Bi (s)
"gsl_sf_airy_zero_Bi_e" ((s size) (ret sf-result)) "gsl_sf_airy_zero_Bi_e" ((s sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The location of the s-th zero of the Airy function Bi(x).") "The location of the s-th zero of the Airy function Bi(x).")
(defmfun airy-zero-Ai-deriv (s) (defmfun airy-zero-Ai-deriv (s)
"gsl_sf_airy_zero_Ai_deriv_e" ((s size) (ret sf-result)) "gsl_sf_airy_zero_Ai_deriv_e" ((s sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The location of the s-th zero of the Airy function derivative Ai'(x).") "The location of the s-th zero of the Airy function derivative Ai'(x).")
(defmfun airy-zero-Bi-deriv (s) (defmfun airy-zero-Bi-deriv (s)
"gsl_sf_airy_zero_Bi_deriv_e" ((s size) (ret sf-result)) "gsl_sf_airy_zero_Bi_deriv_e" ((s sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The location of the s-th zero of the Airy function derivative Bi'(x).") "The location of the s-th zero of the Airy function derivative Bi'(x).")
......
;; Bessel functions ;; Bessel functions
;; Liam Healy, Fri Mar 17 2006 - 18:42 ;; Liam Healy, Fri Mar 17 2006 - 18:42
;; Time-stamp: <2008-03-09 19:29:18EDT bessel.lisp> ;; Time-stamp: <2008-07-08 21:43:01EDT bessel.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
(defmfun cylindrical-bessel-Jn-array (x array &optional (nmin 0)) (defmfun cylindrical-bessel-Jn-array (x array &optional (nmin 0))
"gsl_sf_bessel_Jn_array" "gsl_sf_bessel_Jn_array"
((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double) ((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the regular cylindrical Bessel functions J_n(x) "The values of the regular cylindrical Bessel functions J_n(x)
for n from nmin to nmin+length(array)-1 inclusive. for n from nmin to nmin+length(array)-1 inclusive.
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
(defmfun cylindrical-bessel-Yn-array (x array &optional (nmin 0)) (defmfun cylindrical-bessel-Yn-array (x array &optional (nmin 0))
"gsl_sf_bessel_Yn_array" "gsl_sf_bessel_Yn_array"
((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double) ((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the irregular cylindrical Bessel functions "The values of the irregular cylindrical Bessel functions
Y_n(x) for n from from nmin to Y_n(x) for n from from nmin to
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
(defmfun cylindrical-bessel-In-array (x array &optional (nmin 0)) (defmfun cylindrical-bessel-In-array (x array &optional (nmin 0))
"gsl_sf_bessel_In_array" "gsl_sf_bessel_In_array"
((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double) ((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the regular modified cylindrical Bessel functions "The values of the regular modified cylindrical Bessel functions
I_n(x) for n from from nmin to nmin+length(array)-1 inclusive. I_n(x) for n from from nmin to nmin+length(array)-1 inclusive.
...@@ -119,8 +119,8 @@ ...@@ -119,8 +119,8 @@
(defmfun cylindrical-bessel-In-scaled-array (x array &optional (nmin 0)) (defmfun cylindrical-bessel-In-scaled-array (x array &optional (nmin 0))
"gsl_sf_bessel_In_scaled_array" "gsl_sf_bessel_In_scaled_array"
((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double) ((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
;; Bug in original documentation? doesn't say "modified" ;; Bug in original documentation? doesn't say "modified"
"The values of the scaled regular modified cylindrical Bessel "The values of the scaled regular modified cylindrical Bessel
...@@ -152,8 +152,8 @@ ...@@ -152,8 +152,8 @@
(defmfun cylindrical-bessel-Kn-array (x array &optional (nmin 0)) (defmfun cylindrical-bessel-Kn-array (x array &optional (nmin 0))
"gsl_sf_bessel_Kn_array" "gsl_sf_bessel_Kn_array"
((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double) ((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the irregular modified cylindrical Bessel functions "The values of the irregular modified cylindrical Bessel functions
K_n(x) for n from from nmin to nmin+length(array)-1 inclusive. K_n(x) for n from from nmin to nmin+length(array)-1 inclusive.
...@@ -181,8 +181,8 @@ ...@@ -181,8 +181,8 @@
(defmfun cylindrical-bessel-Kn-scaled-array (x array &optional (nmin 0)) (defmfun cylindrical-bessel-Kn-scaled-array (x array &optional (nmin 0))
"gsl_sf_bessel_Kn_scaled_array" "gsl_sf_bessel_Kn_scaled_array"
((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double) ((nmin :int) ((+ nmin (dim0 array) -1) :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the scaled irregular cylindrical "The values of the scaled irregular cylindrical
Bessel functions \exp(x) K_n(x) for n from from nmin to Bessel functions \exp(x) K_n(x) for n from from nmin to
...@@ -221,8 +221,8 @@ ...@@ -221,8 +221,8 @@
(defmfun spherical-bessel-jl-array (x array) (defmfun spherical-bessel-jl-array (x array)
"gsl_sf_bessel_jl_array" "gsl_sf_bessel_jl_array"
(((1- (dim0 array)) :int) (x :double) ((gsl-array array) :pointer)) (((1- (dim0 array)) :int) (x :double) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the regular spherical Bessel "The values of the regular spherical Bessel
functions j_l(x) for l from 0 to length(array)-1 and x >= 0. functions j_l(x) for l from 0 to length(array)-1 and x >= 0.
...@@ -231,8 +231,8 @@ ...@@ -231,8 +231,8 @@
(defmfun spherical-bessel-jl-steed-array (x array) (defmfun spherical-bessel-jl-steed-array (x array)
"gsl_sf_bessel_jl_steed_array" "gsl_sf_bessel_jl_steed_array"
(((1- (dim0 array)) :int) (x :double) ((gsl-array array) :pointer)) (((1- (dim0 array)) :int) (x :double) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"Uses Steed's method to compute the values of the regular spherical "Uses Steed's method to compute the values of the regular spherical
Bessel functions j_l(x) for l from 0 to length(array)-1 Bessel functions j_l(x) for l from 0 to length(array)-1
...@@ -270,8 +270,8 @@ ...@@ -270,8 +270,8 @@
(defmfun spherical-bessel-yl-array (x array) (defmfun spherical-bessel-yl-array (x array)
"gsl_sf_bessel_yl_array" "gsl_sf_bessel_yl_array"
(((1- (dim0 array)) :int) (x :double) ((gsl-array array) :pointer)) (((1- (dim0 array)) :int) (x :double) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The irregular spherical Bessel functions y_l(x) for l "The irregular spherical Bessel functions y_l(x) for l
from 0 to length(array)-1. The values are computed using from 0 to length(array)-1. The values are computed using
...@@ -308,8 +308,8 @@ ...@@ -308,8 +308,8 @@
(defmfun spherical-bessel-il-scaled-array (x array) (defmfun spherical-bessel-il-scaled-array (x array)
"gsl_sf_bessel_il_scaled_array" "gsl_sf_bessel_il_scaled_array"
(((1- (dim0 array)) :int) (x :double) ((gsl-array array) :pointer)) (((1- (dim0 array)) :int) (x :double) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the scaled regular modified cylindrical Bessel "The values of the scaled regular modified cylindrical Bessel
functions \exp(-|x|) i_l(x) for l from 0 to length(array)-1 functions \exp(-|x|) i_l(x) for l from 0 to length(array)-1
...@@ -346,8 +346,8 @@ ...@@ -346,8 +346,8 @@
(defmfun spherical-bessel-kl-scaled-array (x array) (defmfun spherical-bessel-kl-scaled-array (x array)
"gsl_sf_bessel_kl_scaled_array" "gsl_sf_bessel_kl_scaled_array"
(((1- (dim0 array)) :int) (x :double) ((gsl-array array) :pointer)) (((1- (dim0 array)) :int) (x :double) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"The values of the scaled irregular modified spherical Bessel "The values of the scaled irregular modified spherical Bessel
functions \exp(x) k_l(x) for l from 0 to length(array)-1 functions \exp(x) k_l(x) for l from 0 to length(array)-1
...@@ -367,8 +367,8 @@ ...@@ -367,8 +367,8 @@
(defmfun spherical-Jnu-array (nu v) (defmfun spherical-Jnu-array (nu v)
"gsl_sf_bessel_sequence_Jnu_e" "gsl_sf_bessel_sequence_Jnu_e"
((nu :double) :mode ((dim0 v) :int) ((gsl-array v) :pointer)) ((nu :double) :mode ((dim0 v) :int) ((c-pointer v) :pointer))
:invalidate (v) :outputs (v)
:documentation ; FDL :documentation ; FDL
"The regular cylindrical Bessel function of "The regular cylindrical Bessel function of
fractional order \nu, J_\nu(x), evaluated at a series of fractional order \nu, J_\nu(x), evaluated at a series of
...@@ -458,6 +458,7 @@ ...@@ -458,6 +458,7 @@
;; in macroexpansion the form from within SLIME using SBCL (expands ;; in macroexpansion the form from within SLIME using SBCL (expands
;; fine from shell) ;; fine from shell)
#|
(make-tests bessel (make-tests bessel
(cylindrical-bessel-J0 4.0d0) (cylindrical-bessel-J0 4.0d0)
(cylindrical-bessel-J1 4.0d0) (cylindrical-bessel-J1 4.0d0)
...@@ -540,6 +541,7 @@ ...@@ -540,6 +541,7 @@
(bessel-zero-J0 5) (bessel-zero-J0 5)
(bessel-zero-J1 5) (bessel-zero-J1 5)
(bessel-zero-Jnu 2.0d0 5)) (bessel-zero-Jnu 2.0d0 5))
|#
|# |#
......
;; Coulumb functions ;; Coulumb functions
;; Liam Healy, Sat Mar 18 2006 - 23:23 ;; Liam Healy, Sat Mar 18 2006 - 23:23
;; Time-stamp: <2008-03-09 19:29:18EDT coulomb.lisp> ;; Time-stamp: <2008-07-08 21:46:07EDT coulomb.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
(defmfun coulomb-wave-F-array (L-min eta x fc-array) (defmfun coulomb-wave-F-array (L-min eta x fc-array)
"gsl_sf_coulomb_wave_F_array" "gsl_sf_coulomb_wave_F_array"
((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double) ((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double)
((gsl-array fc-array) :pointer) (F-exponent :double)) ((c-pointer fc-array) :pointer) (F-exponent :double))
:invalidate (fc-array) :outputs (fc-array)
:return (fc-array (dcref F-exponent)) :return (fc-array (dcref F-exponent))
:documentation ; FDL :documentation ; FDL
"The Coulomb wave function F_L(\eta,x) for "The Coulomb wave function F_L(\eta,x) for
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
(defmfun coulomb-wave-FG-array (L-min eta x fc-array gc-array) (defmfun coulomb-wave-FG-array (L-min eta x fc-array gc-array)
"gsl_sf_coulomb_wave_FG_array" "gsl_sf_coulomb_wave_FG_array"
((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double) ((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double)
((gsl-array fc-array) :pointer) ((gsl-array gc-array) :pointer) ((c-pointer fc-array) :pointer) ((c-pointer gc-array) :pointer)
(F-exponent :double) (G-exponent :double)) (F-exponent :double) (G-exponent :double))
:return (fc-array gc-array (dcref F-exponent) (dcref G-exponent)) :return (fc-array gc-array (dcref F-exponent) (dcref G-exponent))
:documentation ; FDL :documentation ; FDL
...@@ -77,8 +77,8 @@ ...@@ -77,8 +77,8 @@
(defmfun coulomb-wave-FGp-array (L-min eta x fc-array fcp-array gc-array gcp-array) (defmfun coulomb-wave-FGp-array (L-min eta x fc-array fcp-array gc-array gcp-array)
"gsl_sf_coulomb_wave_FGp_array" "gsl_sf_coulomb_wave_FGp_array"
((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double) ((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double)
((gsl-array fc-array) :pointer) ((gsl-array fcp-array) :pointer) ((c-pointer fc-array) :pointer) ((c-pointer fcp-array) :pointer)
((gsl-array gc-array) :pointer) ((gsl-array gcp-array) :pointer) ((c-pointer gc-array) :pointer) ((c-pointer gcp-array) :pointer)
(F-exponent :double) (G-exponent :double)) (F-exponent :double) (G-exponent :double))
:return :return
(fc-array fcp-array gc-array gcp-array (fc-array fcp-array gc-array gcp-array
...@@ -94,8 +94,8 @@ ...@@ -94,8 +94,8 @@
(defmfun coulomb-wave-sphF-array (L-min eta x fc-array) (defmfun coulomb-wave-sphF-array (L-min eta x fc-array)
"gsl_sf_coulomb_wave_sphF_array" "gsl_sf_coulomb_wave_sphF_array"
((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double) ((L-min :double) ((1- (dim0 fc-array)) :int) (eta :double) (x :double)
((gsl-array fc-array) :pointer) (F-exponent :double)) ((c-pointer fc-array) :pointer) (F-exponent :double))
:invalidate (fc-array) :outputs (fc-array)
:return (fc-array (dcref F-exponent)) :return (fc-array (dcref F-exponent))
:documentation ; FDL :documentation ; FDL
"The Coulomb wave function divided by the argument "The Coulomb wave function divided by the argument
...@@ -117,11 +117,11 @@ ...@@ -117,11 +117,11 @@
(defmfun coulomb-CL-array (L-min eta cl) (defmfun coulomb-CL-array (L-min eta cl)
"gsl_sf_coulomb_CL_array" "gsl_sf_coulomb_CL_array"
((L-min :double) ((1- (dim0 cl)) :int) (eta :double) ((L-min :double) ((1- (dim0 cl)) :int) (eta :double)
((gsl-array cl) :pointer)) ((c-pointer cl) :pointer))
:documentation ; FDL :documentation ; FDL
"The Coulomb wave function normalization constant C_L(\eta) "The Coulomb wave function normalization constant C_L(\eta)
for L = Lmin ... Lmin + kmax, Lmin > -1." for L = Lmin ... Lmin + kmax, Lmin > -1."
:invalidate (cl)) :outputs (cl))
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Examples and unit test ;;;; Examples and unit test
...@@ -146,6 +146,7 @@ ...@@ -146,6 +146,7 @@
(coulomb-CL-array 0.0d0 1.0d0 cl) (data cl))) (coulomb-CL-array 0.0d0 1.0d0 cl) (data cl)))
|# |#
#|
(LISP-UNIT:DEFINE-TEST COULOMB (LISP-UNIT:DEFINE-TEST COULOMB
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 0.1641699972477976d0 1.8226531089715347d-16) (LIST 0.1641699972477976d0 1.8226531089715347d-16)
...@@ -206,4 +207,5 @@ ...@@ -206,4 +207,5 @@
(MULTIPLE-VALUE-LIST (MULTIPLE-VALUE-LIST
(LETM ((CL (VECTOR-DOUBLE-FLOAT 3))) (LETM ((CL (VECTOR-DOUBLE-FLOAT 3)))
(COULOMB-CL-ARRAY 0.0d0 1.0d0 CL) (DATA CL))))) (COULOMB-CL-ARRAY 0.0d0 1.0d0 CL) (DATA CL)))))
|#
;; Dilogarithm ;; Dilogarithm
;; Liam Healy, Fri Mar 17 2006 - 18:44 ;; Liam Healy, Fri Mar 17 2006 - 18:44
;; Time-stamp: <2008-02-16 20:19:55EST dilogarithm.lisp> ;; Time-stamp: <2008-07-10 21:36:14EDT dilogarithm.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -12,12 +12,12 @@ ...@@ -12,12 +12,12 @@
(defmfun dilogarithm ((x float)) (defmfun dilogarithm ((x float))
"gsl_sf_dilog_e" ((x :double) (ret sf-result)) "gsl_sf_dilog_e" ((x :double) (ret sf-result))
:type :method) :definition :method)
(defmfun dilogarithm ((x complex)) (defmfun dilogarithm ((x complex))
"gsl_sf_complex_dilog_e" "gsl_sf_complex_dilog_e"
(((abs x) :double) ((phase x) :double) (re sf-result) (im sf-result)) (((abs x) :double) ((phase x) :double) (re sf-result) (im sf-result))
:type :method :definition :method
:return ((complex (val re) (val im)) (complex (err re) (err im)))) :return ((complex (val re) (val im)) (complex (err re) (err im))))
#| #|
......
;; Gamma functions ;; Gamma functions
;; Liam Healy, Thu Apr 27 2006 - 22:06 ;; Liam Healy, Thu Apr 27 2006 - 22:06
;; Time-stamp: <2008-03-27 21:29:36EDT gamma.lisp> ;; Time-stamp: <2008-07-12 13:44:42EDT gamma.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -79,34 +79,34 @@ ...@@ -79,34 +79,34 @@
"Compute the Taylor coefficient x^n / n! for x >= 0, n >= 0.") "Compute the Taylor coefficient x^n / n! for x >= 0, n >= 0.")
(defmfun factorial (n) (defmfun factorial (n)
"gsl_sf_fact_e" ((n size) (ret sf-result)) "gsl_sf_fact_e" ((n sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The factorial n!, related to the Gamma function by n! = \Gamma(n+1).") "The factorial n!, related to the Gamma function by n! = \Gamma(n+1).")
(defmfun double-factorial (n) (defmfun double-factorial (n)
"gsl_sf_doublefact_e" ((n size) (ret sf-result)) "gsl_sf_doublefact_e" ((n sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The double factorial n!! = n(n-2)(n-4) \dots.") "The double factorial n!! = n(n-2)(n-4) \dots.")
(defmfun log-factorial (n) (defmfun log-factorial (n)
"gsl_sf_lnfact_e" ((n size) (ret sf-result)) "gsl_sf_lnfact_e" ((n sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The logarithm of the factorial of n, log(n!). "The logarithm of the factorial of n, log(n!).
The algorithm is faster than computing The algorithm is faster than computing
ln(Gamma(n+1)) via #'log-gamma for n < 170, but defers for larger n.") ln(Gamma(n+1)) via #'log-gamma for n < 170, but defers for larger n.")
(defmfun log-double-factorial (n) (defmfun log-double-factorial (n)
"gsl_sf_lndoublefact_e" ((n size) (ret sf-result)) "gsl_sf_lndoublefact_e" ((n sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"Compute the logarithm of the double factorial of n, log(n!!).") "Compute the logarithm of the double factorial of n, log(n!!).")
(defmfun choose (n m) (defmfun choose (n m)
"gsl_sf_choose_e" ((n size) (m size) (ret sf-result)) "gsl_sf_choose_e" ((n sizet) (m sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The combinatorial factor (n choose m) = n!/(m!(n-m)!).") "The combinatorial factor (n choose m) = n!/(m!(n-m)!).")
(defmfun log-choose (n m) (defmfun log-choose (n m)
"gsl_sf_lnchoose_e" ((n size) (m size) (ret sf-result)) "gsl_sf_lnchoose_e" ((n sizet) (m sizet) (ret sf-result))
:documentation ; FDL :documentation ; FDL
"The logarithm of (n choose m). This is "The logarithm of (n choose m). This is
equivalent to the sum log(n!) - log(m!) - log((n-m)!).") equivalent to the sum log(n!) - log(m!) - log((n-m)!).")
......
;; Gegenbauer polynomials ;; Gegenbauer polynomials
;; Liam Healy, Fri Apr 28 2006 - 20:40 ;; Liam Healy, Fri Apr 28 2006 - 20:40
;; Time-stamp: <2008-03-09 19:29:18EDT gegenbauer.lisp> ;; Time-stamp: <2008-07-08 21:53:11EDT gegenbauer.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
(defmfun gegenbauer-array (lambda x result) (defmfun gegenbauer-array (lambda x result)
"gsl_sf_gegenpoly_array" "gsl_sf_gegenpoly_array"
(((1- (dim0 result)) :int) (((1- (dim0 result)) :int)
(lambda :double) (x :double) ((gsl-array result) :pointer)) (lambda :double) (x :double) ((c-pointer result) :pointer))
:invalidate (result) :outputs (result)
:documentation ; FDL :documentation ; FDL
"Compute an array of Gegenbauer polynomials C^{(\lambda)}_n(X)} "Compute an array of Gegenbauer polynomials C^{(\lambda)}_n(X)}
for n = 0, 1, 2, ..., length(result)-1}, subject to \lambda > -1/2.") for n = 0, 1, 2, ..., length(result)-1}, subject to \lambda > -1/2.")
......
;; Hypergeometric function ;; Hypergeometric function
;; Liam Healy, Fri Apr 28 2006 - 23:00 ;; Liam Healy, Fri Apr 28 2006 - 23:00
;; Time-stamp: <2008-02-17 18:30:53EST hypergeometric.lisp> ;; Time-stamp: <2008-07-10 21:40:45EDT hypergeometric.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
(defmfun hypergeometric-1F1 ((m integer) (n integer) x) (defmfun hypergeometric-1F1 ((m integer) (n integer) x)
"gsl_sf_hyperg_1F1_int_e" ((m :int) (n :int) (x :double) (ret sf-result)) "gsl_sf_hyperg_1F1_int_e" ((m :int) (n :int) (x :double) (ret sf-result))
:type :method :definition :method
:export t :export t
:documentation ; FDL :documentation ; FDL
"The confluent hypergeometric function 1F1(m,n,x) = M(m,n,x) "The confluent hypergeometric function 1F1(m,n,x) = M(m,n,x)
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
(defmfun hypergeometric-1F1 ((a float) (b float) x) (defmfun hypergeometric-1F1 ((a float) (b float) x)
"gsl_sf_hyperg_1F1_e" ((a :double) (b :double) (x :double) (ret sf-result)) "gsl_sf_hyperg_1F1_e" ((a :double) (b :double) (x :double) (ret sf-result))
:type :method :definition :method
:documentation ; FDL :documentation ; FDL
"The confluent hypergeometric function "The confluent hypergeometric function
1F1(a,b,x) = M(a,b,x) for general parameters a, b.") 1F1(a,b,x) = M(a,b,x) for general parameters a, b.")
...@@ -35,14 +35,14 @@ ...@@ -35,14 +35,14 @@
(defmfun hypergeometric-U ((m integer) (n integer) x) (defmfun hypergeometric-U ((m integer) (n integer) x)
"gsl_sf_hyperg_U_int_e" ((m :int) (n :int) (x :double) (ret sf-result)) "gsl_sf_hyperg_U_int_e" ((m :int) (n :int) (x :double) (ret sf-result))
:type :method :definition :method
:export t :export t
:documentation ; FDL :documentation ; FDL
"The confluent hypergeometric function U(m,n,x) for integer parameters m, n.") "The confluent hypergeometric function U(m,n,x) for integer parameters m, n.")
(defmfun hypergeometric-U ((a float) (b float) x) (defmfun hypergeometric-U ((a float) (b float) x)
"gsl_sf_hyperg_U_e" ((a :double) (b :double) (x :double) (ret sf-result)) "gsl_sf_hyperg_U_e" ((a :double) (b :double) (x :double) (ret sf-result))
:type :method :definition :method
:documentation "The confluent hypergeometric function U(a,b,x).") :documentation "The confluent hypergeometric function U(a,b,x).")
(defgeneric hypergeometric-U-e10 (m n x) (defgeneric hypergeometric-U-e10 (m n x)
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
(defmfun hypergeometric-U-e10 ((m integer) (n integer) x) (defmfun hypergeometric-U-e10 ((m integer) (n integer) x)
"gsl_sf_hyperg_U_int_e10_e" "gsl_sf_hyperg_U_int_e10_e"
((m :int) (n :int) (x :double) (ret sf-result-e10)) ((m :int) (n :int) (x :double) (ret sf-result-e10))
:type :method :definition :method
:export t :export t
:documentation ; FDL :documentation ; FDL
"The confluent hypergeometric function "The confluent hypergeometric function
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
(defmfun hypergeometric-U-e10 ((a float) (b float) x) (defmfun hypergeometric-U-e10 ((a float) (b float) x)
"gsl_sf_hyperg_U_e10_e" "gsl_sf_hyperg_U_e10_e"
((a :double) (b :double) (x :double) (ret sf-result-e10)) ((a :double) (b :double) (x :double) (ret sf-result-e10))
:type :method :definition :method
:documentation ; FDL :documentation ; FDL
"The confluent hypergeometric function "The confluent hypergeometric function
U(a,b,x) using that returns a result with extended range.") U(a,b,x) using that returns a result with extended range.")
......
;; Legendre functions ;; Legendre functions
;; Liam Healy, Sat Apr 29 2006 - 19:16 ;; Liam Healy, Sat Apr 29 2006 - 19:16
;; Time-stamp: <2008-03-27 21:30:02EDT legendre.lisp> ;; Time-stamp: <2008-07-08 21:55:40EDT legendre.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -37,19 +37,19 @@ ...@@ -37,19 +37,19 @@
(defmfun legendre-Pl-array (x array) (defmfun legendre-Pl-array (x array)
"gsl_sf_legendre_Pl_array" "gsl_sf_legendre_Pl_array"
(((1- (dim0 array)) :int) (x :double) ((gsl-array array) :pointer)) (((1- (dim0 array)) :int) (x :double) ((c-pointer array) :pointer))
:documentation ; FDL :documentation ; FDL
"Compute an array of Legendre polynomials "Compute an array of Legendre polynomials
P_l(x) for l = 0, ..., length(array), |x| <= 1." P_l(x) for l = 0, ..., length(array), |x| <= 1."
:invalidate (array)) :outputs (array))
(defmfun legendre-Pl-deriv-array (x array) (defmfun legendre-Pl-deriv-array (x array)
"gsl_sf_legendre_Pl_deriv_array" "gsl_sf_legendre_Pl_deriv_array"
(((1- (dim0 array)) :int) (x :double) ((gsl-array array) :pointer)) (((1- (dim0 array)) :int) (x :double) ((c-pointer array) :pointer))
:documentation ; FDL :documentation ; FDL
"Compute an array of Legendre polynomials derivatives "Compute an array of Legendre polynomials derivatives
dP_l(x)/dx, for l = 0, ..., length(array), |x| <= 1." dP_l(x)/dx, for l = 0, ..., length(array), |x| <= 1."
:invalidate (array)) :outputs (array))
(defmfun legendre-Q0 (x) (defmfun legendre-Q0 (x)
"gsl_sf_legendre_Q0_e" ((x :double) (ret sf-result)) "gsl_sf_legendre_Q0_e" ((x :double) (ret sf-result))
...@@ -94,22 +94,22 @@ ...@@ -94,22 +94,22 @@
(defmfun legendre-Plm-array (m x array) (defmfun legendre-Plm-array (m x array)
"gsl_sf_legendre_Plm_array" "gsl_sf_legendre_Plm_array"
(((+ (dim0 array) m -1) :int) (m :int) (x :double) (((+ (dim0 array) m -1) :int) (m :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:documentation ; FDL :documentation ; FDL
"An array of Legendre polynomials "An array of Legendre polynomials
P_l^m(x), for m >= 0, P_l^m(x), for m >= 0,
l = |m|, ..., |m|+length(array)-1} and |x| <= 1." l = |m|, ..., |m|+length(array)-1} and |x| <= 1."
:invalidate (array)) :outputs (array))
(defmfun legendre-Plm-deriv-array (m x values derivatives) (defmfun legendre-Plm-deriv-array (m x values derivatives)
"gsl_sf_legendre_Plm_deriv_array" "gsl_sf_legendre_Plm_deriv_array"
(((+ (dim0 values) m -1) :int) (m :int) (x :double) (((+ (dim0 values) m -1) :int) (m :int) (x :double)
((gsl-array values) :pointer) ((gsl-array derivatives) :pointer)) ((c-pointer values) :pointer) ((c-pointer derivatives) :pointer))
:documentation ; FDL :documentation ; FDL
"An array of Legendre polynomials "An array of Legendre polynomials
values and derivatives dP_l^m(x)/dx for m >= 0, values and derivatives dP_l^m(x)/dx for m >= 0,
l = |m|, ..., length(values) and |x| <= 1." l = |m|, ..., length(values) and |x| <= 1."
:invalidate (values derivatives)) :outputs (values derivatives))
(defmfun legendre-sphPlm (l m x) (defmfun legendre-sphPlm (l m x)
"gsl_sf_legendre_sphPlm_e" ((l :int) (m :int) (x :double) (ret sf-result)) "gsl_sf_legendre_sphPlm_e" ((l :int) (m :int) (x :double) (ret sf-result))
...@@ -123,22 +123,22 @@ ...@@ -123,22 +123,22 @@
(defmfun legendre-sphPlm-array (m x array) (defmfun legendre-sphPlm-array (m x array)
"gsl_sf_legendre_sphPlm_array" "gsl_sf_legendre_sphPlm_array"
(((+ (dim0 array) m -1) :int) (m :int) (x :double) (((+ (dim0 array) m -1) :int) (m :int) (x :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:documentation ; FDL :documentation ; FDL
"An array of normalized associated Legendre functions "An array of normalized associated Legendre functions
\sqrt(2l+1)/(4\pi) \sqrt(l-m)!/(l+m)! P_l^m(x), \sqrt(2l+1)/(4\pi) \sqrt(l-m)!/(l+m)! P_l^m(x),
for m >= 0, l = |m|, ..., length(array)}, |x| <= 1.0." for m >= 0, l = |m|, ..., length(array)}, |x| <= 1.0."
:invalidate (array)) :outputs (array))
(defmfun legendre-sphPlm-deriv-array (m x values derivatives) (defmfun legendre-sphPlm-deriv-array (m x values derivatives)
"gsl_sf_legendre_sphPlm_deriv_array" "gsl_sf_legendre_sphPlm_deriv_array"
(((+ (dim0 values) m -1) :int) (m :int) (x :double) (((+ (dim0 values) m -1) :int) (m :int) (x :double)
((gsl-array values) :pointer) ((gsl-array derivatives) :pointer)) ((c-pointer values) :pointer) ((c-pointer derivatives) :pointer))
:documentation ; FDL :documentation ; FDL
"An array of normalized associated Legendre functions "An array of normalized associated Legendre functions
values and derivatives for m >= 0, values and derivatives for m >= 0,
l = |m|, ..., length(array)}, |x| <= 1.0." l = |m|, ..., length(array)}, |x| <= 1.0."
:invalidate (values derivatives)) :outputs (values derivatives))
(defmfun legendre-array-size (lmax m) (defmfun legendre-array-size (lmax m)
"gsl_sf_legendre_array_size" ((lmax :int) (m :int)) "gsl_sf_legendre_array_size" ((lmax :int) (m :int))
...@@ -237,8 +237,8 @@ ...@@ -237,8 +237,8 @@
(defmfun legendre-H3d-array (lambda eta array) (defmfun legendre-H3d-array (lambda eta array)
"gsl_sf_legendre_H3d_array" "gsl_sf_legendre_H3d_array"
(((1- (dim0 array)) :int) (lambda :double) (eta :double) (((1- (dim0 array)) :int) (lambda :double) (eta :double)
((gsl-array array) :pointer)) ((c-pointer array) :pointer))
:invalidate (array) :outputs (array)
:documentation ; FDL :documentation ; FDL
"An array of radial eigenfunctions "An array of radial eigenfunctions
L^{H3d}_l(\lambda, \eta) for 0 <= l <= length(array).") L^{H3d}_l(\lambda, \eta) for 0 <= l <= length(array).")
......
;; Logarithm ;; Logarithm
;; Liam Healy, Sun Apr 30 2006 - 22:08 ;; Liam Healy, Sun Apr 30 2006 - 22:08
;; Time-stamp: <2008-02-16 22:34:59EST logarithm.lisp> ;; Time-stamp: <2008-07-10 21:41:27EDT logarithm.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
(defmfun gsl-log ((x float)) (defmfun gsl-log ((x float))
"gsl_sf_log_e" "gsl_sf_log_e"
((x :double) (ret sf-result)) ((x :double) (ret sf-result))
:type :method :definition :method
:export t) :export t)
(defmfun gsl-log ((x complex)) (defmfun gsl-log ((x complex))
"gsl_sf_complex_log_e" "gsl_sf_complex_log_e"
(((realpart x) :double) ((imagpart x) :double) (((realpart x) :double) ((imagpart x) :double)
(re-ret sf-result) (im-ret sf-result)) (re-ret sf-result) (im-ret sf-result))
:type :method :definition :method
:return :return
((complex (val re-ret) (val im-ret)) (complex (err re-ret) (err im-ret))) ((complex (val re-ret) (val im-ret)) (complex (err re-ret) (err im-ret)))
:documentation ; FDL :documentation ; FDL
......
;; Psi (digamma) functions ;; Psi (digamma) functions
;; Liam Healy, Mon May 1 2006 - 22:11 ;; Liam Healy, Mon May 1 2006 - 22:11
;; Time-stamp: <2008-02-16 22:43:28EST psi.lisp> ;; Time-stamp: <2008-07-10 21:42:08EDT psi.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
(defmfun psi ((n integer)) (defmfun psi ((n integer))
"gsl_sf_psi_int_e" ((n :int) (ret sf-result)) "gsl_sf_psi_int_e" ((n :int) (ret sf-result))
:type :method :definition :method
:export t :export t
:documentation ; FDL :documentation ; FDL
"Domain: n integer, n > 0.") "Domain: n integer, n > 0.")
(defmfun psi ((x float)) (defmfun psi ((x float))
"gsl_sf_psi_e" ((x :double) (ret sf-result)) "gsl_sf_psi_e" ((x :double) (ret sf-result))
:type :method :definition :method
:documentation ; FDL :documentation ; FDL
"Domain: x /= 0.0, -1.0, -2.0, ...") "Domain: x /= 0.0, -1.0, -2.0, ...")
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
(defmfun psi-1 ((n integer)) (defmfun psi-1 ((n integer))
"gsl_sf_psi_1_int_e" ((n :int) (ret sf-result)) "gsl_sf_psi_1_int_e" ((n :int) (ret sf-result))
:type :method :definition :method
:documentation ; FDL :documentation ; FDL
"Domain: n integer, n > 0.") "Domain: n integer, n > 0.")
(defmfun psi-1 ((x float)) (defmfun psi-1 ((x float))
"gsl_sf_psi_1_e" ((x :double) (ret sf-result)) "gsl_sf_psi_1_e" ((x :double) (ret sf-result))
:type :method :definition :method
:documentation ; FDL :documentation ; FDL
"Domain: x /= 0.0, -1.0, -2.0, ...") "Domain: x /= 0.0, -1.0, -2.0, ...")
......
;; Trigonometry ;; Trigonometry
;; Liam Healy, Thu May 4 2006 - 22:58 ;; Liam Healy, Thu May 4 2006 - 22:58
;; Time-stamp: <2008-02-17 18:30:19EST trigonometry.lisp> ;; Time-stamp: <2008-07-12 13:41:22EDT trigonometry.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -17,27 +17,27 @@ ...@@ -17,27 +17,27 @@
(defmfun gsl-sin ((x float)) (defmfun gsl-sin ((x float))
"gsl_sf_sin_e" ((x :double) (ret sf-result)) "gsl_sf_sin_e" ((x :double) (ret sf-result))
:type :method :definition :method
:export t) :export t)
(defmfun gsl-sin ((x complex)) (defmfun gsl-sin ((x complex))
"gsl_sf_complex_sin_e" "gsl_sf_complex_sin_e"
(((realpart x) :double) ((imagpart x) :double) (((realpart x) :double) ((imagpart x) :double)
(re-ret sf-result) (im-ret sf-result)) (re-ret sf-result) (im-ret sf-result))
:type :method :definition :method
:return ((complex (val re-ret) (val im-ret)) :return ((complex (val re-ret) (val im-ret))
(complex (err re-ret) (err im-ret)))) (complex (err re-ret) (err im-ret))))
(defmfun gsl-cos ((x float)) (defmfun gsl-cos ((x float))
"gsl_sf_cos_e" ((x :double) (ret sf-result)) "gsl_sf_cos_e" ((x :double) (ret sf-result))
:type :method :definition :method
:export t) :export t)
(defmfun gsl-cos ((x complex)) (defmfun gsl-cos ((x complex))
"gsl_sf_complex_cos_e" "gsl_sf_complex_cos_e"
(((realpart x) :double) ((imagpart x) :double) (((realpart x) :double) ((imagpart x) :double)
(re-ret sf-result) (im-ret sf-result)) (re-ret sf-result) (im-ret sf-result))
:type :method :definition :method
:return ((complex (val re-ret) (val im-ret)) :return ((complex (val re-ret) (val im-ret))
(complex (err re-ret) (err im-ret)))) (complex (err re-ret) (err im-ret))))
......
;; Zeta functions ;; Zeta functions
;; Liam Healy, Sat May 13 2006 - 23:27 ;; Liam Healy, Sat May 13 2006 - 23:27
;; Time-stamp: <2008-02-16 23:04:22EST zeta.lisp> ;; Time-stamp: <2008-07-12 13:40:50EDT zeta.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
(defmfun zeta ((n integer)) (defmfun zeta ((n integer))
"gsl_sf_zeta_int_e" ((n :int) (ret sf-result)) "gsl_sf_zeta_int_e" ((n :int) (ret sf-result))
:type :method :definition :method
:export t :export t
:documentation ; FDL :documentation ; FDL
"The Riemann zeta function zeta(n) for integer n, n \ne 1.") "The Riemann zeta function zeta(n) for integer n, n \ne 1.")
(defmfun zeta ((s float)) (defmfun zeta ((s float))
"gsl_sf_zeta_e" ((s :double) (ret sf-result)) "gsl_sf_zeta_e" ((s :double) (ret sf-result))
:type :method :definition :method
:documentation ; FDL :documentation ; FDL
"The Riemann zeta function zeta(s) for arbitrary s, s \ne 1.") "The Riemann zeta function zeta(s) for arbitrary s, s \ne 1.")
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
(defmfun zeta-1 ((n integer)) (defmfun zeta-1 ((n integer))
"gsl_sf_zetam1_int_e" ((n :int) (ret sf-result)) "gsl_sf_zetam1_int_e" ((n :int) (ret sf-result))
:type :method :definition :method
:export t :export t
:documentation ; FDL :documentation ; FDL
"The Riemann zeta function zeta(n) for integer n, n \ne 1.") "The Riemann zeta function zeta(n) for integer n, n \ne 1.")
(defmfun zeta-1 ((s float)) (defmfun zeta-1 ((s float))
"gsl_sf_zetam1_e" ((s :double) (ret sf-result)) "gsl_sf_zetam1_e" ((s :double) (ret sf-result))
:type :method :definition :method
:documentation ; FDL :documentation ; FDL
"The Riemann zeta function zeta(s) for arbitrary s, s \ne 1.") "The Riemann zeta function zeta(s) for arbitrary s, s \ne 1.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment