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
;; 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: $
(in-package :gsl)
......@@ -12,36 +12,36 @@
(defgo-s (chebyshev order function lower-limit upper-limit)
allocate-chebyshev free-chebyshev initialize-chebyshev)
(defun-gsl allocate-chebyshev (order)
(defmfun allocate-chebyshev (order)
"gsl_cheb_alloc"
((order :size))
((order size))
:c-return :pointer
:export nil
:index (letm chebyshev)
:documentation
:documentation ; FDL
"Allocate a Chebyshev series of specified order
and return a pointer to it.")
(defun-gsl free-chebyshev (chebyshev)
(defmfun free-chebyshev (chebyshev)
"gsl_cheb_free"
((chebyshev :pointer))
:c-return :void
:export nil
:index (letm chebyshev)
:documentation
:documentation ; FDL
"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"
((chebyshev :pointer) (function :pointer)
(lower-limit :double) (upper-limit :double))
:export nil
:index (letm chebyshev)
:documentation
:documentation ; FDL
"Compute the Chebyshev approximation for the function over the range
(lower-limit, upper-limit) to the previously specified order. The
computation of the Chebyshev approximation is an @math{O(n^2)}
process, and requires @math{n} function evaluations.")
computation of the Chebyshev approximation is an O(n^2)
process, and requires n function evaluations.")
;;;;****************************************************************************
;;;; Chebyshev series evaluation
......@@ -51,45 +51,45 @@
;;; to use the functions that do return error (and ignore it if
;;; desired) in the form of #'evaluate-chebyshev.
(defun-gsl evaluate-chebyshev-noerror (chebyshev x)
(defmfun evaluate-chebyshev-noerror (chebyshev x)
"gsl_cheb_eval"
((chebyshev :pointer) (x :double))
:c-return :double
:index evaluate-chebyshev
:export nil
:documentation
:documentation ; FDL
"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"
((chebyshev :pointer) (order :size) (x :double))
((chebyshev :pointer) (order size) (x :double))
:c-return :double
:index evaluate-chebyshev
:export nil
:documentation
:documentation ; FDL
"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"
((chebyshev :pointer) (x :double) (result :double) (abserr :double))
:index evaluate-chebyshev
:export nil
:documentation
:documentation ; FDL
"Evaluate the Chebyshev series at a point x, returning result and
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"
((chebyshev :pointer) (order :size) (x :double) (result :double) (abserr :double))
((chebyshev :pointer) (order size) (x :double) (result :double) (abserr :double))
:index evaluate-chebyshev
:export nil
:documentation
:documentation ; FDL
"Evaluate the Chebyshev series at a point x to at most the given order,
returning result and an estimate of its absolute error.")
(export 'evaluate-chebyshev)
(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,
returning result and an estimate of its absolute error.")
......@@ -97,18 +97,18 @@
;;;; Derivatives and integrals
;;;;****************************************************************************
(defun-gsl derivative-chebyshev (derivative chebyshev)
(defmfun derivative-chebyshev (derivative chebyshev)
"gsl_cheb_calc_deriv"
((derivative :pointer) (chebyshev :pointer))
:documentation
:documentation ; FDL
"Compute the derivative of the Chebyshev series, storing
the derivative coefficients in the previously allocated series.
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"
((integral :pointer) (chebyshev :pointer))
:documentation
:documentation ; FDL
"Compute the integral of the Chebyshev series, storing
the integral coefficients in the previously allocated series.
The two series must have been allocated with the same order.
......@@ -147,7 +147,16 @@
(evaluate-chebyshev deriv x)
(evaluate-chebyshev integ x))))
(lisp-unit:define-test chebyshev
(lisp-unit:assert-equal
'("0.715920990169d+00" "-0.150199666581d+01" "0.172397194040d+00")
(lisp-unit:fp-sequence (chebyshev-point-example 0.55d0))))
#|
(make-tests chebyshev
(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))))
;********************************************************
; file: block.lisp
; description: Blocks of data
; date: Mon Mar 27 2006 - 12:28
; author: Liam M. Healy
; modified: Wed May 31 2006 - 19:00
;********************************************************
;;; $Id: $
;; Blocks of data
;; Liam Healy, Mon Mar 27 2006 - 12:28
;; Time-stamp: <2008-02-17 09:18:05EST block.lisp>
;; $Id: $
(in-package :gsl)
;;; Block definition
(cffi:defcstruct block
(size :size)
(size size)
(data :pointer))
(defdata "block" block-double double-float)
......
;; Combinations
;; 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: $
(in-package :gsl)
......@@ -11,8 +11,8 @@
;;; GSL-combination definition
(cffi:defcstruct gsl-combination-c
(n :size)
(k :size)
(n size)
(k size)
(data :pointer))
;;; Allocation, freeing, reading and writing
......@@ -25,11 +25,11 @@
;;;; Getting values
;;;;****************************************************************************
(defun-gsl gsl-aref ((combination gsl-combination) &rest indices)
(defmfun gsl-aref ((combination gsl-combination) &rest indices)
"gsl_combination_get"
(((pointer combination) :pointer) ((first indices) :size))
(((pointer combination) :pointer) ((first indices) size))
:type :method
:c-return :size
:c-return size
:documentation ; FDL
"The ith element of the combination.")
......@@ -45,7 +45,7 @@
;;;; Setting values
;;;;****************************************************************************
(defun-gsl init-first (combination)
(defmfun init-first (combination)
"gsl_combination_init_first"
(((pointer combination) gsl-combination-c))
:c-return :void
......@@ -54,7 +54,7 @@
"Initialize the combination c to the lexicographically
first combination, i.e. (0,1,2,...,k-1).")
(defun-gsl init-last (combination)
(defmfun init-last (combination)
"gsl_combination_init_last"
(((pointer combination) gsl-combination-c))
:c-return :void
......@@ -63,7 +63,7 @@
"Initialize the combination c to the lexicographically
last combination, i.e. (n-k,n-k+1,...,n-1).")
(defun-gsl copy (destination source)
(defmfun copy (destination source)
"gsl_combination_memcpy"
(((pointer destination) gsl-combination-c)
((pointer source) gsl-combination-c))
......@@ -77,23 +77,23 @@
;;;; Combination properties
;;;;****************************************************************************
(defun-gsl combination-range (c)
(defmfun combination-range (c)
"gsl_combination_n"
(((pointer c) gsl-combination-c))
:c-return :size
:c-return size
:documentation ; FDL
"The range (n) of the combination c.")
(defun-gsl combination-size (c)
(defmfun combination-size (c)
"gsl_combination_k"
(((pointer c) gsl-combination-c))
:c-return :size
:c-return size
:documentation ; FDL
"The number of elements (k) in the combination c.")
#|
;;; Unnecessary, gsl-array serves this function.
(defun-gsl combination-data (c)
(defmfun combination-data (c)
"gsl_combination_data"
(((pointer c) gsl-combination-c))
:c-return :pointer
......@@ -101,7 +101,7 @@
"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"
(((pointer combination) :pointer))
:type :method
......@@ -115,7 +115,7 @@
;;;; Combination functions
;;;;****************************************************************************
(defun-gsl combination-next (c)
(defmfun combination-next (c)
"gsl_combination_next" (((pointer c) gsl-combination-c))
:c-return :success-failure
:invalidate (c)
......@@ -127,7 +127,7 @@
repeatedly applying this function will iterate through all possible
combinations of a given order.")
(defun-gsl combination-previous (c)
(defmfun combination-previous (c)
"gsl_combination_prev"
(((pointer c) gsl-combination-c))
:c-return :success-failure
......@@ -142,33 +142,64 @@
;;;; Examples and unit test
;;;;****************************************************************************
(lisp-unit:define-test combination
(lisp-unit:assert-eql ; combination-range
4
(letm ((comb (combination 4 2 t)))
(combination-range comb)))
(lisp-unit:assert-eql ; combination-size
2
(letm ((comb (combination 4 2 t)))
(combination-size comb)))
(lisp-unit:assert-equal ; init-first, combination-next
'((0 1) (0 2) (0 3) (1 2) (1 3) (2 3))
(letm ((comb (combination 4 2 t)))
(init-first comb)
(loop collect (data comb)
while (combination-next comb))))
(lisp-unit:assert-equal ; init-last, combination-previous
'((2 3) (1 3) (1 2) (0 3) (0 2) (0 1))
(letm ((comb (combination 4 2 t)))
(init-last comb)
(loop collect (data 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)
(0 1 2) (0 1 3) (0 2 3) (1 2 3) (0 1 2 3))
(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))))))
#|
(make-tests combination
(letm ((comb (combination 4 2 t))) ; combination-range
(combination-range comb))
(letm ((comb (combination 4 2 t))) ; combination-size
(combination-size comb))
(letm ((comb (combination 4 2 t))) ; init-first, combination-next
(init-first comb)
(loop collect (data comb)
while (combination-next comb)))
(letm ((comb (combination 4 2 t))) ; init-last, combination-previous
(init-last comb)
(loop collect (data comb)
while (combination-previous comb)))
(loop for i from 0 to 4 ; combination-next
append
(letm ((comb (combination 4 i t)))
(init-first comb)
(loop collect (data comb)
while (combination-next comb)))))
|#
(LISP-UNIT:DEFINE-TEST COMBINATION
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 4)
(MULTIPLE-VALUE-LIST
(LETM ((COMB (COMBINATION 4 2 T)))
(COMBINATION-RANGE COMB))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(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
;; Time-stamp: <2008-02-10 15:30:20EST data.lisp>
;; Time-stamp: <2008-02-17 09:18:27EST data.lisp>
;; $Id: $
(in-package :gsl)
......@@ -94,7 +94,7 @@
(setf (pointer object) pointer))
;;; (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*
'((FIXNUM . "_int")
......@@ -163,7 +163,7 @@
(flet ((gsl-name (function-name)
(format nil "gsl_~a_~a" c-string function-name)))
(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)))
`(progn
(defclass ,object-name (,superclass)
......@@ -171,31 +171,31 @@
:allocation :class)))
(data-go ,cl-symbol
,(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
:type :method
:c-return (cr :pointer)
:return ((assign-pointer object cr)))
(defun-gsl calloc ((object ,object-name))
(defmfun calloc ((object ,object-name))
,(gsl-name "calloc") ,cargs
:type :method
:c-return (cr :pointer)
:return ((assign-pointer object cr)))
(defun-gsl free ((object ,object-name))
(defmfun free ((object ,object-name))
,(gsl-name "free") (((pointer object) :pointer))
:type :method
: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))
: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))
:type :method)
(defun-gsl write-formatted ((object ,object-name) stream format)
(defmfun write-formatted ((object ,object-name) stream format)
,(gsl-name "fprintf")
((stream :pointer) ((pointer object) :pointer) (format :string))
:type :method)
(defun-gsl read-formatted ((object ,object-name) stream format)
(defmfun read-formatted ((object ,object-name) stream format)
,(gsl-name "fscanf")
((stream :pointer) ((pointer object) :pointer) (format :string))
:type :method)))))
......@@ -213,13 +213,13 @@
;;; (make-symbol-from-strings *gsl-prefix* 'vector-fixnum)
;;; GSL-VECTOR-FIXNUM
(defun defun-gsl-all (types ctypes string general-class args)
"A defun-gsl for each of the declared data types."
(defun defmfun-all (types ctypes string general-class args)
"A defmfun for each of the declared data types."
`(progn
,@(loop for type in types
for ctype in ctypes
collect
`(defun-gsl ,(first args)
`(defmfun ,(first args)
;; Set the class name for the arglist
,(mapcar
(lambda (x)
......
;; Matrices
;; Liam Healy, Sun Mar 26 2006 - 11:51
;; Time-stamp: <2008-02-05 22:38:36EST matrix.lisp>
;; Time-stamp: <2008-02-17 09:45:48EST matrix.lisp>
;; $Id: $
(in-package :gsl)
......@@ -21,9 +21,9 @@
;;; GSL-matrix definition
(cffi:defcstruct gsl-matrix-c
(size1 :size)
(size2 :size)
(tda :size)
(size1 size)
(size2 size)
(tda size)
(data :pointer)
(block :pointer)
(owner :int))
......@@ -36,18 +36,18 @@
(defdata "matrix_int" matrix-fixnum fixnum gsl-matrix 2)
(defdata "matrix_complex" matrix-complex complex gsl-matrix 2)
(defmacro defun-gsl-mdsfc (&rest args)
"A defun-gsl for matrices of double, single, fixnum, and complex."
(defun-gsl-all
(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))
(defmacro defun-gsl-mdsf (&rest args)
"A defun-gsl for matrices of double, single, and fixnum."
(defun-gsl-all
(defmacro defmfun-mdsf (&rest args)
"A defmfun for matrices of double, single, and fixnum."
(defmfun-all
'(double single fixnum)
'(:double :float :int)
"matrix"
......@@ -67,18 +67,18 @@
;;;; Getting values
;;;;****************************************************************************
(defun-gsl-mdsfc gsl-aref ((matrix gsl-matrix) &rest indices)
(defmfun-mdsfc gsl-aref ((matrix gsl-matrix) &rest indices)
"gsl_matrix_get"
(((pointer matrix) :pointer)
((first indices) :size)
((second indices) :size))
((first indices) size)
((second indices) size))
:c-return :c-base-type
:documentation ; FDL
"The (i,j)-th element of the matrix.")
(defun-gsl mref (pointer index0 index1)
(defmfun mref (pointer index0 index1)
"gsl_matrix_get"
((pointer :pointer) (index0 :size) (index1 :size))
((pointer :pointer) (index0 size) (index1 size))
:c-return :double
:index nil
:documentation ; FDL
......@@ -89,8 +89,8 @@
(:documentation
"A pointer to the i,j-th element of a matrix."))
(defun-gsl-mdsfc gsl-matrix-ptr ((matrix gsl-matrix) i j)
"gsl_matrix_ptr" (((pointer matrix) :pointer) (i :size) (j :size))
(defmfun-mdsfc gsl-matrix-ptr ((matrix gsl-matrix) i j)
"gsl_matrix_ptr" (((pointer matrix) :pointer) (i size) (j size))
:c-return :pointer)
(defmethod data ((object gsl-matrix) &optional array)
......@@ -111,19 +111,19 @@
;;;; Setting values
;;;;****************************************************************************
(defun-gsl-mdsfc (setf gsl-aref) (value (matrix gsl-matrix) &rest indices)
(defmfun-mdsfc (setf gsl-aref) (value (matrix gsl-matrix) &rest indices)
"gsl_matrix_set"
(((pointer matrix) :pointer)
((first indices) :size)
((second indices) :size)
((first indices) size)
((second indices) size)
(value :c-base-type))
:c-return :void
:documentation ; FDL
"Set the (i,j)-th element of the matrix.")
(defun-gsl (setf mref) (value pointer index0 index1)
(defmfun (setf mref) (value pointer index0 index1)
"gsl_matrix_set"
((pointer :pointer) (index0 :size) (index1 :size) (value :double))
((pointer :pointer) (index0 size) (index1 size) (value :double))
:c-return :void
:index nil
:documentation ; FDL
......@@ -140,17 +140,17 @@
do
(setf (gsl-aref object i j) (aref array i j)))))
(defun-gsl-mdsfc set-all ((object gsl-matrix) value)
(defmfun-mdsfc set-all ((object gsl-matrix) value)
"gsl_matrix_set_all"
(((pointer object) :pointer) (value :c-base-type))
:c-return :void)
(defun-gsl-mdsfc set-zero ((object gsl-matrix))
(defmfun-mdsfc set-zero ((object gsl-matrix))
"gsl_matrix_set_zero"
(((pointer object) :pointer))
:c-return :void)
(defun-gsl-mdsfc set-identity ((matrix gsl-matrix))
(defmfun-mdsfc set-identity ((matrix gsl-matrix))
"gsl_matrix_set_identity" (((pointer matrix) gsl-matrix-c))
:c-return :void
:documentation ; FDL
......@@ -175,9 +175,9 @@
rows and n2 columns. The physical number of columns in memory
is unchanged."))
(defun-gsl-mdsfc submatrix ((matrix gsl-matrix) k1 k2 n1 n2)
(defmfun-mdsfc submatrix ((matrix gsl-matrix) k1 k2 n1 n2)
"gsl_matrix_submatrix"
(((pointer matrix) gsl-matrix-c) (k1 :size) (k2 :size) (n1 :size) (n2 :size))
(((pointer matrix) gsl-matrix-c) (k1 size) (k2 size) (n1 size) (n2 size))
:c-return gsl-matrix-view)
(export 'matrix-array)
......@@ -187,9 +187,9 @@
matrix has n1 rows and n2 columns. The physical number of
columns in memory is also given by n2."))
(defun-gsl-mdsfc matrix-array ((matrix gsl-matrix) n1 n2)
(defmfun-mdsfc matrix-array ((matrix gsl-matrix) n1 n2)
"gsl_matrix_view_array"
(((pointer matrix) gsl-matrix-c) (n1 :size) (n2 :size))
(((pointer matrix) gsl-matrix-c) (n1 size) (n2 size))
:c-return gsl-matrix-view)
(export 'matrix-array-tda)
......@@ -201,15 +201,15 @@
columns, and the physical number of columns in memory is given by
tda."))
(defun-gsl-mdsfc matrix-array-tda ((matrix gsl-matrix) n1 n2 tda)
(defmfun-mdsfc matrix-array-tda ((matrix gsl-matrix) n1 n2 tda)
"gsl_matrix_view_array_with_tda"
(((pointer matrix) gsl-matrix-c) (n1 :size) (n2 :size) (tda :size))
(((pointer matrix) gsl-matrix-c) (n1 size) (n2 size) (tda size))
:c-return gsl-matrix-view)
(defmacro defun-gsl-mvdsfc (&rest args)
"A defun-gsl for vectors of double, single, fixnum, and complex,
(defmacro defmfun-mvdsfc (&rest args)
"A defmfun for vectors of double, single, fixnum, and complex,
translating to a GSL function named matrix_*."
(defun-gsl-all
(defmfun-all
'(double single fixnum complex)
'(:double :float :int gsl-complex)
"matrix"
......@@ -232,9 +232,9 @@
vector. Of course, the original vector should not be deallocated while
the view is still in use."))
(defun-gsl-mvdsfc matrix-vector ((v gsl-vector) n1 n2)
(defmfun-mvdsfc matrix-vector ((v gsl-vector) n1 n2)
"gsl_matrix_view_vector"
(((pointer v) gsl-vector-c) (n1 :size) (n2 :size))
(((pointer v) gsl-vector-c) (n1 size) (n2 size))
:c-return gsl-matrix-view)
(export 'matrix-vector-tda)
......@@ -255,9 +255,9 @@
vector. Of course, the original vector should not be deallocated while
the view is still in use."))
(defun-gsl-mvdsfc matrix-vector-tda ((v gsl-vector) n1 n2 tda)
(defmfun-mvdsfc matrix-vector-tda ((v gsl-vector) n1 n2 tda)
"gsl_matrix_view_vector_with_tda"
(((pointer v) gsl-vector-c) (n1 :size) (n2 :size) (tda :size))
(((pointer v) gsl-vector-c) (n1 size) (n2 size) (tda size))
:c-return gsl-matrix-view)
;;;;****************************************************************************
......@@ -269,8 +269,8 @@
(:documentation ; FDL
"A vector view of the ith row of the matrix."))
(defun-gsl-mdsfc row-view ((matrix gsl-matrix) i)
"gsl_matrix_row" (((pointer matrix) gsl-matrix-c) (i :size))
(defmfun-mdsfc row-view ((matrix gsl-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,8 +279,8 @@
(:documentation ; FDL
"A vector view of the jth column of the matrix."))
(defun-gsl-mdsfc column-view ((matrix gsl-matrix) j)
"gsl_matrix_column" ((matrix gsl-matrix-c) (j :size))
(defmfun-mdsfc column-view ((matrix gsl-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 +292,7 @@
For a rectangular matrix the length of the diagonal is the same as the smaller
dimension of the matrix."))
(defun-gsl-mdsfc diagonal-view ((matrix gsl-matrix))
(defmfun-mdsfc diagonal-view ((matrix gsl-matrix))
"gsl_matrix_diagonal" ((matrix gsl-matrix-c))
:c-return gsl-matrix-view)
......@@ -303,8 +303,8 @@
required to be square. The diagonal of the matrix corresponds to
k = 0."))
(defun-gsl-mdsfc subdiagonal-view ((matrix gsl-matrix) k)
"gsl_matrix_subdiagonal" ((matrix gsl-matrix-c) (k :size))
(defmfun-mdsfc subdiagonal-view ((matrix gsl-matrix) k)
"gsl_matrix_subdiagonal" ((matrix gsl-matrix-c) (k size))
:c-return gsl-matrix-view)
(export 'superdiagonal-view)
......@@ -313,16 +313,16 @@
"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."))
(defun-gsl-mdsfc superdiagonal-view ((matrix gsl-matrix) k)
(defmfun-mdsfc superdiagonal-view ((matrix gsl-matrix) k)
"gsl_matrix_superdiagonal"