Commit 297c08b2 authored by Liam Healy's avatar Liam Healy

Calling mobjects with #'mpointer, generic function #'name

GSL functions that take GSL objects as arguments must have #'mpointer
called on each argument.  Created a generic function #'name and
changed all the *-name (or name-*) functions that acted on mobjects to
this function.
parent b09dc9d2
;; Chebyshev Approximations
;; Liam Healy Sat Nov 17 2007 - 20:36
;; Time-stamp: <2008-12-26 11:21:25EST chebyshev.lisp>
;; Time-stamp: <2008-12-26 16:43:37EST chebyshev.lisp>
;; $Id$
(in-package :gsl)
......@@ -26,8 +26,8 @@
(defmfun evaluate-chebyshev (chebyshev x &optional order)
("gsl_cheb_eval" "gsl_cheb_eval_n")
(((chebyshev :pointer) (x :double))
((chebyshev :pointer) (order sizet) (x :double)))
((((mpointer chebyshev) :pointer) (x :double))
(((mpointer chebyshev) :pointer) (order sizet) (x :double)))
:c-return :double
:documentation ; FDL
"Evaluate the Chebyshev series at a point x. If order is supplied,
......@@ -35,8 +35,10 @@
(defmfun evaluate-chebyshev-error (chebyshev x &optional order)
("gsl_cheb_eval_err" "gsl_cheb_eval_n_err")
(((chebyshev :pointer) (x :double) (result :double) (abserr :double))
((chebyshev :pointer) (order sizet) (x :double) (result :double) (abserr :double)))
((((mpointer chebyshev) :pointer) (x :double) (result :double)
(abserr :double))
(((mpointer chebyshev) :pointer) (order sizet) (x :double)
(result :double) (abserr :double)))
:documentation ; FDL
"Evaluate the Chebyshev series at a point x, returning result and
an estimate of its absolute error. If order is supplied,
......@@ -48,7 +50,7 @@
(defmfun derivative-chebyshev (derivative chebyshev)
"gsl_cheb_calc_deriv"
((derivative :pointer) (chebyshev :pointer))
((derivative :pointer) ((mpointer chebyshev) :pointer))
:documentation ; FDL
"Compute the derivative of the Chebyshev series, storing
the derivative coefficients in the previously allocated series.
......@@ -56,7 +58,7 @@
(defmfun integral-chebyshev (integral chebyshev)
"gsl_cheb_calc_integ"
((integral :pointer) (chebyshev :pointer))
((integral :pointer) ((mpointer chebyshev) :pointer))
:documentation ; FDL
"Compute the integral of the Chebyshev series, storing
the integral coefficients in the previously allocated series.
......
......@@ -46,9 +46,11 @@ to find that the Lisp function name is <code>#'jacobian-elliptic-functions</code
<code>(examples 'higher-moments)</code>. The result will be a list
of forms, each providing an example of usage in the relevant topic.
If the
<a href="http://www.gnu.org/software/gsl/manual/">GSL documentation</a>
provides an example, there will usually be the same or similar
example provided in GSLL.</li>
<a href="http://www.gnu.org/software/gsl/manual/">GSL
documentation</a> provides an example, there will usually be the same
or similar example provided in GSLL. <i>Note:</i> Some of the
examples intentionally designed to signal an error, because the
examples also serve as a regression (unit) test suite for GSLL.</li>
</ul>
It is advisable to look at the examples first for calculations that
require more complex setup (generally, the later chapters in the GSL
......@@ -205,7 +207,7 @@ gamma-randist, negative-binomial.
<address><a href="mailto:gsll-devel@common-lisp.net">Liam Healy</a></address>
<!-- hhmts start -->
<small>
Time-stamp: <2008-11-30 19:28:51EST documentation.html>
Time-stamp: <2008-12-26 15:10:41EST documentation.html>
</small>
<!-- hhmts end -->
</div>
......
;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <2008-12-26 11:14:06EST eigensystems.lisp>
;; Time-stamp: <2008-12-26 17:03:39EST eigensystems.lisp>
;; $Id$
(in-package :gsl)
......@@ -45,7 +45,7 @@
(double-float "gsl_eigen_symm"
complex-double-float "gsl_eigen_herm")
(((mpointer A) :pointer)
((mpointer eigenvalues) :pointer) (ws :pointer))
((mpointer eigenvalues) :pointer) ((mpointer ws) :pointer))
:definition :generic
:element-types :doubles
:inputs (A)
......@@ -65,7 +65,7 @@
(double-float "gsl_eigen_symmv"
complex-double-float "gsl_eigen_hermv")
(((mpointer A) :pointer) ((mpointer eigenvalues) :pointer)
((mpointer eigenvectors) :pointer) (ws :pointer))
((mpointer eigenvectors) :pointer) ((mpointer ws) :pointer))
:definition :generic
:element-types :doubles
:inputs (A)
......
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2008-12-26 10:54:32EST gsll.asd>
;; Time-stamp: <2008-12-26 17:26:28EST gsll.asd>
;; $Id$
(asdf:defsystem "gsll"
......@@ -166,7 +166,7 @@
:depends-on (init)
:components
((:file "interpolation")
(:file "types")
(:file "types" :depends-on (interpolation))
(:file "lookup")
(:file "evaluation")
(:file "spline-example" :depends-on (types))))
......
;; Discrete Hankel Transforms.
;; Liam Healy, Sat Dec 8 2007 - 16:50
;; Time-stamp: <2008-12-26 11:56:49EST hankel.lisp>
;; Time-stamp: <2008-12-26 16:55:21EST hankel.lisp>
;; $Id$
(in-package :gsl)
......@@ -19,7 +19,7 @@
(defmfun apply-hankel (hankel array-in array-out)
"gsl_dht_apply"
((hankel :pointer) ((c-pointer array-in) :pointer)
(((mpointer hankel) :pointer) ((c-pointer array-in) :pointer)
((c-pointer array-out) :pointer))
:documentation ; FDL
"Apply the transform to the array array-in
......@@ -28,14 +28,14 @@
(defmfun sample-x-hankel (hankel n)
"gsl_dht_x_sample"
((hankel :pointer) (n :int))
(((mpointer hankel) :pointer) (n :int))
:c-return :double
:documentation ; FDL
"The points where the function f(t) is assumed to be sampled.")
(defmfun sample-k-hankel (hankel n)
"gsl_dht_k_sample"
((hankel :pointer) (n :int))
(((mpointer hankel) :pointer) (n :int))
:c-return :double
:documentation ; FDL
"The value of the n-th sample point in k-space, j_{\nu,n+1}/X}.")
;; Definition of GSL objects and ways to use them.
;; Liam Healy, Sun Dec 3 2006 - 10:21
;; Time-stamp: <2008-12-26 13:21:44EST mobject.lisp>
;; Time-stamp: <2008-12-26 17:07:25EST mobject.lisp>
;; $Id$
;;; GSL objects are represented in GSLL as and instance of a 'mobject.
......@@ -123,6 +123,10 @@
(:method :around ((object mobject))
(make-instance (class-of object) :mpointer (call-next-method))))
(export 'name)
(defgeneric name (object)
(:documentation "The name given to the GSL object."))
;;; Pointer type
(defconstant +foreign-pointer-class+ (class-name (class-of (cffi:null-pointer)))
"The class in which foreign pointers fall. This will be assumed to be a
......
;; Index lookup and acceleration
;; Liam Healy, Sun Nov 4 2007 - 18:09
;; Time-stamp: <2008-12-26 11:18:49EST lookup.lisp>
;; Time-stamp: <2008-12-26 16:41:21EST lookup.lisp>
;; $Id$
(in-package :gsl)
......@@ -24,7 +24,7 @@
(defmfun accelerated-interpolation-search (x-array x acceleration)
"gsl_interp_accel_find"
((acceleration :pointer) (x-array :pointer) (x :double))
(((mpointer acceleration) :pointer) (x-array :pointer) (x :double))
:c-return sizet
:documentation ; FDL
"Search the data array x-array of size, using the given acceleration.
......
;; Interpolation types
;; Liam Healy, Sun Nov 4 2007 - 17:41
;; Time-stamp: <2008-02-17 17:47:53EST types.lisp>
;; Time-stamp: <2008-12-26 17:23:12EST types.lisp>
;; $Id$
(in-package :gsl)
......@@ -45,9 +45,10 @@
"Non-rounded Akima spline with periodic boundary conditions. This method
uses the non-rounded corner algorithm of Wodicka.")
(defmfun interpolation-name (interpolation)
(defmfun name ((interpolation interpolation))
"gsl_interp_name"
((interpolation :pointer))
:definition :method
:c-return :string
:documentation ; FDL
"The name of the interpolation type.")
......@@ -61,9 +62,10 @@
interpolation. For example, Akima spline interpolation
requires a minimum of 5 points.")
(defmfun spline-name (interpolation)
(defmfun name ((interpolation spline))
"gsl_spline_name"
((interpolation :pointer))
:definition :method
:c-return :string
:documentation ; FDL
"The name of the interpolation type.")
......
;; BLAS level 1, Vector operations
;; Liam Healy, Wed Apr 26 2006 - 15:23
;; Time-stamp: <2008-12-26 12:22:51EST blas1.lisp>
;; Time-stamp: <2008-12-26 16:30:16EST blas1.lisp>
;; $Id$
(in-package :gsl)
......@@ -162,7 +162,7 @@
(defmfun modified-givens-rotation
((d1 vector) (d2 vector) (b1 vector) b2 (P vector))
("gsl_blas_" :type "rotmg")
(((c-pointer d1) :pointer) ((c-pointer d1) :pointer)
(((c-pointer d1) :pointer) ((c-pointer d2) :pointer)
((c-pointer b1) :pointer) (b2 :element-c-type)
((c-pointer P) :pointer))
:definition :generic
......
;; Monte Carlo Integration
;; Liam Healy Sat Feb 3 2007 - 17:42
;; Time-stamp: <2008-12-26 11:34:16EST monte-carlo.lisp>
;; Time-stamp: <2008-12-26 17:05:48EST monte-carlo.lisp>
;; $Id$
(in-package :gsl)
......@@ -21,6 +21,27 @@
(dim sizet)
(x :pointer))
(defmfun monte-carlo-integrate-plain
(function lower-limits upper-limits calls generator state)
"gsl_monte_plain_integrate"
((function :pointer)
((c-pointer lower-limits) :pointer) ((c-pointer upper-limits) :pointer)
((dim0 lower-limits) sizet) (calls sizet)
((mpointer generator) :pointer)
((mpointer state) :pointer)
(result :double) (abserr :double))
:inputs (lower-limits upper-limits)
:documentation ; FDL
"Uses the plain Monte Carlo algorithm to integrate the
function f over the hypercubic region defined by the
lower and upper limits in the arrays 'lower-limits and
'upper-limits, each a gsl-vector of length dim.
The integration uses a fixed number
of function calls calls, and obtains random sampling points using
the random number generator 'generator. A previously allocated workspace
'state must be supplied. The result of the integration is returned
with an estimated absolute error.")
;;;;****************************************************************************
;;;; MISER
;;;;****************************************************************************
......@@ -81,7 +102,7 @@
((c-pointer lower-limits) :pointer) ((c-pointer upper-limits) :pointer)
((dim0 lower-limits) sizet) (calls sizet)
((generator generator) :pointer)
(state :pointer)
((mpointer state) :pointer)
(result :double) (abserr :double))
:inputs (lower-limits upper-limits)
:documentation ; FDL
......@@ -165,7 +186,7 @@
((c-pointer lower-limits) :pointer) ((c-pointer upper-limits) :pointer)
((dim0 lower-limits) sizet) (calls sizet)
((generator generator) :pointer)
(state :pointer)
((mpointer state) :pointer)
(result :double) (abserr :double))
:inputs (lower-limits upper-limits)
:documentation ; FDL
......@@ -212,9 +233,9 @@
(defun random-walk-plain-example (&optional (nsamples 500000))
(let ((ws (make-monte-carlo-plain 3))
(lower #m(0.0d0 0.0d0 0.0d0))
(upper (make-marray 'double-float :initial-contents (list pi pi pi)))
(rng (make-random-number-generator *mt19937* 0)))
(lower #m(0.0d0 0.0d0 0.0d0))
(upper (make-marray 'double-float :initial-contents (list pi pi pi)))
(rng (make-random-number-generator *mt19937* 0)))
(monte-carlo-integrate-plain monte-carlo-g lower upper nsamples rng ws)))
(defun random-walk-miser-example (&optional (nsamples 500000))
......@@ -226,9 +247,9 @@
(defun random-walk-vegas-example (&optional (nsamples 500000))
(let ((ws (make-monte-carlo-vegas 3))
(lower #m(0.0d0 0.0d0 0.0d0))
(upper (make-marray 'double-float :initial-contents (list pi pi pi)))
(rng (make-random-number-generator *mt19937* 0)))
(lower #m(0.0d0 0.0d0 0.0d0))
(upper (make-marray 'double-float :initial-contents (list pi pi pi)))
(rng (make-random-number-generator *mt19937* 0)))
(monte-carlo-integrate-vegas monte-carlo-g lower upper nsamples rng ws)))
(save-test monte-carlo
......
;; Numerical integration
;; Liam Healy, Wed Jul 5 2006 - 23:14
;; Time-stamp: <2008-12-26 11:35:14EST numerical-integration.lisp>
;; Time-stamp: <2008-12-26 17:02:30EST numerical-integration.lisp>
;; $Id$
;;; To do: QAWS, QAWO, QAWF, more tests
......@@ -56,7 +56,7 @@
((function :pointer)
(a :double) (b :double)
(absolute-error :double) (relative-error :double)
(limit sizet) (method integrate-method) (workspace :pointer)
(limit sizet) (method integrate-method) ((mpointer workspace) :pointer)
(result :double) (abserr :double))
:documentation ; FDL
"Apply an integration rule adaptively until an estimate
......@@ -87,8 +87,8 @@
"gsl_integration_qags"
((function :pointer)
(a :double) (b :double)
(absolute-error :double) (relative-error :double) (limit sizet) (workspace :pointer)
(result :double) (abserr :double))
(absolute-error :double) (relative-error :double) (limit sizet)
((mpointer workspace) :pointer) (result :double) (abserr :double))
:documentation ; FDL
"Apply the Gauss-Kronrod 21-point integration rule
adaptively until an estimate of the integral of f over
......@@ -112,8 +112,8 @@
"gsl_integration_qagp"
((function :pointer)
((mpointer points) :pointer) ((dim0 points) sizet)
(absolute-error :double) (relative-error :double) (limit sizet) (workspace :pointer)
(result :double) (abserr :double))
(absolute-error :double) (relative-error :double) (limit sizet)
((mpointer workspace) :pointer) (result :double) (abserr :double))
:inputs (points)
:documentation ; FDL
"Apply the adaptive integration algorithm QAGS taking
......@@ -135,8 +135,8 @@
(function limit workspace &optional (absolute-error 1.0d0) (relative-error 1.0d0))
"gsl_integration_qagi"
((function :pointer)
(absolute-error :double) (relative-error :double) (limit sizet) (workspace :pointer)
(result :double) (abserr :double))
(absolute-error :double) (relative-error :double) (limit sizet)
((mpointer workspace) :pointer) (result :double) (abserr :double))
:documentation ; FDL
"Compute the integral of the function f over the
infinite interval (-\infty,+\infty). The integral is mapped onto the
......@@ -152,8 +152,8 @@
(function a limit workspace &optional (absolute-error 1.0d0) (relative-error 1.0d0))
"gsl_integration_qagiu"
((function :pointer) (a :double)
(absolute-error :double) (relative-error :double) (limit sizet) (workspace :pointer)
(result :double) (abserr :double))
(absolute-error :double) (relative-error :double) (limit sizet)
((mpointer workspace) :pointer) (result :double) (abserr :double))
:documentation ; FDL
"Compute the integral of the function f over the
semi-infinite interval (a,+\infty). The integral is mapped onto the
......@@ -165,8 +165,8 @@
(function b limit workspace &optional (absolute-error 1.0d0) (relative-error 1.0d0))
"gsl_integration_qagil"
((function :pointer) (b :double)
(absolute-error :double) (relative-error :double) (limit sizet) (workspace :pointer)
(result :double) (abserr :double))
(absolute-error :double) (relative-error :double) (limit sizet)
((mpointer workspace) :pointer) (result :double) (abserr :double))
:documentation ; FDL
"Compute the integral of the function f over the
semi-infinite interval (-\infty,b). The integral is mapped onto the
......@@ -184,8 +184,8 @@
"gsl_integration_qawc"
((function :pointer)
(a :double) (b :double) (c :double)
(absolute-error :double) (relative-error :double) (limit sizet) (workspace :pointer)
(result :double) (abserr :double))
(absolute-error :double) (relative-error :double) (limit sizet)
((mpointer workspace) :pointer) (result :double) (abserr :double))
:documentation ; FDL
"Compute the Cauchy principal value of the integral of
f over (a,b), with a singularity at c,
......
;; Polynomials
;; Liam Healy, Tue Mar 21 2006 - 18:33
;; Time-stamp: <2008-12-26 11:10:14EST polynomial.lisp>
;; Time-stamp: <2008-12-26 17:01:15EST polynomial.lisp>
;; $Id$
(in-package :gsl)
......@@ -144,7 +144,7 @@
(defmfun polynomial-solve-ws (coefficients workspace answer-pd)
"gsl_poly_complex_solve"
(((c-pointer coefficients) :pointer) ((dim0 coefficients) sizet)
(workspace :pointer) ((c-pointer answer-pd) :pointer))
((mpointer workspace) :pointer) ((c-pointer answer-pd) :pointer))
:return
((loop for i from 0 below (dim0 answer-pd) by 2
collect (complex (maref answer-pd i)
......
;; Discrete random variables
;; Liam Healy, Sat Nov 11 2006 - 21:51
;; Time-stamp: <2008-12-26 11:50:24EST discrete.lisp>
;; Time-stamp: <2008-12-26 17:00:20EST discrete.lisp>
;; $Id$
(in-package :gsl)
......@@ -18,7 +18,7 @@
(defmfun discrete (generator table)
"gsl_ran_discrete"
(((generator generator) :pointer) (table :pointer))
(((mpointer generator) :pointer) (table :pointer))
:c-return sizet
:documentation ; FDL
"Generate discrete random numbers after running #'discrete-preprocess;
......@@ -26,7 +26,7 @@
(defmfun discrete-pdf (k table)
"gsl_ran_discrete_pdf"
((k sizet) (table :pointer))
((k sizet) ((mpointer table) :pointer))
:c-return :double
:documentation ; FDL
"The probability P[k] of observing the variable k.
......
;; Generators of random numbers.
;; Liam Healy, Sat Jul 15 2006 - 14:43
;; Time-stamp: <2008-12-26 11:36:03EST generators.lisp>
;; Time-stamp: <2008-12-26 17:08:09EST generators.lisp>
;; $Id$
(in-package :gsl)
......@@ -40,7 +40,7 @@
;;;;****************************************************************************
(defmfun get-random-number (generator)
"gsl_rng_get" (((generator generator) :pointer))
"gsl_rng_get" (((mpointer generator) :pointer))
:c-return :ulong
:documentation ; FDL
"Generate a random integer. The
......@@ -50,7 +50,7 @@
functions #'rng-max and #'rng-min.")
(defmfun uniform (generator)
"gsl_rng_uniform" (((generator generator) :pointer))
"gsl_rng_uniform" (((mpointer generator) :pointer))
:c-return :double
:documentation ; FDL
"A double precision floating point number uniformly
......@@ -63,7 +63,7 @@
:ulong.")
(defmfun uniform>0 (generator)
"gsl_rng_uniform_pos" (((generator generator) :pointer))
"gsl_rng_uniform_pos" (((mpointer generator) :pointer))
:c-return :double
:documentation ; FDL
"Return a positive double precision floating point number
......@@ -73,7 +73,8 @@
this function if you need to avoid a singularity at 0.0.")
(defmfun uniform-fixnum (generator upperbound)
"gsl_rng_uniform_int" (((generator generator) :pointer) (upperbound :ulong))
"gsl_rng_uniform_int"
(((mpointer generator) :pointer) (upperbound :ulong))
:c-return :ulong
:documentation ; FDL
"Generate a random integer from 0 to upperbound-1 inclusive.
......@@ -87,24 +88,19 @@
;;;; Information functions about instances
;;;;****************************************************************************
(export 'rng-name)
(defgeneric rng-name (rng-instance)
(:documentation ; FDL
"The name of the random number generator."))
(defmfun rng-name ((rng-instance random-number-generator))
"gsl_rng_name" (((generator rng-instance) :pointer))
(defmfun name ((rng-instance random-number-generator))
"gsl_rng_name" (((mpointer rng-instance) :pointer))
:definition :method
:c-return :string)
(defmfun rng-max (rng-instance)
"gsl_rng_max" (((generator rng-instance) :pointer))
"gsl_rng_max" (((mpointer rng-instance) :pointer))
:c-return :unsigned-long
:documentation "The largest value that #'get-random-number
can return.")
(defmfun rng-min (rng-instance)
"gsl_rng_min" (((generator rng-instance) :pointer))
"gsl_rng_min" (((mpointer rng-instance) :pointer))
:c-return :unsigned-long
:documentation ; FDL
"The smallest value that #'get-random-number
......@@ -118,7 +114,7 @@
"A pointer to the state of generator."))
(defmfun rng-state ((rng-instance random-number-generator))
"gsl_rng_state" (((generator rng-instance) :pointer))
"gsl_rng_state" (((mpointer rng-instance) :pointer))
:c-return :pointer
:definition :method
:index gsl-random-state)
......@@ -129,7 +125,7 @@
"The size of the generator."))
(defmfun rng-size ((rng-instance random-number-generator))
"gsl_rng_size" (((generator rng-instance) :pointer))
"gsl_rng_size" (((mpointer rng-instance) :pointer))
:c-return sizet
:definition :method
:index gsl-random-state)
......@@ -155,7 +151,7 @@
(defmfun copy
((destination random-number-generator) (source random-number-generator))
"gsl_rng_memcpy"
(((generator destination) :pointer) ((generator source) :pointer))
(((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :method
:documentation ; FDL
"Copy the random number generator source into the
......@@ -164,7 +160,7 @@
of source. The two generators must be of the same type.")
(defmfun clone ((instance random-number-generator))
"gsl_rng_clone" (((generator instance) :pointer))
"gsl_rng_clone" (((mpointer instance) :pointer))
:definition :method
:c-return (mptr :pointer)
:return ((make-instance 'random-number-generator :mpointer mptr)))
......
;; Quasi-random sequences in arbitrary dimensions.
;; Liam Healy, Sun Jul 16 2006 - 15:54
;; Time-stamp: <2008-12-26 11:36:28EST quasi.lisp>
;; Time-stamp: <2008-12-26 17:09:22EST quasi.lisp>
;; $Id$
(in-package :gsl)
......@@ -17,7 +17,7 @@
(defmfun qrng-get (generator return-vector)
"gsl_qrng_get"
(((generator generator) :pointer) ((c-pointer return-vector) :pointer))
(((mpointer generator) :pointer) ((c-pointer return-vector) :pointer))
:outputs (return-vector)
:return (return-vector)
:documentation ; FDL
......@@ -26,20 +26,20 @@
dimension of the generator. The point will lie in the range
0 < x_i < 1 for each x_i.")
(defmfun rng-name ((instance quasi-random-number-generator))
"gsl_qrng_name" (((generator instance) :pointer))
(defmfun name ((instance quasi-random-number-generator))
"gsl_qrng_name" (((mpointer instance) :pointer))
:definition :method
:c-return :string)
(defmfun rng-state ((instance quasi-random-number-generator))
"gsl_qrng_state" (((generator instance) :pointer))
"gsl_qrng_state" (((mpointer instance) :pointer))
:c-return :pointer
:definition :method
:export nil
:index gsl-random-state)
(defmfun rng-size ((instance quasi-random-number-generator))
"gsl_qrng_size" (((generator instance) :pointer))
"gsl_qrng_size" (((mpointer instance) :pointer))
:c-return sizet
:definition :method
:export nil
......@@ -49,7 +49,7 @@
((destination quasi-random-number-generator)
(source quasi-random-number-generator))
"gsl_qrng_memcpy"
(((generator destination) :pointer) ((generator source) :pointer))
(((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :method
:documentation ; FDL
"Copy the quasi-random sequence generator src into the
......@@ -57,7 +57,7 @@
of src. The two generators must be of the same type.")
(defmfun clone ((instance quasi-random-number-generator))
"gsl_qrng_clone" (((generator instance) :pointer))
"gsl_qrng_clone" (((mpointer instance) :pointer))
:definition :method
:c-return (mptr :pointer)
:return ((make-instance 'quasi-random-number-generator :mpointer mptr))
......
;; Series acceleration.
;; Liam Healy, Wed Nov 21 2007 - 18:41
;; Time-stamp: <2008-12-26 12:17:53EST series-acceleration.lisp>
;; Time-stamp: <2008-12-26 16:44:29EST series-acceleration.lisp>
;; $Id$
(in-package :gsl)
......@@ -29,7 +29,7 @@
(defmfun accelerate (array levin)
"gsl_sum_levin_u_accel"
(((c-pointer array) :pointer) ((dim0 array) sizet) (levin :pointer)
(((c-pointer array) :pointer) ((dim0 array) sizet) ((mpointer levin) :pointer)
(accelerated-sum :double) (absolute-error :double))
:documentation ; FDL
"From the terms of a series in array, compute the extrapolated
......@@ -55,7 +55,7 @@
(defmfun accelerate-truncated (array levin)
"gsl_sum_levin_utrunc_accel"
(((c-pointer array) :pointer) ((dim0 array) sizet) (levin :pointer)
(((c-pointer array) :pointer) ((dim0 array) sizet) ((mpointer levin) :pointer)
(accelerated-sum :double) (absolute-error :double))
:documentation ; FDL
"From the terms of a series in array, compute the extrapolated
......
;; Linear least squares, or linear regression
;; Liam Healy <2008-01-21 12:41:46EST linear-least-squares.lisp>
;; Time-stamp: <2008-12-26 13:26:43EST linear-least-squares.lisp>
;; Time-stamp: <2008-12-26 16:51:06EST linear-least-squares.lisp>
;; $Id$
(in-package :gsl)
......@@ -141,7 +141,7 @@
(((mpointer model) :pointer) ((mpointer observations) :pointer)
(tolerance :double)
((mpointer parameters) :pointer) (covariance :pointer) (chisq :double)
(workspace :pointer))
((mpointer workspace) :pointer))
:inputs (model observations)
:outputs (parameters covariance)
:documentation ; FDL
......@@ -165,7 +165,7 @@
(tolerance :double)
(rank sizet)
((mpointer parameters) :pointer) (covariance :pointer) (chisq :double)
(workspace :pointer))
((mpointer workspace) :pointer))
:inputs (model observations)
:outputs (parameters covariance)
:return ((dcref chisq) (scref rank))
......@@ -195,7 +195,7 @@
((mpointer observations) :pointer)
((mpointer parameters) :pointer)
((mpointer covariance) :pointer) (chisq :double)
(workspace :pointer))
((mpointer workspace) :pointer))
:inputs (model observations)
:outputs (parameters covariance)
:documentation ; FDL
......@@ -220,7 +220,7 @@
(tolerance :double)
(rank sizet)
((mpointer parameters) :pointer) (covariance :pointer) (chisq :double)
(workspace :pointer))
((mpointer workspace) :pointer))
:inputs (model weight observations)
:outputs (parameters covariance)
:return ((dcref chisq) (scref rank))
......
;; Multivariate minimization.
;; Liam Healy <Tue Jan 8 2008 - 21:28>
;; Time-stamp: <2008-12-26 12:57:02EST minimization-multi.lisp>
;; Time-stamp: <2008-12-26 17:21:08EST minimization-multi.lisp>
;; $Id$
(in-package :gsl)
......@@ -81,16 +81,18 @@
((function-derivative :pointer) ((mpointer initial) :pointer)
(step-size :double) (tolerance :double)))
(defmfun mfminimizer-name (minimizer)
(defmfun name ((minimizer multi-dimensional-minimizer-f))
"gsl_multimin_fminimizer_name"
((minimizer :pointer))
(((mpointer minimizer) :pointer))
:definition :method
:c-return :string
:documentation ; FDL
"The name of the minimizer.")
(defmfun mfdfminimizer-name (minimizer)
(defmfun name ((minimizer multi-dimensional-minimizer-fdf))
"gsl_multimin_fdfminimizer_name"
((minimizer :pointer))
(((mpointer minimizer) :pointer))
:definition :method
:c-return :string
:documentation ; FDL
"The name of the minimizer.")
......@@ -101,7 +103,7 @@
(defmfun iterate-mfminimizer (minimizer)
"gsl_multimin_fminimizer_iterate"
((minimizer :pointer))
(((mpointer minimizer) :pointer))
:documentation ; FDL
"Perform a single iteration of the minimizer. If the iteration
encounters an unexpected problem then an error code will be
......@@ -109,7 +111,7 @@
(defmfun iterate-mfdfminimizer (minimizer)
"gsl_multimin_fdfminimizer_iterate"
((minimizer :pointer))
(((mpointer minimizer) :pointer))
:documentation ; FDL
"Perform a single iteration of the minimizer. If the iteration
encounters an unexpected problem then an error code will be
......@@ -117,7 +119,7 @@
(defmfun mfminimizer-x (minimizer)
"gsl_multimin_fminimizer_x"
((minimizer :pointer))
(((mpointer minimizer) :pointer))
:c-return :pointer
:return (:c-return)
:documentation ; FDL
......@@ -125,7 +127,7 @@
(defmfun mfdfminimizer-x (minimizer)
"gsl_multimin_fdfminimizer_x"
((minimizer :pointer))
(((mpointer minimizer) :pointer))
:c-return :pointer
:return (:c-return)
:documentation ; FDL
......@@ -133,28 +135,28 @@
(defmfun mfminimizer-minimum (minimizer)
"gsl_multimin_fminimizer_minimum"
((minimizer :pointer))
(((mpointer minimizer) :pointer))
:c-return :double
:documentation ; FDL
"The current best estimate of the value of the minimum.")