Commit 679dc967 authored by liam's avatar liam

On the rest of the files:

  Rename defun-gsl, defvariable.
  Clean up markup and header files.
  :size to size
  make-tests and assert-numerical-equal


git-svn-id: svn+ssh://pop/opt/space/mathematics/gsl/trunk@3295 a3d8a0fb-c1db-0310-ace7-a616afeb9e30
parent aefc0853
;; Chebyshev Approximations ;; Chebyshev Approximations
;; Liam Healy Sat Nov 17 2007 - 20:36 ;; Liam Healy Sat Nov 17 2007 - 20:36
;; Time-stamp: <2008-02-03 13:22:58EST chebyshev.lisp> ;; Time-stamp: <2008-02-17 18:02:26EST chebyshev.lisp>
;; $Id: $ ;; $Id: $
(in-package :gsl) (in-package :gsl)
...@@ -12,36 +12,36 @@ ...@@ -12,36 +12,36 @@
(defgo-s (chebyshev order function lower-limit upper-limit) (defgo-s (chebyshev order function lower-limit upper-limit)
allocate-chebyshev free-chebyshev initialize-chebyshev) allocate-chebyshev free-chebyshev initialize-chebyshev)
(defun-gsl allocate-chebyshev (order) (defmfun allocate-chebyshev (order)
"gsl_cheb_alloc" "gsl_cheb_alloc"
((order :size)) ((order size))
:c-return :pointer :c-return :pointer
:export nil :export nil
:index (letm chebyshev) :index (letm chebyshev)
:documentation :documentation ; FDL
"Allocate a Chebyshev series of specified order "Allocate a Chebyshev series of specified order
and return a pointer to it.") and return a pointer to it.")
(defun-gsl free-chebyshev (chebyshev) (defmfun free-chebyshev (chebyshev)
"gsl_cheb_free" "gsl_cheb_free"
((chebyshev :pointer)) ((chebyshev :pointer))
:c-return :void :c-return :void
:export nil :export nil
:index (letm chebyshev) :index (letm chebyshev)
:documentation :documentation ; FDL
"Free a previously allocated Chebyshev series.") "Free a previously allocated Chebyshev series.")
(defun-gsl initialize-chebyshev (chebyshev function lower-limit upper-limit) (defmfun initialize-chebyshev (chebyshev function lower-limit upper-limit)
"gsl_cheb_init" "gsl_cheb_init"
((chebyshev :pointer) (function :pointer) ((chebyshev :pointer) (function :pointer)
(lower-limit :double) (upper-limit :double)) (lower-limit :double) (upper-limit :double))
:export nil :export nil
:index (letm chebyshev) :index (letm chebyshev)
:documentation :documentation ; FDL
"Compute the Chebyshev approximation for the function over the range "Compute the Chebyshev approximation for the function over the range
(lower-limit, upper-limit) to the previously specified order. The (lower-limit, upper-limit) to the previously specified order. The
computation of the Chebyshev approximation is an @math{O(n^2)} computation of the Chebyshev approximation is an O(n^2)
process, and requires @math{n} function evaluations.") process, and requires n function evaluations.")
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Chebyshev series evaluation ;;;; Chebyshev series evaluation
...@@ -51,45 +51,45 @@ ...@@ -51,45 +51,45 @@
;;; to use the functions that do return error (and ignore it if ;;; to use the functions that do return error (and ignore it if
;;; desired) in the form of #'evaluate-chebyshev. ;;; desired) in the form of #'evaluate-chebyshev.
(defun-gsl evaluate-chebyshev-noerror (chebyshev x) (defmfun evaluate-chebyshev-noerror (chebyshev x)
"gsl_cheb_eval" "gsl_cheb_eval"
((chebyshev :pointer) (x :double)) ((chebyshev :pointer) (x :double))
:c-return :double :c-return :double
:index evaluate-chebyshev :index evaluate-chebyshev
:export nil :export nil
:documentation :documentation ; FDL
"Evaluate the Chebyshev series at a point x.") "Evaluate the Chebyshev series at a point x.")
(defun-gsl evaluate-chebyshev-noerror-order (chebyshev x order) (defmfun evaluate-chebyshev-noerror-order (chebyshev x order)
"gsl_cheb_eval_n" "gsl_cheb_eval_n"
((chebyshev :pointer) (order :size) (x :double)) ((chebyshev :pointer) (order size) (x :double))
:c-return :double :c-return :double
:index evaluate-chebyshev :index evaluate-chebyshev
:export nil :export nil
:documentation :documentation ; FDL
"Evaluate the Chebyshev series at a point x to at most the given order.") "Evaluate the Chebyshev series at a point x to at most the given order.")
(defun-gsl evaluate-chebyshev-full (chebyshev x) (defmfun evaluate-chebyshev-full (chebyshev x)
"gsl_cheb_eval_err" "gsl_cheb_eval_err"
((chebyshev :pointer) (x :double) (result :double) (abserr :double)) ((chebyshev :pointer) (x :double) (result :double) (abserr :double))
:index evaluate-chebyshev :index evaluate-chebyshev
:export nil :export nil
:documentation :documentation ; FDL
"Evaluate the Chebyshev series at a point x, returning result and "Evaluate the Chebyshev series at a point x, returning result and
an estimate of its absolute error.") an estimate of its absolute error.")
(defun-gsl evaluate-chebyshev-order (chebyshev x order) (defmfun evaluate-chebyshev-order (chebyshev x order)
"gsl_cheb_eval_n_err" "gsl_cheb_eval_n_err"
((chebyshev :pointer) (order :size) (x :double) (result :double) (abserr :double)) ((chebyshev :pointer) (order size) (x :double) (result :double) (abserr :double))
:index evaluate-chebyshev :index evaluate-chebyshev
:export nil :export nil
:documentation :documentation ; FDL
"Evaluate the Chebyshev series at a point x to at most the given order, "Evaluate the Chebyshev series at a point x to at most the given order,
returning result and an estimate of its absolute error.") returning result and an estimate of its absolute error.")
(export 'evaluate-chebyshev) (export 'evaluate-chebyshev)
(defun-optionals evaluate-chebyshev (chebyshev x &optional order) (defun-optionals evaluate-chebyshev (chebyshev x &optional order)
-full -order -full -order ; FDL
"Evaluate the Chebyshev series at a point x to at most the given order, "Evaluate the Chebyshev series at a point x to at most the given order,
returning result and an estimate of its absolute error.") returning result and an estimate of its absolute error.")
...@@ -97,18 +97,18 @@ ...@@ -97,18 +97,18 @@
;;;; Derivatives and integrals ;;;; Derivatives and integrals
;;;;**************************************************************************** ;;;;****************************************************************************
(defun-gsl derivative-chebyshev (derivative chebyshev) (defmfun derivative-chebyshev (derivative chebyshev)
"gsl_cheb_calc_deriv" "gsl_cheb_calc_deriv"
((derivative :pointer) (chebyshev :pointer)) ((derivative :pointer) (chebyshev :pointer))
:documentation :documentation ; FDL
"Compute the derivative of the Chebyshev series, storing "Compute the derivative of the Chebyshev series, storing
the derivative coefficients in the previously allocated series. the derivative coefficients in the previously allocated series.
The two series must have been allocated with the same order.") The two series must have been allocated with the same order.")
(defun-gsl integral-chebyshev (integral chebyshev) (defmfun integral-chebyshev (integral chebyshev)
"gsl_cheb_calc_integ" "gsl_cheb_calc_integ"
((integral :pointer) (chebyshev :pointer)) ((integral :pointer) (chebyshev :pointer))
:documentation :documentation ; FDL
"Compute the integral of the Chebyshev series, storing "Compute the integral of the Chebyshev series, storing
the integral coefficients in the previously allocated series. the integral coefficients in the previously allocated series.
The two series must have been allocated with the same order. The two series must have been allocated with the same order.
...@@ -147,7 +147,16 @@ ...@@ -147,7 +147,16 @@
(evaluate-chebyshev deriv x) (evaluate-chebyshev deriv x)
(evaluate-chebyshev integ x)))) (evaluate-chebyshev integ x))))
(lisp-unit:define-test chebyshev
(lisp-unit:assert-equal #|
'("0.715920990169d+00" "-0.150199666581d+01" "0.172397194040d+00") (make-tests chebyshev
(lisp-unit:fp-sequence (chebyshev-point-example 0.55d0)))) (chebyshev-point-example 0.55d0))
|#
(LISP-UNIT:DEFINE-TEST CHEBYSHEV
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 0.7159209901689866d0 -1.5019966658054353d0
0.17239719403979925d0))
(MULTIPLE-VALUE-LIST (CHEBYSHEV-POINT-EXAMPLE 0.55d0))))
;******************************************************** ;; Blocks of data
; file: block.lisp ;; Liam Healy, Mon Mar 27 2006 - 12:28
; description: Blocks of data ;; Time-stamp: <2008-02-17 09:18:05EST block.lisp>
; date: Mon Mar 27 2006 - 12:28 ;; $Id: $
; author: Liam M. Healy
; modified: Wed May 31 2006 - 19:00
;********************************************************
;;; $Id: $
(in-package :gsl) (in-package :gsl)
;;; Block definition ;;; Block definition
(cffi:defcstruct block (cffi:defcstruct block
(size :size) (size size)
(data :pointer)) (data :pointer))
(defdata "block" block-double double-float) (defdata "block" block-double double-float)
......
;; Combinations ;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51 ;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-04 19:25:57EST combination.lisp> ;; Time-stamp: <2008-02-17 10:01:38EST combination.lisp>
;; $Id: $ ;; $Id: $
(in-package :gsl) (in-package :gsl)
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
;;; GSL-combination definition ;;; GSL-combination definition
(cffi:defcstruct gsl-combination-c (cffi:defcstruct gsl-combination-c
(n :size) (n size)
(k :size) (k size)
(data :pointer)) (data :pointer))
;;; Allocation, freeing, reading and writing ;;; Allocation, freeing, reading and writing
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
;;;; Getting values ;;;; Getting values
;;;;**************************************************************************** ;;;;****************************************************************************
(defun-gsl gsl-aref ((combination gsl-combination) &rest indices) (defmfun gsl-aref ((combination gsl-combination) &rest indices)
"gsl_combination_get" "gsl_combination_get"
(((pointer combination) :pointer) ((first indices) :size)) (((pointer combination) :pointer) ((first indices) size))
:type :method :type :method
:c-return :size :c-return size
:documentation ; FDL :documentation ; FDL
"The ith element of the combination.") "The ith element of the combination.")
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
;;;; Setting values ;;;; Setting values
;;;;**************************************************************************** ;;;;****************************************************************************
(defun-gsl init-first (combination) (defmfun init-first (combination)
"gsl_combination_init_first" "gsl_combination_init_first"
(((pointer combination) gsl-combination-c)) (((pointer combination) gsl-combination-c))
:c-return :void :c-return :void
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"Initialize the combination c to the lexicographically "Initialize the combination c to the lexicographically
first combination, i.e. (0,1,2,...,k-1).") first combination, i.e. (0,1,2,...,k-1).")
(defun-gsl init-last (combination) (defmfun init-last (combination)
"gsl_combination_init_last" "gsl_combination_init_last"
(((pointer combination) gsl-combination-c)) (((pointer combination) gsl-combination-c))
:c-return :void :c-return :void
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
"Initialize the combination c to the lexicographically "Initialize the combination c to the lexicographically
last combination, i.e. (n-k,n-k+1,...,n-1).") last combination, i.e. (n-k,n-k+1,...,n-1).")
(defun-gsl copy (destination source) (defmfun copy (destination source)
"gsl_combination_memcpy" "gsl_combination_memcpy"
(((pointer destination) gsl-combination-c) (((pointer destination) gsl-combination-c)
((pointer source) gsl-combination-c)) ((pointer source) gsl-combination-c))
...@@ -77,23 +77,23 @@ ...@@ -77,23 +77,23 @@
;;;; Combination properties ;;;; Combination properties
;;;;**************************************************************************** ;;;;****************************************************************************
(defun-gsl combination-range (c) (defmfun combination-range (c)
"gsl_combination_n" "gsl_combination_n"
(((pointer c) gsl-combination-c)) (((pointer c) gsl-combination-c))
:c-return :size :c-return size
:documentation ; FDL :documentation ; FDL
"The range (n) of the combination c.") "The range (n) of the combination c.")
(defun-gsl combination-size (c) (defmfun combination-size (c)
"gsl_combination_k" "gsl_combination_k"
(((pointer c) gsl-combination-c)) (((pointer c) gsl-combination-c))
:c-return :size :c-return size
:documentation ; FDL :documentation ; FDL
"The number of elements (k) in the combination c.") "The number of elements (k) in the combination c.")
#| #|
;;; Unnecessary, gsl-array serves this function. ;;; Unnecessary, gsl-array serves this function.
(defun-gsl combination-data (c) (defmfun combination-data (c)
"gsl_combination_data" "gsl_combination_data"
(((pointer c) gsl-combination-c)) (((pointer c) gsl-combination-c))
:c-return :pointer :c-return :pointer
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
"A pointer to the array of elements in the combination.") "A pointer to the array of elements in the combination.")
|# |#
(defun-gsl data-valid ((combination gsl-combination)) (defmfun data-valid ((combination gsl-combination))
"gsl_combination_valid" "gsl_combination_valid"
(((pointer combination) :pointer)) (((pointer combination) :pointer))
:type :method :type :method
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
;;;; Combination functions ;;;; Combination functions
;;;;**************************************************************************** ;;;;****************************************************************************
(defun-gsl combination-next (c) (defmfun combination-next (c)
"gsl_combination_next" (((pointer c) gsl-combination-c)) "gsl_combination_next" (((pointer c) gsl-combination-c))
:c-return :success-failure :c-return :success-failure
:invalidate (c) :invalidate (c)
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
repeatedly applying this function will iterate through all possible repeatedly applying this function will iterate through all possible
combinations of a given order.") combinations of a given order.")
(defun-gsl combination-previous (c) (defmfun combination-previous (c)
"gsl_combination_prev" "gsl_combination_prev"
(((pointer c) gsl-combination-c)) (((pointer c) gsl-combination-c))
:c-return :success-failure :c-return :success-failure
...@@ -142,33 +142,64 @@ ...@@ -142,33 +142,64 @@
;;;; Examples and unit test ;;;; Examples and unit test
;;;;**************************************************************************** ;;;;****************************************************************************
(lisp-unit:define-test combination #|
(lisp-unit:assert-eql ; combination-range (make-tests combination
4 (letm ((comb (combination 4 2 t))) ; combination-range
(letm ((comb (combination 4 2 t))) (combination-range comb))
(combination-range comb))) (letm ((comb (combination 4 2 t))) ; combination-size
(lisp-unit:assert-eql ; combination-size (combination-size comb))
2 (letm ((comb (combination 4 2 t))) ; init-first, combination-next
(letm ((comb (combination 4 2 t))) (init-first comb)
(combination-size comb))) (loop collect (data comb)
(lisp-unit:assert-equal ; init-first, combination-next while (combination-next comb)))
'((0 1) (0 2) (0 3) (1 2) (1 3) (2 3)) (letm ((comb (combination 4 2 t))) ; init-last, combination-previous
(letm ((comb (combination 4 2 t))) (init-last comb)
(init-first comb) (loop collect (data comb)
(loop collect (data comb) while (combination-previous comb)))
while (combination-next comb)))) (loop for i from 0 to 4 ; combination-next
(lisp-unit:assert-equal ; init-last, combination-previous append
'((2 3) (1 3) (1 2) (0 3) (0 2) (0 1)) (letm ((comb (combination 4 i t)))
(letm ((comb (combination 4 2 t))) (init-first comb)
(init-last comb) (loop collect (data comb)
(loop collect (data comb) while (combination-next comb)))))
while (combination-previous comb)))) |#
(lisp-unit:assert-equal ; combination-next
'(NIL (0) (1) (2) (3) (0 1) (0 2) (0 3) (1 2) (1 3) (2 3) (LISP-UNIT:DEFINE-TEST COMBINATION
(0 1 2) (0 1 3) (0 2 3) (1 2 3) (0 1 2 3)) (LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(loop for i from 0 to 4 (LIST 4)
append (MULTIPLE-VALUE-LIST
(letm ((comb (combination 4 i t))) (LETM ((COMB (COMBINATION 4 2 T)))
(init-first comb) (COMBINATION-RANGE COMB))))
(loop collect (data comb) (LISP-UNIT::ASSERT-NUMERICAL-EQUAL
while (combination-next comb)))))) (LIST 2)
(MULTIPLE-VALUE-LIST
(LETM ((COMB (COMBINATION 4 2 T)))
(COMBINATION-SIZE COMB))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST (LIST 0 1) (LIST 0 2) (LIST 0 3) (LIST 1 2)
(LIST 1 3) (LIST 2 3)))
(MULTIPLE-VALUE-LIST
(LETM ((COMB (COMBINATION 4 2 T))) (INIT-FIRST COMB)
(LOOP COLLECT (DATA COMB) WHILE
(COMBINATION-NEXT COMB)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST (LIST (LIST 2 3) (LIST 1 3) (LIST 1 2) (LIST 0 3)
(LIST 0 2) (LIST 0 1)))
(MULTIPLE-VALUE-LIST
(LETM ((COMB (COMBINATION 4 2 T))) (INIT-LAST COMB)
(LOOP COLLECT (DATA COMB) WHILE
(COMBINATION-PREVIOUS COMB)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST (LIST) (LIST 0) (LIST 1) (LIST 2) (LIST 3)
(LIST 0 1) (LIST 0 2) (LIST 0 3) (LIST 1 2)
(LIST 1 3) (LIST 2 3) (LIST 0 1 2) (LIST 0 1 3)
(LIST 0 2 3) (LIST 1 2 3) (LIST 0 1 2 3)))
(MULTIPLE-VALUE-LIST
(LOOP FOR I FROM 0 TO 4 APPEND
(LETM ((COMB (COMBINATION 4 I T)))
(INIT-FIRST COMB)
(LOOP COLLECT (DATA COMB) WHILE
(COMBINATION-NEXT COMB)))))))
;; Using GSL storage. ;; Using GSL bulk data (vectors, matrices, etc.) storage.
;; Liam Healy, Sun Mar 26 2006 - 16:32 ;; Liam Healy, Sun Mar 26 2006 - 16:32
;; Time-stamp: <2008-02-10 15:30:20EST data.lisp> ;; Time-stamp: <2008-02-17 09:18:27EST data.lisp>
;; $Id: $ ;; $Id: $
(in-package :gsl) (in-package :gsl)
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
(setf (pointer object) pointer)) (setf (pointer object) pointer))
;;; (args (loop for i below dimensions collect (intern (format nil "I~d" i)))) ;;; (args (loop for i below dimensions collect (intern (format nil "I~d" i))))
;;; (mapcar (lambda (v) `(,v :size)) args) ;;; (mapcar (lambda (v) `(,v size)) args)
(defparameter *data-name-alist* (defparameter *data-name-alist*
'((FIXNUM . "_int") '((FIXNUM . "_int")
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
(flet ((gsl-name (function-name) (flet ((gsl-name (function-name)
(format nil "gsl_~a_~a" c-string function-name))) (format nil "gsl_~a_~a" c-string function-name)))
(let* ((cargs (loop for i below dimensions (let* ((cargs (loop for i below dimensions
collect `((nth ,i (storage-size object)) :size))) collect `((nth ,i (storage-size object)) size)))
(object-name (make-symbol-from-strings *gsl-prefix* cl-symbol))) (object-name (make-symbol-from-strings *gsl-prefix* cl-symbol)))
`(progn `(progn
(defclass ,object-name (,superclass) (defclass ,object-name (,superclass)
...@@ -171,31 +171,31 @@ ...@@ -171,31 +171,31 @@
:allocation :class))) :allocation :class)))
(data-go ,cl-symbol (data-go ,cl-symbol
,(or (member superclass '(gsl-matrix)) (member object-name '(gsl-combination)))) ,(or (member superclass '(gsl-matrix)) (member object-name '(gsl-combination))))
(defun-gsl alloc ((object ,object-name)) (defmfun alloc ((object ,object-name))
,(gsl-name "alloc") ,cargs ,(gsl-name "alloc") ,cargs
:type :method :type :method
:c-return (cr :pointer) :c-return (cr :pointer)
:return ((assign-pointer object cr))) :return ((assign-pointer object cr)))
(defun-gsl calloc ((object ,object-name)) (defmfun calloc ((object ,object-name))
,(gsl-name "calloc") ,cargs ,(gsl-name "calloc") ,cargs
:type :method :type :method
:c-return (cr :pointer) :c-return (cr :pointer)
:return ((assign-pointer object cr))) :return ((assign-pointer object cr)))
(defun-gsl free ((object ,object-name)) (defmfun free ((object ,object-name))
,(gsl-name "free") (((pointer object) :pointer)) ,(gsl-name "free") (((pointer object) :pointer))
:type :method :type :method
:c-return :void) :c-return :void)
(defun-gsl write-binary ((object ,object-name) stream) (defmfun write-binary ((object ,object-name) stream)
,(gsl-name "fwrite") ((stream :pointer) ((pointer object) :pointer)) ,(gsl-name "fwrite") ((stream :pointer) ((pointer object) :pointer))
:type :method) :type :method)
(defun-gsl read-binary ((object ,object-name) stream) (defmfun read-binary ((object ,object-name) stream)
,(gsl-name "fread") ((stream :pointer) ((pointer object) :pointer)) ,(gsl-name "fread") ((stream :pointer) ((pointer object) :pointer))
:type :method) :type :method)
(defun-gsl write-formatted ((object ,object-name) stream format) (defmfun write-formatted ((object ,object-name) stream format)
,(gsl-name "fprintf") ,(gsl-name "fprintf")
((stream :pointer) ((pointer object) :pointer) (format :string)) ((stream :pointer) ((pointer object) :pointer) (format :string))
:type :method) :type :method)
(defun-gsl read-formatted ((object ,object-name) stream format) (defmfun read-formatted ((object ,object-name) stream format)
,(gsl-name "fscanf") ,(gsl-name "fscanf")
((stream :pointer) ((pointer object) :pointer) (format :string)) ((stream :pointer) ((pointer object) :pointer) (format :string))
:type :method))))) :type :method)))))
...@@ -213,13 +213,13 @@ ...@@ -213,13 +213,13 @@
;;; (make-symbol-from-strings *gsl-prefix* 'vector-fixnum) ;;; (make-symbol-from-strings *gsl-prefix* 'vector-fixnum)
;;; GSL-VECTOR-FIXNUM ;;; GSL-VECTOR-FIXNUM
(defun defun-gsl-all (types ctypes string general-class args) (defun defmfun-all (types ctypes string general-class args)
"A defun-gsl for each of the declared data types." "A defmfun for each of the declared data types."
`(progn `(progn
,@(loop for type in types ,@(loop for type in types
for ctype in ctypes for ctype in ctypes
collect collect
`(defun-gsl ,(first args) `(defmfun ,(first args)
;; Set the class name for the arglist ;; Set the class name for the arglist
,(mapcar ,(mapcar
(lambda (x) (lambda (x)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
;; Eigenvectors and eigenvalues ;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52 ;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <2008-02-03 14:14:10EST eigensystems.lisp> ;; Time-stamp: <2008-02-17 11:32:46EST eigensystems.lisp>
;; $Id: $ ;; $Id: $
(in-package :gsl) (in-package :gsl)
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
(defgo-s (eigen-symm n) eigen-symm-alloc eigen-symm-free) (defgo-s (eigen-symm n) eigen-symm-alloc eigen-symm-free)
(defun-gsl eigen-symm-alloc (n) (defmfun eigen-symm-alloc (n)
"gsl_eigen_symm_alloc" ((n :size)) "gsl_eigen_symm_alloc" ((n size))
:c-return :pointer :c-return :pointer
:export nil :export nil
:index '(letm eigen-symm) :index '(letm eigen-symm)
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
n-by-n real symmetric matrices. The size of the workspace n-by-n real symmetric matrices. The size of the workspace
is O(2n).") is O(2n).")
(defun-gsl eigen-symm-free (w) (defmfun eigen-symm-free (w)
"gsl_eigen_symm_free" ((w :pointer)) "gsl_eigen_symm_free" ((w :pointer))
:c-return :void :c-return :void
:export nil :export nil
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
(defgo-s (eigen-symmv n) eigen-symmv-alloc eigen-symmv-free) (defgo-s (eigen-symmv n) eigen-symmv-alloc eigen-symmv-free)
(defun-gsl eigen-symmv-alloc (n) (defmfun eigen-symmv-alloc (n)
"gsl_eigen_symmv_alloc" ((n :size)) "gsl_eigen_symmv_alloc" ((n size))
:c-return :pointer :c-return :pointer
:export nil :export nil
:index '(letm eigen-symmv) :index '(letm eigen-symmv)
...@@ -41,26 +41,26 @@ ...@@ -41,26 +41,26 @@
eigenvectors of n-by-n real symmetric matrices. The size of eigenvectors of n-by-n real symmetric matrices. The size of
the workspace is O(4n).") the workspace is O(4n).")
(defun-gsl eigen-symmv-free (w) (defmfun eigen-symmv-free (w)
"gsl_eigen_symmv_free" ((w :pointer)) "gsl_eigen_symmv_free" ((w :pointer))
:index '(letm eigen-symmv) :index '(letm eigen-symmv)
:c-return :void :c-return :void
:documentation ; FDL :documentation ; FDL
"Free the memory associated with the workspace w.") "Free the memory associated with the workspace w.")
(defun-gsl eigenvalues-symmetric (A eval ws) (defmfun eigenvalues-symmetric (A eval ws)
"gsl_eigen_symm" ((A gsl-matrix-c) (eval gsl-vector-c) (ws :pointer)) "gsl_eigen_symm" ((A gsl-matrix-c) (eval gsl-vector-c) (ws :pointer))
:documentation ; FDL :documentation ; FDL
"Eigenvalues of the real symmetric matrix "Eigenvalues of the real symmetric matrix
A. Additional workspace of the appropriate size must be provided A. Additional workspace of the appropriate size must be provided
in w. The diagonal and lower triangular part of A are in w. The diagonal and lower triangular part of A are
destroyed during the computation, but the strict upper triangular part destroyed during the computation, but the strict upper triangular part
is not referenced. The eigenvalues are stored in the vector @var{eval} is not referenced. The eigenvalues are stored in the vector eval