Commit add07a4f authored by Liam Healy's avatar Liam Healy

Eliminate 'marray; replace make-marray with grid:make-foreign-array

parent eebc5a48
;; 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: <2010-01-17 10:41:03EST basis-splines.lisp> ;; Time-stamp: <2010-06-29 22:15:23EDT basis-splines.lisp>
;; ;;
;; Copyright 2008, 2009 Liam M. Healy ;; Copyright 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
(defmfun evaluate (defmfun evaluate
((workspace basis-spline) x ((workspace basis-spline) x
&key (B (make-marray 'double-float &key (B (grid:make-foreign-array 'double-float
:dimensions (number-of-coefficients workspace)))) :dimensions (number-of-coefficients workspace))))
"gsl_bspline_eval" "gsl_bspline_eval"
((x :double) ((mpointer B) :pointer) ((mpointer workspace) :pointer)) ((x :double) ((mpointer B) :pointer) ((mpointer workspace) :pointer))
...@@ -112,13 +112,13 @@ ...@@ -112,13 +112,13 @@
(bw (make-basis-spline order nbreak)) (bw (make-basis-spline order nbreak))
(mw (make-fit-workspace ndata ncoeffs)) (mw (make-fit-workspace ndata ncoeffs))
(rng (make-random-number-generator +mt19937+ 0)) (rng (make-random-number-generator +mt19937+ 0))
(B (make-marray 'double-float :dimensions ncoeffs)) (B (grid:make-foreign-array 'double-float :dimensions ncoeffs))
(c (make-marray 'double-float :dimensions ncoeffs)) (c (grid:make-foreign-array 'double-float :dimensions ncoeffs))
(cov (make-marray 'double-float :dimensions (list ncoeffs ncoeffs))) (cov (grid:make-foreign-array 'double-float :dimensions (list ncoeffs ncoeffs)))
(w (make-marray 'double-float :dimensions ndata)) (w (grid:make-foreign-array 'double-float :dimensions ndata))
(x (make-marray 'double-float :dimensions ndata)) (x (grid:make-foreign-array 'double-float :dimensions ndata))
(y (make-marray 'double-float :dimensions ndata)) (y (grid:make-foreign-array 'double-float :dimensions ndata))
(Xmatrix (make-marray 'double-float :dimensions (list ndata ncoeffs))) (Xmatrix (grid:make-foreign-array 'double-float :dimensions (list ndata ncoeffs)))
(sigma 0.1d0)) (sigma 0.1d0))
;; The data to be fitted. ;; The data to be fitted.
(dotimes (i ndata) (dotimes (i ndata)
......
;; Monte Carlo Integration ;; Monte Carlo Integration
;; Liam Healy Sat Feb 3 2007 - 17:42 ;; Liam Healy Sat Feb 3 2007 - 17:42
;; Time-stamp: <2010-06-27 18:13:57EDT monte-carlo.lisp> ;; Time-stamp: <2010-06-29 22:15:24EDT monte-carlo.lisp>
;; ;;
;; Copyright 2007, 2008, 2009 Liam M. Healy ;; Copyright 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
(defparameter *mc-lower* #m(0.0d0 0.0d0 0.0d0)) (defparameter *mc-lower* #m(0.0d0 0.0d0 0.0d0))
(defparameter *mc-upper* (defparameter *mc-upper*
(make-marray 'double-float :initial-contents (list pi pi pi))) (grid:make-foreign-array 'double-float :initial-contents (list pi pi pi)))
(defun random-walk-plain-example (&optional (nsamples 500000)) (defun random-walk-plain-example (&optional (nsamples 500000))
(monte-carlo-integrate-plain 'mcrw *mc-lower* *mc-upper* nsamples)) (monte-carlo-integrate-plain 'mcrw *mc-lower* *mc-upper* nsamples))
......
;; Functions for both vectors and matrices. ;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp ;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <2010-06-27 21:31:00EDT both.lisp> ;; Time-stamp: <2010-06-29 22:12:07EDT both.lisp>
;; ;;
;; Copyright 2008, 2009 Liam M. Healy ;; Copyright 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
(defmfun grid:copy-making-destination (defmfun grid:copy-making-destination
((source both) &aux ((source both) &aux
(destination (destination
(make-marray element-type :dimensions (dimensions source)))) (grid:make-foreign-array element-type :dimensions (dimensions source))))
("gsl_" :category :type "_memcpy") ("gsl_" :category :type "_memcpy")
(((mpointer destination) :pointer) ((mpointer source) :pointer)) (((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :methods :definition :methods
......
;; Copy marrays to/from CL arrays ;; Copy grid:foreign-arrays to/from CL arrays
;; Liam Healy 2009-02-11 19:28:44EST copy-cl.lisp ;; Liam Healy 2009-02-11 19:28:44EST copy-cl.lisp
;; Time-stamp: <2010-06-27 18:03:25EDT copy-cl.lisp> ;; Time-stamp: <2010-06-29 22:51:21EDT copy-cl.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -20,17 +20,17 @@ ...@@ -20,17 +20,17 @@
;;; The function #'copy can be used to copy the contents to or from a ;;; The function #'copy can be used to copy the contents to or from a
;;; CL array. If the destination isn't literally supplied, it can be ;;; CL array. If the destination isn't literally supplied, it can be
;;; a symbol 'array indicating that the marray is to be copied to a CL ;;; a symbol 'array indicating that the grid:foreign-array is to be copied to a CL
;;; array, or an element type like 'double-float, indicating the ;;; array, or an element type like 'double-float, indicating the
;;; contents of the CL array is to be copied to a new marray with the ;;; contents of the CL array is to be copied to a new grid:foreign-array with the
;;; given element type. ;;; given element type.
;;; Contrast this with the function #'cl-array or the initarg ;;; Contrast this with the function #'cl-array or the initarg
;;; :cl-array to #'make-marray. The function returns the cl-array ;;; :cl-array to #'grid:make-foreign-array. The function returns the cl-array
;;; without copying, and so might be faster but also makes the ;;; without copying, and so might be faster but also makes the
;;; original marray object vulnerable if an element is changed, which ;;; original grid:foreign-array object vulnerable if an element is changed, which
;;; officially has unpredictable results. Likewise, the initarg will ;;; officially has unpredictable results. Likewise, the initarg will
;;; use the given CL array directly in the created marray without ;;; use the given CL array directly in the created grid:foreign-array without
;;; copying. ;;; copying.
(in-package :gsl) (in-package :gsl)
...@@ -68,21 +68,21 @@ ...@@ -68,21 +68,21 @@
(setf (maref destination i j) (aref source i j)))) (setf (maref destination i j) (aref source i j))))
destination) destination)
(defmethod grid:copy-to-destination ((source marray) (destclass (eql 'array))) (defmethod grid:copy-to-destination ((source grid:foreign-array) (destclass (eql 'array)))
(let ((destination (let ((destination
(grid:make-ffa (element-type source) :dimensions (dimensions source)))) (grid:make-ffa (element-type source) :dimensions (dimensions source))))
(grid:copy-to-destination source destination))) (grid:copy-to-destination source destination)))
;;; Copy to a named marray element-type, where the type is a symbol ;;; Copy to a named grid:foreign-array element-type, where the type is a symbol
(defmethod grid:copy-to-destination ((source array) (destclass symbol)) (defmethod grid:copy-to-destination ((source array) (destclass symbol))
(let ((destination (let ((destination
(make-marray destclass :dimensions (array-dimensions source)))) (grid:make-foreign-array destclass :dimensions (array-dimensions source))))
(grid:copy-to-destination source destination))) (grid:copy-to-destination source destination)))
;;; Copy to a named marray element-type, where the type is a list ;;; Copy to a named grid:foreign-array element-type, where the type is a list
(defmethod grid:copy-to-destination ((source array) (destclass list)) (defmethod grid:copy-to-destination ((source array) (destclass list))
(let ((destination (let ((destination
(make-marray destclass :dimensions (array-dimensions source)))) (grid:make-foreign-array destclass :dimensions (array-dimensions source))))
(grid:copy-to-destination source destination))) (grid:copy-to-destination source destination)))
;;; Examples and tests ;;; Examples and tests
......
;; A grid:foreign-array with added metadata for GSL. ;; A grid:foreign-array with added metadata for GSL.
;; Liam Healy 2008-04-06 21:23:41EDT ;; Liam Healy 2008-04-06 21:23:41EDT
;; Time-stamp: <2010-06-29 21:41:40EDT foreign-array.lisp> ;; Time-stamp: <2010-06-29 22:08:52EDT foreign-array.lisp>
;; ;;
;; Copyright 2008, 2009, 2010 Liam M. Healy ;; Copyright 2008, 2009, 2010 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -69,36 +69,6 @@ ...@@ -69,36 +69,6 @@
(metadata-slot object 'mpointer) (metadata-slot object 'mpointer)
(make-gsl-metadata object))) (make-gsl-metadata object)))
;;;;****************************************************************************
;;;; Make data from either the dimensions provided or from the initial values
;;;;****************************************************************************
;;;;;;; There are >1400 calls to make-marray, write an emulation?
;;; This should probably be moved/renamed grid:make-foreign-array.
(export 'make-marray)
(defun make-marray (element-type &rest keys &key dimensions &allow-other-keys)
"Make a GSLL array with the given element type,
:dimensions, and :initial-contents, :initial-element or :data."
(when (subtypep element-type 'grid:foreign-array)
(error "Can't take a class name here anymore, sorry."))
(apply
'grid:make-grid
`((grid:foreign-array ,@(alexandria:ensure-list dimensions)) ,element-type)
keys))
(defun make-marray-or-default
(default dimensions
&optional dont-make-if-nil (element-type 'double-float) initial-element)
"If default is T or dont-make-if-nil, make a marray and
returned with the dimensions and element-type. If default is a
marray, it is returned."
(if (member default (list t dont-make-if-nil))
(if initial-element
(make-marray
element-type :dimensions dimensions :initial-element initial-element)
(make-marray element-type :dimensions dimensions))
default))
;;;;**************************************************************************** ;;;;****************************************************************************
;;;; Make from GSL mpointers ;;;; Make from GSL mpointers
;;;;**************************************************************************** ;;;;****************************************************************************
......
;; Matrices ;; Matrices
;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp ;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp
;; Time-stamp: <2010-06-28 11:03:21EDT matrix.lisp> ;; Time-stamp: <2010-06-29 22:10:48EDT matrix.lisp>
;; ;;
;; Copyright 2008, 2009 Liam M. Healy ;; Copyright 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
(defmfun row (defmfun row
((matrix matrix) i ((matrix matrix) i
&optional (vector (make-marray element-type :dimensions (dim1 matrix)))) &optional (vector (grid:make-foreign-array element-type :dimensions (dim1 matrix))))
("gsl_matrix" :type "_get_row") ("gsl_matrix" :type "_get_row")
(((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet)) (((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet))
:definition :generic :definition :generic
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
(defmfun column (defmfun column
((matrix matrix) i ((matrix matrix) i
&optional (vector (make-marray element-type :dimensions (dim0 matrix)))) &optional (vector (grid:make-foreign-array element-type :dimensions (dim0 matrix))))
("gsl_matrix" :type "_get_col") ("gsl_matrix" :type "_get_col")
(((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet)) (((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet))
:definition :generic :definition :generic
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
((source matrix) ((source matrix)
&optional &optional
(destination (destination
(make-marray element-type :dimensions (reverse (dimensions source))))) (grid:make-foreign-array element-type :dimensions (reverse (dimensions source)))))
("gsl_matrix" :type "_transpose_memcpy") ("gsl_matrix" :type "_transpose_memcpy")
(((mpointer destination) :pointer) ((mpointer source) :pointer)) (((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :generic :definition :generic
......
...@@ -290,12 +290,12 @@ area of memory.</p> ...@@ -290,12 +290,12 @@ area of memory.</p>
<p> <p>
The <a href="http://repo.or.cz/w/gsd.git">GSD</a> suite provides The <a href="http://repo.or.cz/w/gsd.git">GSD</a> suite provides
many functions for construction, transformation, and composition of many functions for construction, transformation, and composition of
GSL marrays. When using grid functions for this purpose, GSL grid:foreign-arrays. When using grid functions for this purpose,
the <code>grid:specification</code> will the <code>grid:specification</code> will
contain <code>gsl:marray</code> as the type; for example, contain <code>grid:foreign-array</code> as the type; for example,
</p> </p>
<pre> <pre>
(grid:make-grid '((gsl:marray 3 3) double-float) :initial-element 0) (grid:make-grid '((grid:foreign-array 3 3) double-float) :initial-element 0)
</pre> </pre>
<p> <p>
will make a 3x3 <code>matrix-double-float</code>. will make a 3x3 <code>matrix-double-float</code>.
...@@ -304,7 +304,7 @@ area of memory.</p> ...@@ -304,7 +304,7 @@ area of memory.</p>
in that collection. in that collection.
</p> </p>
<p> <p>
Common Lisp arrays should be created with <code>make-marray</code> or Common Lisp arrays should be created with <code>grid:make-foreign-array</code> or
<code>#m</code>: <code>#m</code>:
The #m reader macro in the default form creates a vector or matrix of The #m reader macro in the default form creates a vector or matrix of
element type double-float, which is the most common type needed for element type double-float, which is the most common type needed for
...@@ -348,8 +348,8 @@ area of memory.</p> ...@@ -348,8 +348,8 @@ area of memory.</p>
with <code>setf maref</code>. A complete CL array may with <code>setf maref</code>. A complete CL array may
be extracted with the function <code>#'cl-array</code>. be extracted with the function <code>#'cl-array</code>.
</p> </p>
<p>Copying marrays is performed with the function <code>copy</code>. <p>Copying grid:foreign-arrays is performed with the function <code>copy</code>.
This works between marrays, pointers, and CL arrays. It is useful This works between grid:foreign-arrays, pointers, and CL arrays. It is useful
for functions intended to be passed to GSL functions (for for functions intended to be passed to GSL functions (for
e.g. solving, minimizing or fitting) that need to set a GSL vector e.g. solving, minimizing or fitting) that need to set a GSL vector
or matrix, because one can simply copy into the passed-in pointer. or matrix, because one can simply copy into the passed-in pointer.
...@@ -361,7 +361,7 @@ area of memory.</p> ...@@ -361,7 +361,7 @@ area of memory.</p>
<p>If you <p>If you
use <a href="http://common-lisp.net/project/iterate/">iterate</a>, use <a href="http://common-lisp.net/project/iterate/">iterate</a>,
there are extensions defined that make it easier to iterate over there are extensions defined that make it easier to iterate over
marrays. These are: grid:foreign-arrays. These are:
<ul> <ul>
<li><code>matrix-row</code>, <code>matrix-row-index</code></li> <li><code>matrix-row</code>, <code>matrix-row-index</code></li>
<li><code>matrix-column</code>, <code>matrix-column-index</code></li> <li><code>matrix-column</code>, <code>matrix-column-index</code></li>
...@@ -472,7 +472,7 @@ and arrays used internally or for function return. ...@@ -472,7 +472,7 @@ and arrays used internally or for function return.
<!-- Created: Feb 25 2005 --> <!-- Created: Feb 25 2005 -->
<!-- hhmts start --> <!-- hhmts start -->
<small> <small>
Time-stamp: <2010-06-27 18:05:50EDT index.html> Time-stamp: <2010-06-29 22:51:17EDT index.html>
</small> </small>
<!-- hhmts end --> <!-- hhmts end -->
</div> </div>
......
;; Real generalized eigensystems ;; Real generalized eigensystems
;; Liam Healy 2009-02-16 12:55:04EST real-generalized.lisp ;; Liam Healy 2009-02-16 12:55:04EST real-generalized.lisp
;; Time-stamp: <2009-12-27 09:45:35EST generalized.lisp> ;; Time-stamp: <2010-06-29 22:15:24EDT generalized.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
(defmfun eigenvalues-gensymm (defmfun eigenvalues-gensymm
((A matrix) (B matrix) ((A matrix) (B matrix)
&optional &optional
(eigenvalues (make-marray element-type :dimensions (dim0 A))) (eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(ws (eltcase complex (make-eigen-genherm (dim0 A)) (ws (eltcase complex (make-eigen-genherm (dim0 A))
t (make-eigen-gensymm (dim0 A))))) t (make-eigen-gensymm (dim0 A)))))
(double-float "gsl_eigen_gensymm" (double-float "gsl_eigen_gensymm"
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
(defmfun eigenvalues-eigenvectors-gensymm (defmfun eigenvalues-eigenvectors-gensymm
((A matrix) (B matrix) ((A matrix) (B matrix)
&optional &optional
(eigenvalues (make-marray element-type :dimensions (dim0 A))) (eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(eigenvectors (make-marray element-type :dimensions (dimensions A))) (eigenvectors (grid:make-foreign-array element-type :dimensions (dimensions A)))
(ws (eltcase complex (make-eigen-hermv (dim0 A)) (ws (eltcase complex (make-eigen-hermv (dim0 A))
t (make-eigen-symmv (dim0 A))))) t (make-eigen-symmv (dim0 A)))))
(double-float "gsl_eigen_gensymmv" (double-float "gsl_eigen_gensymmv"
......
;; Generalized eigensystems for nonsymmetric real matrices ;; Generalized eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 14:27:20EST nonsymmetric-generalized.lisp ;; Liam Healy 2009-02-16 14:27:20EST nonsymmetric-generalized.lisp
;; Time-stamp: <2009-12-27 09:45:35EST nonsymmetric-generalized.lisp> ;; Time-stamp: <2010-06-29 22:15:24EDT nonsymmetric-generalized.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -54,20 +54,20 @@ ...@@ -54,20 +54,20 @@
(A B (A B
&optional &optional
(alpha (alpha
(make-marray '(complex double-float) :dimensions (dim0 A))) (grid:make-foreign-array '(complex double-float) :dimensions (dim0 A)))
(beta (beta
(make-marray 'double-float :dimensions (dim0 A))) (grid:make-foreign-array 'double-float :dimensions (dim0 A)))
(ws (make-eigen-gen (dim0 A))) (ws (make-eigen-gen (dim0 A)))
compute-shur-form-s compute-shur-form-t shur-vectors compute-shur-form-s compute-shur-form-t shur-vectors
&aux &aux
(balance nil) ; unused by GSL (balance nil) ; unused by GSL
(Q (Q
(if (eql shur-vectors t) (if (eql shur-vectors t)
(make-marray 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (dimensions A))
shur-vectors)) shur-vectors))
(Z (Z
(if (eql shur-vectors t) (if (eql shur-vectors t)
(make-marray 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_gen" "gsl_eigen_gen_QZ") ("gsl_eigen_gen" "gsl_eigen_gen_QZ")
((((mpointer A) :pointer) ((mpointer B) :pointer) ((((mpointer A) :pointer) ((mpointer B) :pointer)
...@@ -114,22 +114,22 @@ ...@@ -114,22 +114,22 @@
(A B (A B
&optional &optional
(alpha (alpha
(make-marray '(complex double-float) :dimensions (dim0 A))) (grid:make-foreign-array '(complex double-float) :dimensions (dim0 A)))
(beta (beta
(make-marray 'double-float :dimensions (dim0 A))) (grid:make-foreign-array 'double-float :dimensions (dim0 A)))
(eigenvectors (eigenvectors
(make-marray 'double-float :dimensions (dimensions A))) (grid:make-foreign-array 'double-float :dimensions (dimensions A)))
(ws (make-eigen-genv (dim0 A))) (ws (make-eigen-genv (dim0 A)))
compute-shur-form-s compute-shur-form-t shur-vectors compute-shur-form-s compute-shur-form-t shur-vectors
&aux &aux
(balance nil) ; unused by GSL (balance nil) ; unused by GSL
(Q (Q
(if (eql shur-vectors t) (if (eql shur-vectors t)
(make-marray 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (dimensions A))
shur-vectors)) shur-vectors))
(Z (Z
(if (eql shur-vectors t) (if (eql shur-vectors t)
(make-marray 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_genv" "gsl_eigen_genv_QZ") ("gsl_eigen_genv" "gsl_eigen_genv_QZ")
((((mpointer A) :pointer) ((mpointer B) :pointer) ((((mpointer A) :pointer) ((mpointer B) :pointer)
......
;; Eigensystems for nonsymmetric real matrices ;; Eigensystems for nonsymmetric real matrices
;; Liam Healy 2009-02-16 12:51:18EST nonsymmetric.lisp ;; Liam Healy 2009-02-16 12:51:18EST nonsymmetric.lisp
;; Time-stamp: <2009-12-27 09:45:34EST nonsymmetric.lisp> ;; Time-stamp: <2010-06-29 22:15:24EDT nonsymmetric.lisp>
;; ;;
;; Copyright 2009 Liam M. Healy ;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -52,13 +52,13 @@ ...@@ -52,13 +52,13 @@
(A (A
&optional &optional
(eigenvalues (eigenvalues
(make-marray '(complex double-float) :dimensions (dim0 A))) (grid:make-foreign-array '(complex double-float) :dimensions (dim0 A)))
(ws (make-eigen-nonsymm (dim0 A))) (ws (make-eigen-nonsymm (dim0 A)))
compute-shur-form balance shur-vectors compute-shur-form balance shur-vectors
&aux &aux
(sv (sv
(if (eql shur-vectors t) (if (eql shur-vectors t)
(make-marray 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_nonsymm" "gsl_eigen_nonsymm_Z") ("gsl_eigen_nonsymm" "gsl_eigen_nonsymm_Z")
((((mpointer A) :pointer) ((((mpointer A) :pointer)
...@@ -117,15 +117,15 @@ ...@@ -117,15 +117,15 @@
(A (A
&optional &optional
(eigenvalues (eigenvalues
(make-marray '(complex double-float) :dimensions (dim0 A))) (grid:make-foreign-array '(complex double-float) :dimensions (dim0 A)))
(eigenvectors (eigenvectors
(make-marray '(complex double-float) :dimensions (dimensions A))) (grid:make-foreign-array '(complex double-float) :dimensions (dimensions A)))
(ws (make-eigen-nonsymmv (dim0 A))) (ws (make-eigen-nonsymmv (dim0 A)))
shur-vectors shur-vectors
&aux &aux
(sv (sv
(if (eql shur-vectors t) (if (eql shur-vectors t)
(make-marray 'double-float :dimensions (dimensions A)) (grid:make-foreign-array 'double-float :dimensions (dimensions A))
shur-vectors))) shur-vectors)))
("gsl_eigen_nonsymmv" "gsl_eigen_nonsymmv_Z") ("gsl_eigen_nonsymmv" "gsl_eigen_nonsymmv_Z")
((((mpointer A) :pointer) ((((mpointer A) :pointer)
......
;; Eigenvectors and eigenvalues ;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52 ;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <2009-12-27 09:43:47EST symmetric-hermitian.lisp> ;; Time-stamp: <2010-06-29 22:15:24EDT symmetric-hermitian.lisp>
;; ;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy ;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License ;; Distributed under the terms of the GNU General Public License
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
(defmfun eigenvalues (defmfun eigenvalues
((A matrix) ((A matrix)
&optional &optional
(eigenvalues (make-marray element-type :dimensions (dim0 A))) (eigenvalues (grid:make-foreign-array element-type :dimensions (dim0 A)))
(ws (eltcase complex (make-eigen-herm (dim0 A)) (ws (eltcase complex (make-eigen-herm (dim0 A))
t (make-eigen-symm (dim0 A))))) t (make-eigen-symm (dim0 A)))))
(double-float "gsl_eigen_symm"