Commit 259c1457 authored by lhealy's avatar lhealy Committed by Liam Healy
Browse files

The classes/types in the different contexts are now gathered together

in one place, in *type-names* for the types and in *data-class-name*
for data classes, populated by #'add-data-class.  Both defdata and
defmfun-all use the table and so mapping between various names is
consistent.  The data class names are now different, *-double-float
and *-single-float replaces *-double and *-single.  The regression
tests give the same results as before.


git-svn-id: svn+ssh://common-lisp.net/project/gsll/svn/trunk@34 af03a46b-e846-0410-96e5-d5653c316fd0
parent c03a48f8
;; Basis splines.
;; Liam Healy 2008-02-18 14:43:20EST basis-splines.lisp
;; Time-stamp: <2008-02-23 19:36:35EST basis-splines.lisp>
;; Time-stamp: <2008-03-09 19:30:56EDT basis-splines.lisp>
;; $Id$
(in-package :gsl)
......@@ -74,13 +74,13 @@
(bw (basis-spline order nbreak))
(mw (fit-workspace ndata ncoeffs))
(rng (random-number-generator *mt19937* 0))
(B (vector-double ncoeffs))
(c (vector-double ncoeffs))
(cov (matrix-double ncoeffs ncoeffs))
(w (vector-double ndata))
(x (vector-double ndata))
(y (vector-double ndata))
(Xmatrix (matrix-double ndata ncoeffs))
(B (vector-double-float ncoeffs))
(c (vector-double-float ncoeffs))
(cov (matrix-double-float ncoeffs ncoeffs))
(w (vector-double-float ndata))
(x (vector-double-float ndata))
(y (vector-double-float ndata))
(Xmatrix (matrix-double-float ndata ncoeffs))
(sigma 0.1d0))
;; The data to be fitted.
(dotimes (i ndata)
......
;; Blocks of data
;; Liam Healy, Mon Mar 27 2006 - 12:28
;; Time-stamp: <2008-02-17 09:18:05EST block.lisp>
;; Time-stamp: <2008-03-09 18:54:10EDT block.lisp>
;; $Id$
(in-package :gsl)
......@@ -10,7 +10,12 @@
(size size)
(data :pointer))
(defdata "block" block-double double-float)
(defdata "block_float" block-single single-float)
(defdata "block_complex" block-complex complex)
(defdata "block_int" block-fixnum fixnum)
(add-data-class block double-float block-double-float block "block")
(add-data-class block single-float block-single-float block "block")
(add-data-class block fixnum block-fixnum block "block")
(add-data-class block complex block-complex block "block")
(defdata block double-float)
(defdata block single-float)
(defdata block fixnum)
(defdata block complex)
;; Combinations
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-23 18:49:21EST combination.lisp>
;; Time-stamp: <2008-03-09 22:07:29EDT combination.lisp>
;; $Id$
(in-package :gsl)
......@@ -16,16 +16,17 @@
(data :pointer))
;;; Allocation, freeing, reading and writing
(defdata "combination" combination unsigned-byte gsl-data 2)
(add-data-class combination fixnum combination gsl-data "combination")
(defdata combination fixnum 2 "")
(defmethod gsl-array ((object gsl-combination))
(defmethod gsl-array ((object combination))
(foreign-slot-value (pointer object) 'gsl-combination-c 'data))
;;;;****************************************************************************
;;;; Getting values
;;;;****************************************************************************
(defmfun maref ((combination gsl-combination) &rest indices)
(defmfun maref ((combination combination) &rest indices)
"gsl_combination_get"
(((pointer combination) :pointer) ((first indices) size))
:type :method
......@@ -33,7 +34,7 @@
:documentation ; FDL
"The ith element of the combination.")
(defmethod data ((object gsl-combination) &optional sequence)
(defmethod data ((object combination) &optional sequence)
(let ((seq (or sequence
(make-sequence 'list (combination-size object)))))
(loop for i from 0
......@@ -101,7 +102,7 @@
"A pointer to the array of elements in the combination.")
|#
(defmfun data-valid ((combination gsl-combination))
(defmfun data-valid ((combination combination))
"gsl_combination_valid"
(((pointer combination) :pointer))
:type :method
......
;; Using GSL bulk data (vectors, matrices, etc.) storage.
;; Liam Healy, Sun Mar 26 2006 - 16:32
;; Time-stamp: <2008-02-23 18:57:18EST data.lisp>
;; Time-stamp: <2008-03-10 21:15:40EDT data.lisp>
;; $Id$
(in-package :gsl)
......@@ -36,10 +36,12 @@
(defmethod print-object ((object gsl-data) stream)
(print-data-object object *print-array* stream))
(defparameter *print-data-contents* t)
(defun print-data-object (object contents stream)
"Print the data object to the stream, possibly showing contents."
(print-unreadable-object (object stream :type t :identity t)
(when contents
(when (and contents *print-data-contents*)
(princ (data object) stream))))
(defgeneric gsl-array (object)
......@@ -53,7 +55,7 @@
"The second dimension of the object."
(second (storage-size object)))
(defgeneric cl-base-type (object)
(defgeneric cl-elt-type (object)
(:documentation "The CL type of an element."))
;;; Accessing elements
......@@ -96,13 +98,6 @@
;;; (args (loop for i below dimensions collect (intern (format nil "I~d" i))))
;;; (mapcar (lambda (v) `(,v size)) args)
(defparameter *data-name-alist*
'((FIXNUM . "_int")
(SINGLE . "_float")
(DOUBLE . "")
;;(LONG-DOUBLE . "_long_double")
(COMPLEX . "_complex")))
(defmacro data-go (type matrixp)
"Define the letm function for data types."
(if matrixp ; Matrix (two indices)
......@@ -151,96 +146,108 @@
(lambda (symb) `(unless (numberp ,argsymb) (setf (data ,symb) ,argsymb)))
(lambda () (list argsymb size-or-initial)))))))))
(defmacro defdata
(c-string cl-symbol cl-base-type
&optional (superclass 'gsl-data) (dimensions 1))
(defparameter *data-class-name* nil
"A list classes, each consisting of a list
superclass, CL element type, class, GSL splice name.")
(defmacro add-data-class (category element-type class superclass GSL-string)
`(eval-when (:compile-toplevel :load-toplevel :execute)
(pushnew (list ',category ',element-type ',class ',superclass ',GSL-string)
*data-class-name*
:test #'equal)))
(defun data-type-lookup (category element-type)
(find (list category element-type)
*data-class-name*
:key (lambda (l) (subseq l 0 2))
:test #'equal))
(defun data-class-name (category element-type)
(third (data-type-lookup category element-type)))
(defun data-superclass-name (category element-type)
(fourth (data-type-lookup category element-type)))
(defun data-gsl-string (category element-type)
(fifth (data-type-lookup category element-type)))
(defmacro defdata (category cl-elt-type &optional (dimensions 1) splice-name)
"For the type named in the string,
define the allocator (gsl-*-alloc), zero allocator (gsl-*-calloc),
freeing (gsl-*-free), binary writing (binary-*-write) and
reading (binary-*-read), formatted writing (write-*-formatted)
and reading (read-*-formatted) functions."
;; Need to remove duplicates from *data-name-alist*
(flet ((gsl-name (function-name)
(format nil "gsl_~a_~a" c-string function-name)))
(format nil "gsl_~a~a_~a"
(data-gsl-string category cl-elt-type)
(or splice-name
(lookup-splice-name cl-elt-type)) function-name)))
(let* ((cargs (loop for i below dimensions
collect `((nth ,i (storage-size object)) size)))
(object-name (make-symbol-from-strings *gsl-prefix* cl-symbol)))
(class-name (data-class-name category cl-elt-type)))
`(progn
(defclass ,object-name (,superclass)
((cl-base-type :initform ',cl-base-type :reader cl-base-type
:allocation :class)))
(data-go ,cl-symbol
,(or (member superclass '(gsl-matrix)) (member object-name '(gsl-combination))))
(defmfun alloc ((object ,object-name))
(defclass ,class-name (,(data-superclass-name category cl-elt-type))
((cl-elt-type :initform ',cl-elt-type :reader cl-elt-type
:allocation :class)))
(data-go ,class-name
,(or (member category '(matrix combination))))
(defmfun alloc ((object ,class-name))
,(gsl-name "alloc") ,cargs
:type :method
:c-return (cr :pointer)
:return ((assign-pointer object cr)))
(defmfun calloc ((object ,object-name))
(defmfun calloc ((object ,class-name))
,(gsl-name "calloc") ,cargs
:type :method
:c-return (cr :pointer)
:return ((assign-pointer object cr)))
(defmfun free ((object ,object-name))
(defmfun free ((object ,class-name))
,(gsl-name "free") (((pointer object) :pointer))
:type :method
:c-return :void)
(defmfun write-binary ((object ,object-name) stream)
(defmfun write-binary ((object ,class-name) stream)
,(gsl-name "fwrite") ((stream :pointer) ((pointer object) :pointer))
:type :method)
(defmfun read-binary ((object ,object-name) stream)
(defmfun read-binary ((object ,class-name) stream)
,(gsl-name "fread") ((stream :pointer) ((pointer object) :pointer))
:type :method)
(defmfun write-formatted ((object ,object-name) stream format)
(defmfun write-formatted ((object ,class-name) stream format)
,(gsl-name "fprintf")
((stream :pointer) ((pointer object) :pointer) (format :string))
:type :method)
(defmfun read-formatted ((object ,object-name) stream format)
(defmfun read-formatted ((object ,class-name) stream format)
,(gsl-name "fscanf")
((stream :pointer) ((pointer object) :pointer) (format :string))
:type :method)))))
(defun splice-name (base-name keyword symbol)
"Make a new C name for a data function from a base name."
(let* ((insert (+ (search keyword base-name) (length keyword))))
(concatenate 'string
(subseq base-name 0 insert)
(rest (assoc symbol *data-name-alist*))
(subseq base-name insert))))
;;; (splice-name "gsl_vector_get" "vector" 'vector-fixnum)
;;; "gsl_vector_int_get"
;;; (make-symbol-from-strings *gsl-prefix* 'vector-fixnum)
;;; GSL-VECTOR-FIXNUM
(defun defmfun-all (types ctypes string general-class args)
(defun defmfun-all (category cl-types args &optional key-string)
"A defmfun for each of the declared data types."
`(progn
,@(loop for type in types
for ctype in ctypes
collect
`(defmfun ,(first args)
;; Set the class name for the arglist
,(mapcar
(lambda (x)
(if (and (listp x) (eq (second x) general-class))
(list (first x)
(make-symbol-from-strings general-class type))
x))
(second args))
;; Create the correct GSL C library function name
,(splice-name (third args) string type)
,(mapcar
(lambda (x)
(if (eq (st-type x) :c-base-type)
(list (st-symbol x) ctype)
x))
(fourth args))
,@(let ((restargs (copy-list (nthcdr 4 args))))
(when (eq (getf restargs :c-return) :c-base-type)
(setf (getf restargs :c-return) ctype))
(setf (getf restargs :type) :method)
restargs)))))
(let ((categories (if (listp category) category (list category))))
`(progn
,@(loop for type in cl-types
for ctype = (lookup-C-type type)
collect
`(defmfun ,(first args)
;; Set the class name for the arglist
,(mapcar
(lambda (x)
(if (and (listp x) (member (second x) categories))
(list (first x)
(data-class-name (second x) type))
x))
(second args))
;; Create the correct GSL C library function name
,(splice-name
(third args)
;; Use key-string to override the lookup of the category.
(or key-string (data-gsl-string (first categories) type))
type)
,(mapcar
(lambda (x)
(if (eq (st-type x) :c-base-type)
(list (st-symbol x) ctype)
x))
(fourth args))
,@(let ((restargs (copy-list (nthcdr 4 args))))
(when (eq (getf restargs :c-return) :c-base-type)
(setf (getf restargs :c-return) ctype))
(setf (getf restargs :type) :method)
restargs))))))
;;;;****************************************************************************
;;;; Making data objects and initializing storage
......@@ -263,10 +270,7 @@
"Make the GSL data object, including the allocation of space.
The user is responsible for calling #'free to free the foreign
memory when done."
(let ((obj
(make-instance
(make-symbol-from-strings *gsl-prefix* type)
:storage-size size)))
(let ((obj (make-instance type :storage-size size)))
(if zero (calloc obj) (alloc obj))
obj))
......@@ -296,7 +300,7 @@
(list (make-list total-size))
((nil vector)
(make-array (list total-size)
:element-type (cl-base-type object)))
:element-type (cl-elt-type object)))
(t sequence))))
(loop for i from 0
below (min (length seq) total-size)
......
;; Matrices
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-23 18:57:17EST matrix.lisp>
;; Time-stamp: <2008-03-10 21:15:53EDT matrix.lisp>
;; $Id$
(in-package :gsl)
;;; Matrices are specified in a letm binding with
;;; (matrix-double size-or-initial &optional zero)
;;; (matrix-single size-or-initial &optional zero)
;;; (matrix-double-float size-or-initial &optional zero)
;;; (matrix-single-float size-or-initial &optional zero)
;;; (matrix-fixnum size-or-initial &optional zero)
;;; (matrix-complex size-or-initial &optional zero)
;;; where size-or-initial is a length-2 list of positive integers
......@@ -28,33 +28,26 @@
(block :pointer)
(owner :int))
(defclass gsl-matrix (gsl-data) ())
(defclass matrix (gsl-data) ())
(add-data-class matrix double-float matrix-double-float matrix "matrix")
(add-data-class matrix single-float matrix-single-float matrix "matrix")
(add-data-class matrix fixnum matrix-fixnum matrix "matrix")
(add-data-class matrix complex matrix-complex matrix "matrix")
;;; Allocation, freeing, reading and writing
(defdata "matrix" matrix-double double-float gsl-matrix 2)
(defdata "matrix_float" matrix-single single-float gsl-matrix 2)
(defdata "matrix_int" matrix-fixnum fixnum gsl-matrix 2)
(defdata "matrix_complex" matrix-complex complex gsl-matrix 2)
(defdata matrix double-float 2)
(defdata matrix single-float 2)
(defdata matrix fixnum 2)
(defdata matrix complex 2)
(defmacro defmfun-mdsfc (&rest args)
"A defmfun for matrices of double, single, fixnum, and complex."
(defmfun-all
'(double single fixnum complex)
'(:double :float :int gsl-complex)
"matrix"
'gsl-matrix
args))
(defmfun-all '(matrix vector) '(double-float single-float fixnum complex) args))
(defmacro defmfun-mdsf (&rest args)
"A defmfun for matrices of double, single, and fixnum."
(defmfun-all
'(double single fixnum)
'(:double :float :int)
"matrix"
'gsl-matrix
args))
(defmfun-all '(matrix vector) '(double-float single-float fixnum) args))
(defmethod gsl-array ((object gsl-matrix))
(defmethod gsl-array ((object matrix))
(foreign-slot-value (pointer object) 'gsl-matrix-c 'data))
(export 'matrix-data)
......@@ -67,7 +60,7 @@
;;;; Getting values
;;;;****************************************************************************
(defmfun-mdsfc maref ((matrix gsl-matrix) &rest indices)
(defmfun-mdsfc maref ((matrix matrix) &rest indices)
"gsl_matrix_get"
(((pointer matrix) :pointer)
((first indices) size)
......@@ -89,14 +82,14 @@
(:documentation
"A pointer to the i,j-th element of a matrix."))
(defmfun-mdsfc gsl-matrix-ptr ((matrix gsl-matrix) i j)
(defmfun-mdsfc gsl-matrix-ptr ((matrix matrix) i j)
"gsl_matrix_ptr" (((pointer matrix) :pointer) (i size) (j size))
:c-return :pointer)
(defmethod data ((object gsl-matrix) &optional array)
(defmethod data ((object matrix) &optional array)
(let ((arr (or array
(make-array (storage-size object)
:element-type (cl-base-type object)))))
:element-type (cl-elt-type object)))))
(loop for i from 0
below (min (array-dimension arr 0) (first (storage-size object)))
do
......@@ -111,7 +104,7 @@
;;;; Setting values
;;;;****************************************************************************
(defmfun-mdsfc (setf maref) (value (matrix gsl-matrix) &rest indices)
(defmfun-mdsfc (setf maref) (value (matrix matrix) &rest indices)
"gsl_matrix_set"
(((pointer matrix) :pointer)
((first indices) size)
......@@ -129,7 +122,7 @@
:documentation ; FDL
"Set an element of the matrix of doubles, using its pointer.")
(defmethod (setf data) (array (object gsl-matrix))
(defmethod (setf data) (array (object matrix))
(loop for i from 0
below
(min (array-dimension array 0) (first (storage-size object)))
......@@ -140,17 +133,17 @@
do
(setf (maref object i j) (aref array i j)))))
(defmfun-mdsfc set-all ((object gsl-matrix) value)
(defmfun-mdsfc set-all ((object matrix) value)
"gsl_matrix_set_all"
(((pointer object) :pointer) (value :c-base-type))
:c-return :void)
(defmfun-mdsfc set-zero ((object gsl-matrix))
(defmfun-mdsfc set-zero ((object matrix))
"gsl_matrix_set_zero"
(((pointer object) :pointer))
:c-return :void)
(defmfun-mdsfc set-identity ((matrix gsl-matrix))
(defmfun-mdsfc set-identity ((matrix matrix))
"gsl_matrix_set_identity" (((pointer matrix) gsl-matrix-c))
:c-return :void
:documentation ; FDL
......@@ -175,7 +168,7 @@
rows and n2 columns. The physical number of columns in memory
is unchanged."))
(defmfun-mdsfc submatrix ((matrix gsl-matrix) k1 k2 n1 n2)
(defmfun-mdsfc submatrix ((matrix matrix) k1 k2 n1 n2)
"gsl_matrix_submatrix"
(((pointer matrix) gsl-matrix-c) (k1 size) (k2 size) (n1 size) (n2 size))
:c-return gsl-matrix-view)
......@@ -187,7 +180,7 @@
matrix has n1 rows and n2 columns. The physical number of
columns in memory is also given by n2."))
(defmfun-mdsfc matrix-array ((matrix gsl-matrix) n1 n2)
(defmfun-mdsfc matrix-array ((matrix matrix) n1 n2)
"gsl_matrix_view_array"
(((pointer matrix) gsl-matrix-c) (n1 size) (n2 size))
:c-return gsl-matrix-view)
......@@ -201,7 +194,7 @@
columns, and the physical number of columns in memory is given by
tda."))
(defmfun-mdsfc matrix-array-tda ((matrix gsl-matrix) n1 n2 tda)
(defmfun-mdsfc matrix-array-tda ((matrix matrix) n1 n2 tda)
"gsl_matrix_view_array_with_tda"
(((pointer matrix) gsl-matrix-c) (n1 size) (n2 size) (tda size))
:c-return gsl-matrix-view)
......@@ -210,11 +203,8 @@
"A defmfun for vectors of double, single, fixnum, and complex,
translating to a GSL function named matrix_*."
(defmfun-all
'(double single fixnum complex)
'(:double :float :int gsl-complex)
"matrix"
'gsl-vector
args))
'vector '(double-float single-float fixnum complex) args
"matrix"))
(export 'matrix-vector)
(defgeneric matrix-vector (vector n1 n2)
......@@ -232,7 +222,7 @@
vector. Of course, the original vector should not be deallocated while
the view is still in use."))
(defmfun-mvdsfc matrix-vector ((v gsl-vector) n1 n2)
(defmfun-mvdsfc matrix-vector ((v vector) n1 n2)
"gsl_matrix_view_vector"
(((pointer v) gsl-vector-c) (n1 size) (n2 size))
:c-return gsl-matrix-view)
......@@ -255,7 +245,7 @@
vector. Of course, the original vector should not be deallocated while
the view is still in use."))
(defmfun-mvdsfc matrix-vector-tda ((v gsl-vector) n1 n2 tda)
(defmfun-mvdsfc matrix-vector-tda ((v vector) n1 n2 tda)
"gsl_matrix_view_vector_with_tda"
(((pointer v) gsl-vector-c) (n1 size) (n2 size) (tda size))
:c-return gsl-matrix-view)
......@@ -269,7 +259,7 @@
(:documentation ; FDL
"A vector view of the ith row of the matrix."))
(defmfun-mdsfc row-view ((matrix gsl-matrix) i)
(defmfun-mdsfc row-view ((matrix matrix) i)
"gsl_matrix_row" (((pointer matrix) gsl-matrix-c) (i size))
:c-return gsl-vector-view
:null-pointer-info (:EFAULT (format nil "index ~d out of range" i)))
......@@ -279,7 +269,7 @@
(:documentation ; FDL
"A vector view of the jth column of the matrix."))
(defmfun-mdsfc column-view ((matrix gsl-matrix) j)
(defmfun-mdsfc column-view ((matrix matrix) j)
"gsl_matrix_column" ((matrix gsl-matrix-c) (j size))
:c-return gsl-matrix-view
:null-pointer-info (:EFAULT (format nil "index ~d out of range" j)))
......@@ -292,7 +282,7 @@
For a rectangular matrix the length of the diagonal is the same as the smaller
dimension of the matrix."))
(defmfun-mdsfc diagonal-view ((matrix gsl-matrix))
(defmfun-mdsfc diagonal-view ((matrix matrix))
"gsl_matrix_diagonal" ((matrix gsl-matrix-c))
:c-return gsl-matrix-view)
......@@ -303,7 +293,7 @@
required to be square. The diagonal of the matrix corresponds to
k = 0."))
(defmfun-mdsfc subdiagonal-view ((matrix gsl-matrix) k)
(defmfun-mdsfc subdiagonal-view ((matrix matrix) k)
"gsl_matrix_subdiagonal" ((matrix gsl-matrix-c) (k size))
:c-return gsl-matrix-view)
......@@ -313,7 +303,7 @@
"A vector view of the kth superdiagonal of the matrix; it is not
required to be square. The diagonal of the matrix corresponds to k = 0."))
(defmfun-mdsfc superdiagonal-view ((matrix gsl-matrix) k)
(defmfun-mdsfc superdiagonal-view ((matrix matrix) k)
"gsl_matrix_superdiagonal"
((matrix gsl-matrix-c) (k size))
:c-return gsl-matrix-view)
......@@ -322,7 +312,7 @@
;;;; Copying
;;;;****************************************************************************
(defmfun-mdsfc copy ((destination gsl-matrix) (source gsl-matrix))
(defmfun-mdsfc copy ((destination matrix) (source matrix))
"gsl_matrix_memcpy"
(((pointer destination) gsl-matrix-c) ((pointer source) gsl-matrix-c))
:invalidate (destination)
......@@ -330,7 +320,7 @@
"Copy the elements of the matrix source into the
matrix destination. The two matrices must have the same size.")
(defmfun-mdsfc swap ((m1 gsl-matrix) (m2 gsl-matrix))
(defmfun-mdsfc swap ((m1 matrix) (m2 matrix))
"gsl_matrix_swap"
(((pointer m1) gsl-matrix-c) ((pointer m2) gsl-matrix-c))
:invalidate (m1 m2)
......@@ -349,7 +339,7 @@
into the vector. The length of the vector must be the
same as the length of the row."))
(defmfun-mdsfc row ((vector gsl-vector) (matrix gsl-matrix) i)
(defmfun-mdsfc row ((vector vector) (matrix matrix) i)
"gsl_matrix_get_row"
(((pointer vector) gsl-vector-c) ((pointer matrix) gsl-matrix-c) (i size))
:invalidate (vector))
......@@ -361,7 +351,7 @@
into the vector. The length of the vector must be the
same as the length of the column."))
(defmfun-mdsfc column ((vector gsl-vector) (matrix gsl-matrix) j)
(defmfun-mdsfc column ((vector vector) (matrix matrix) j)
"gsl_matrix_get_col"
(((pointer vector) gsl-vector-c) ((pointer matrix) gsl-matrix-c) (j size))
:invalidate (vector))
......@@ -373,7 +363,7 @@
ith row of the matrix. The length of the vector must be
the same as the length of the row."))
(defmfun-mdsfc set-row ((matrix gsl-matrix) i (vector gsl-vector))
(defmfun-mdsfc set-row ((matrix matrix) i (vector vector))
"gsl_matrix_set_row"
(((pointer matrix) gsl-matrix-c) (i size) ((pointer vector) gsl-vector-c))
:invalidate (matrix))
......@@ -384,7 +374,7 @@
"Copy the elements of the vector into the jth column of the matrix.
The length of the vector must be the same as the length of the column."))
(defmfun-mdsfc set-column ((matrix gsl-matrix) j (vector gsl-vector))
(defmfun-mdsfc set-column ((matrix matrix) j (vector vector))
"gsl_matrix_set_col"
(((pointer matrix) gsl-matrix-c) (j size) ((pointer vector) gsl-vector-c))
:invalidate (matrix))
......@@ -401,7 +391,7 @@
(:documentation ; FDL
"Exchange the ith and jth rows of the matrix in-place."))
(defmfun-mdsfc swap-rows ((matrix gsl-matrix) i j)
(defmfun-mdsfc swap-rows ((matrix matrix) i j) </