Commit 8a0ac730 authored by Liam Healy's avatar Liam Healy

Set mpointer vlaue, show relevant .h file; non-int return for reinitialize-instance

In defmobject, set the mpointer value if #'allocate is being called.
For each file that defines a defmobject, I put a comment at the top
showing the relevant GSL header file.  For generators and quasi, the
(re)initializing function returns void and not an :int, so that is
changed in the defmobject definition, which now permits a list of two
elements in initialize-suffix, with the second element indicating the
:c-return.
parent 297c08b2
;; Basis splines. ;; Basis splines.
;; Liam Healy 2008-02-18 14:43:20EST basis-splines.lisp ;; Liam Healy 2008-02-18 14:43:20EST basis-splines.lisp
;; Time-stamp: <2008-12-26 12:51:25EST basis-splines.lisp> ;; Time-stamp: <2008-12-26 18:25:41EST basis-splines.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; /usr/include/gsl/gsl_bspline.h
;;; Should be subclass of interpolation? ;;; Should be subclass of interpolation?
(defmobject basis-spline "gsl_bspline" (defmobject basis-spline "gsl_bspline"
......
;; Chebyshev Approximations ;; Chebyshev Approximations
;; Liam Healy Sat Nov 17 2007 - 20:36 ;; Liam Healy Sat Nov 17 2007 - 20:36
;; Time-stamp: <2008-12-26 16:43:37EST chebyshev.lisp> ;; Time-stamp: <2008-12-26 18:21:11EST chebyshev.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_chebyshev.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Creation and calculation of Chebyshev series ;;;; Creation and calculation of Chebyshev series
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; 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-12-26 17:03:39EST eigensystems.lisp> ;; Time-stamp: <2008-12-26 18:57:10EST eigensystems.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_eigen.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Workspace ;;;; Workspace
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Discrete Hankel Transforms. ;; Discrete Hankel Transforms.
;; Liam Healy, Sat Dec 8 2007 - 16:50 ;; Liam Healy, Sat Dec 8 2007 - 16:50
;; Time-stamp: <2008-12-26 16:55:21EST hankel.lisp> ;; Time-stamp: <2008-12-26 18:46:20EST hankel.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_dht.h
;;; Everything compiles, but not tested -- need example. ;;; Everything compiles, but not tested -- need example.
;;; We don't use gsl_dht_new = gsl_dht_alloc + gsl_dht_init.
;;; Create the Hankel transform object and essential methods/functions. ;;; Create the Hankel transform object and essential methods/functions.
(defmobject hankel "gsl_dht" (defmobject hankel "gsl_dht"
...@@ -13,9 +16,8 @@ ...@@ -13,9 +16,8 @@
"discrete Hankel Transform" "discrete Hankel Transform"
"Allocate a Discrete Hankel transform object of the given size and "Allocate a Discrete Hankel transform object of the given size and
optionally initialize the transform for the given values of nu and x." optionally initialize the transform for the given values of nu and x."
"new" "init"
((nu :double) (xmax :double))) ((nu :double) (xmax :double)))
;;; We don't use gsl_dht_init because we use gsl_dht_new?
(defmfun apply-hankel (hankel array-in array-out) (defmfun apply-hankel (hankel array-in array-out)
"gsl_dht_apply" "gsl_dht_apply"
......
;; Histogram probability distribution. ;; Histogram probability distribution.
;; Liam Healy, Mon Jan 1 2007 - 17:51 ;; Liam Healy, Mon Jan 1 2007 - 17:51
;; Time-stamp: <2008-12-26 14:47:01EST probability-distribution.lisp> ;; Time-stamp: <2008-12-26 18:38:41EST probability-distribution.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;; /usr/include/gsl/gsl_histogram.h ;;; /usr/include/gsl/gsl_histogram.h
;; /usr/include/gsl/gsl_histogram2d.h ;;; /usr/include/gsl/gsl_histogram2d.h
(defmobject histogram-pdf (defmobject histogram-pdf
"gsl_histogram_pdf" "gsl_histogram_pdf"
......
;; Definition of GSL objects and ways to use them. ;; Definition of GSL objects and ways to use them.
;; Liam Healy, Sun Dec 3 2006 - 10:21 ;; Liam Healy, Sun Dec 3 2006 - 10:21
;; Time-stamp: <2008-12-26 17:07:25EST mobject.lisp> ;; Time-stamp: <2008-12-26 18:13:24EST mobject.lisp>
;; $Id$ ;; $Id$
;;; GSL objects are represented in GSLL as and instance of a 'mobject. ;;; GSL objects are represented in GSLL as and instance of a 'mobject.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
(in-package :gsl) (in-package :gsl)
(defclass mobject () (defclass mobject ()
((mpointer :initarg :mpointer :reader mpointer ((mpointper :initarg :mpointer :reader mpointer
:documentation "A pointer to the GSL representation of the object."))) :documentation "A pointer to the GSL representation of the object.")))
(defmacro defmobject (defmacro defmobject
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
;; If prefix is a list, the first is the actual prefix, and the ;; If prefix is a list, the first is the actual prefix, and the
;; second is the name of the allocateor. I'm looking at you, ;; second is the name of the allocateor. I'm looking at you,
;; discrete-random. Grrr. ;; discrete-random. Grrr.
;; Argument 'initialize-suffix: string appended to prefix for form GSL function name
;; or a list of such a string and the c-return argument.
(let* ((settingp (make-symbol "SETTINGP")) (let* ((settingp (make-symbol "SETTINGP"))
(arglists (arglists
(when arglists-function (when arglists-function
...@@ -51,7 +53,8 @@ ...@@ -51,7 +53,8 @@
((object ,class) &key mpointer ,@cl-alloc-args) ((object ,class) &key mpointer ,@cl-alloc-args)
(unless mpointer (unless mpointer
(setf mpointer (setf mpointer
(allocate object ,@(symbol-keyword-symbol cl-alloc-args)))) (allocate object ,@(symbol-keyword-symbol cl-alloc-args))
(slot-value object 'mpointer) mpointer))
(trivial-garbage:finalize (trivial-garbage:finalize
object object
(lambda () (lambda ()
...@@ -62,10 +65,15 @@ ...@@ -62,10 +65,15 @@
,@(when initialize-suffix ,@(when initialize-suffix
`((defmfun reinitialize-instance `((defmfun reinitialize-instance
((object ,class) &key ,@cl-initialize-args) ((object ,class) &key ,@cl-initialize-args)
,(format nil "~a_~a" realprefix initialize-suffix) ,(format nil "~a_~a" realprefix
(if (listp initialize-suffix)
(first initialize-suffix)
initialize-suffix))
(((mpointer object) :pointer) ,@initialize-args) (((mpointer object) :pointer) ,@initialize-args)
:definition :method :definition :method
:qualifier :after :qualifier :after
,@(when (listp initialize-suffix)
`(:c-return ,(second initialize-suffix)))
:return (object) :return (object)
,@(when inputs `(:inputs ,inputs)) ,@(when inputs `(:inputs ,inputs))
:export nil :export nil
......
;; Interpolation allocation, initialization, and freeing. ;; Interpolation allocation, initialization, and freeing.
;; Liam Healy, Sun Nov 4 2007 - 17:24 ;; Liam Healy, Sun Nov 4 2007 - 17:24
;; Time-stamp: <2008-12-26 11:20:11EST interpolation.lisp> ;; Time-stamp: <2008-12-26 18:19:19EST interpolation.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_interp.h
;;; /usr/include/gsl/gsl_spline.h
;;; A spline is an interpolation that also stores the arrays xa and ya, ;;; A spline is an interpolation that also stores the arrays xa and ya,
;;; so they need not be supplied on each call. ;;; so they need not be supplied on each call.
(defmobject interpolation "gsl_interp" (defmobject interpolation "gsl_interp"
......
;; Monte Carlo Integration ;; Monte Carlo Integration
;; Liam Healy Sat Feb 3 2007 - 17:42 ;; Liam Healy Sat Feb 3 2007 - 17:42
;; Time-stamp: <2008-12-26 17:05:48EST monte-carlo.lisp> ;; Time-stamp: <2008-12-26 18:59:23EST monte-carlo.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_monte.h
;;; /usr/include/gsl/gsl_monte_plain.h
;;; /usr/include/gsl/gsl_monte_miser.h
;;; /usr/include/gsl/gsl_monte_vegas.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; PLAIN Monte Carlo ;;;; PLAIN Monte Carlo
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Numerical integration ;; Numerical integration
;; Liam Healy, Wed Jul 5 2006 - 23:14 ;; Liam Healy, Wed Jul 5 2006 - 23:14
;; Time-stamp: <2008-12-26 17:02:30EST numerical-integration.lisp> ;; Time-stamp: <2008-12-26 18:54:27EST numerical-integration.lisp>
;; $Id$ ;; $Id$
;;; To do: QAWS, QAWO, QAWF, more tests ;;; To do: QAWS, QAWO, QAWF, more tests
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_integration.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; QNG non-adaptive Gauss-Kronrod integration ;;;; QNG non-adaptive Gauss-Kronrod integration
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Polynomials ;; Polynomials
;; Liam Healy, Tue Mar 21 2006 - 18:33 ;; Liam Healy, Tue Mar 21 2006 - 18:33
;; Time-stamp: <2008-12-26 17:01:15EST polynomial.lisp> ;; Time-stamp: <2008-12-26 18:53:14EST polynomial.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_poly.h
;;; Provide autotranslation from CL pure arrays? ;;; Provide autotranslation from CL pure arrays?
;;; Divided differences not complete/tested. ;;; Divided differences not complete/tested.
......
;; Bernoulli distribution ;; Bernoulli distribution
;; Liam Healy, Sat Nov 25 2006 - 16:59 ;; Liam Healy, Sat Nov 25 2006 - 16:59
;; Time-stamp: <2008-12-26 11:38:55EST bernoulli.lisp> ;; Time-stamp: <2008-12-26 18:05:04EST bernoulli.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
(defmfun bernoulli (generator p) (defmfun bernoulli (generator p)
"gsl_ran_bernoulli" "gsl_ran_bernoulli"
(((generator generator) :pointer) (p :double)) (((mpointer generator) :pointer) (p :double))
:c-return :uint :c-return :uint
:documentation ; FDL :documentation ; FDL
"Returns either 0 or 1, the result of a Bernoulli trial "Returns either 0 or 1, the result of a Bernoulli trial
......
;; Discrete random variables ;; Discrete random variables
;; Liam Healy, Sat Nov 11 2006 - 21:51 ;; Liam Healy, Sat Nov 11 2006 - 21:51
;; Time-stamp: <2008-12-26 17:00:20EST discrete.lisp> ;; Time-stamp: <2008-12-26 18:52:04EST discrete.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_randist.h
(defmobject discrete-random (defmobject discrete-random
("gsl_ran_discrete" "gsl_ran_discrete_preproc") ("gsl_ran_discrete" "gsl_ran_discrete_preproc")
(((dim0 probabilities) sizet) ((c-pointer probabilities) :pointer)) (((dim0 probabilities) sizet) ((c-pointer probabilities) :pointer))
......
;; Generators of random numbers. ;; Generators of random numbers.
;; Liam Healy, Sat Jul 15 2006 - 14:43 ;; Liam Healy, Sat Jul 15 2006 - 14:43
;; Time-stamp: <2008-12-26 17:08:09EST generators.lisp> ;; Time-stamp: <2008-12-26 18:17:35EST generators.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_rng.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Object ;;;; Object
;;;;**************************************************************************** ;;;;****************************************************************************
...@@ -23,7 +25,7 @@ ...@@ -23,7 +25,7 @@
For example, the original Fortran source code for the *ranlux* For example, the original Fortran source code for the *ranlux*
generator used a seed of 314159265, and so choosing s equal to zero generator used a seed of 314159265, and so choosing s equal to zero
reproduces this when using *ranlux*." reproduces this when using *ranlux*."
"set" ("set" :void)
((value :ulong))) ((value :ulong)))
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Quasi-random sequences in arbitrary dimensions. ;; Quasi-random sequences in arbitrary dimensions.
;; Liam Healy, Sun Jul 16 2006 - 15:54 ;; Liam Healy, Sun Jul 16 2006 - 15:54
;; Time-stamp: <2008-12-26 17:09:22EST quasi.lisp> ;; Time-stamp: <2008-12-26 18:49:30EST quasi.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_qrng.h
(defmobject quasi-random-number-generator (defmobject quasi-random-number-generator
"gsl_qrng" "gsl_qrng"
((rng-type :pointer) (dimension :uint)) ((rng-type :pointer) (dimension :uint))
...@@ -12,7 +14,7 @@ ...@@ -12,7 +14,7 @@
"Make and optionally initialize the generator q to its starting point. "Make and optionally initialize the generator q to its starting point.
Note that quasi-random sequences do not use a seed and always produce Note that quasi-random sequences do not use a seed and always produce
the same set of values." the same set of values."
"init" ("init" :void)
nil) nil)
(defmfun qrng-get (generator return-vector) (defmfun qrng-get (generator return-vector)
......
;; Series acceleration. ;; Series acceleration.
;; Liam Healy, Wed Nov 21 2007 - 18:41 ;; Liam Healy, Wed Nov 21 2007 - 18:41
;; Time-stamp: <2008-12-26 16:44:29EST series-acceleration.lisp> ;; Time-stamp: <2008-12-26 18:22:40EST series-acceleration.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_sum.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Creation and calculation of Levin series acceleration ;;;; Creation and calculation of Levin series acceleration
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Linear least squares, or linear regression ;; Linear least squares, or linear regression
;; Liam Healy <2008-01-21 12:41:46EST linear-least-squares.lisp> ;; Liam Healy <2008-01-21 12:41:46EST linear-least-squares.lisp>
;; Time-stamp: <2008-12-26 16:51:06EST linear-least-squares.lisp> ;; Time-stamp: <2008-12-26 18:38:44EST linear-least-squares.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_fit.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Linear regression ;;;; Linear regression
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Multivariate minimization. ;; Multivariate minimization.
;; Liam Healy <Tue Jan 8 2008 - 21:28> ;; Liam Healy <Tue Jan 8 2008 - 21:28>
;; Time-stamp: <2008-12-26 17:21:08EST minimization-multi.lisp> ;; Time-stamp: <2008-12-26 18:33:28EST minimization-multi.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_multimin.h
;; In the parabaloid example, I notice that the consruct ;; In the parabaloid example, I notice that the consruct
;; (min-test-gradient (mfdfminimizer-gradient minimizer) 1.0d-3) ;; (min-test-gradient (mfdfminimizer-gradient minimizer) 1.0d-3)
;; is constructing a CL vector-double-float (in mfdfminimizer-gradient) and ;; is constructing a CL vector-double-float (in mfdfminimizer-gradient) and
......
;; Univariate minimization ;; Univariate minimization
;; Liam Healy Tue Jan 8 2008 - 21:02 ;; Liam Healy Tue Jan 8 2008 - 21:02
;; Time-stamp: <2008-12-26 17:21:37EST minimization-one.lisp> ;; Time-stamp: <2008-12-26 18:35:53EST minimization-one.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_min.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Initialization ;;;; Initialization
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Nonlinear least squares fitting. ;; Nonlinear least squares fitting.
;; Liam Healy, 2008-02-09 12:59:16EST nonlinear-least-squares.lisp ;; Liam Healy, 2008-02-09 12:59:16EST nonlinear-least-squares.lisp
;; Time-stamp: <2008-12-26 17:17:06EST nonlinear-least-squares.lisp> ;; Time-stamp: <2008-12-26 18:29:44EST nonlinear-least-squares.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_multifit_nlin.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Function-only solver object ;;;; Function-only solver object
;;;;**************************************************************************** ;;;;****************************************************************************
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
;;;; Function and derivative solver object ;;;; Function and derivative solver object
;;;;**************************************************************************** ;;;;****************************************************************************
(defmobject nonlinear-fdffit "gsl_multifit_fsolver" (defmobject nonlinear-fdffit "gsl_multifit_fdfsolver"
((solver-type :pointer) (number-of-observations sizet) (number-of-parameters sizet)) ((solver-type :pointer) (number-of-observations sizet) (number-of-parameters sizet))
"nonlinear least squares fit with function and derivative" ; FDL "nonlinear least squares fit with function and derivative" ; FDL
"The number of observations must be greater than or "The number of observations must be greater than or
......
;;; Multivariate roots. ;;; Multivariate roots.
;;; Liam Healy 2008-01-12 12:49:08 ;;; Liam Healy 2008-01-12 12:49:08
;;; Time-stamp: <2008-12-26 17:18:53EST roots-multi.lisp> ;;; Time-stamp: <2008-12-26 18:37:15EST roots-multi.lisp>
;;; $Id$ ;;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_multiroots.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Function definition ;;;; Function definition
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; One-dimensional root solver. ;; One-dimensional root solver.
;; Liam Healy ;; Liam Healy
;; Time-stamp: <2008-12-26 17:13:52EST roots-one.lisp> ;; Time-stamp: <2008-12-26 18:31:13EST roots-one.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; /usr/include/gsl/gsl_roots.h
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Function definition ;;;; Function definition
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Make tests from examples. ;; Make tests from examples.
;; Liam Healy 2008-09-07 21:00:48EDT generate-tests.lisp ;; Liam Healy 2008-09-07 21:00:48EDT generate-tests.lisp
;; Time-stamp: <2008-11-16 12:10:07EST generate-tests.lisp> ;; Time-stamp: <2008-12-26 17:54:49EST generate-tests.lisp>
;; $Id: $ ;; $Id: $
;;; Througout the GSLL interface definition files are #'save-test ;;; Througout the GSLL interface definition files are #'save-test
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
;;; This is commented out because it shouldn't normally be run. It ;;; This is commented out because it shouldn't normally be run. It
;;; will regenerate all tests, so there will be no regression tests to ;;; will regenerate all tests, so there will be no regression tests to
;;; previous versions. DON'T FORGET THE TRAILING SLASH ON THE PATH ;;; previous versions. DON'T FORGET THE TRAILING SLASH ON THE PATH
;;; (write-tests "/home/liam/mathematics/gsl/tests/")
#+(or) #+(or)
(defun write-tests (path) (defun write-tests (path)
"Write all the tests to the appropriate file." "Write all the tests to the appropriate file."
......
;; Wavelet transforms. ;; Wavelet transforms.
;; Liam Healy, Mon Nov 26 2007 - 20:43 ;; Liam Healy, Mon Nov 26 2007 - 20:43
;; Time-stamp: <2008-12-26 17:13:59EST wavelet.lisp> ;; Time-stamp: <2008-12-26 18:48:14EST wavelet.lisp>
;; $Id$ ;; $Id$
(in-package :gsl) (in-package :gsl)
;;; Examples do not agree with C results. ;;; /usr/include/gsl/gsl_wavelet.h
;;; Examples do not agree with C results.
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Allocation of wavelets ;;;; Allocation of wavelets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment