Commit 164cc82c authored by Liam Healy's avatar Liam Healy

Optional argument defaults as GSL objects

Optional arguments may be specified easily as functions creating GSL
objects, keying off the element type of the required arguments.  For
example, the arglist
((matrix matrix) i
     &optional (vector :make-marray vector (dim0 matrix)))
means that if vector is not specified, it will make a vector whose 
element type is the same as matrix, and whose length is the number of
rows of matrix.  This is used to proved default arguments for a number
of functions, including the workspace argument for eigenspaces.  Some
arguments that were required before are now optional and therefore
placed after the required arguments.  Renamed to matrix-transpose from
matrix-transpose-copy, and the the in-place transpose renamed to
matrix-transpose* from matrix-transpose.  Tests on 64 bit:
SBCL: TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
CCL: TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
parent d0ba4920
;; Tests of array functions
;; Liam Healy 2008-10-20 22:41:48EDT array-tests.lisp
;; Time-stamp: <2009-01-04 11:15:18EST array-tests.lisp>
;; Time-stamp: <2009-01-05 22:26:34EST array-tests.lisp>
;; $Id: $
;;; Generate each file with #'write-test-to-file, e.g.
......@@ -203,8 +203,8 @@
(generate-all-array-tests row t
(let ((m1 (array-default '(3 3)))
(row (array-default 3 t)))
(cl-array (row row m1 1))))
(row (array-default 3 t)))
(cl-array (row m1 1 row))))
(generate-all-array-tests setf-row t
(let ((m1 (array-default '(3 3)))
......@@ -214,8 +214,8 @@
(generate-all-array-tests column t
(let ((m1 (array-default '(3 3)))
(col (array-default 3 t)))
(cl-array (column col m1 1))))
(col (array-default 3 t)))
(cl-array (column m1 1 col))))
(generate-all-array-tests setf-column t
(let ((m1 (array-default '(3 3)))
......@@ -235,11 +235,11 @@
(let ((m1 (array-default '(3 3))))
(cl-array (swap-row-column m1 0 2))))
(generate-all-array-tests matrix-transpose t
(generate-all-array-tests matrix-transpose* t
(let ((m1 (array-default '(3 3))))
(cl-array (matrix-transpose m1))))
(cl-array (matrix-transpose* m1))))
(generate-all-array-tests matrix-transpose-copy t
(generate-all-array-tests matrix-transpose t
(let ((m1 (array-default '(3 3)))
(m2 (array-default '(3 3) t)))
(cl-array (matrix-transpose-copy m2 m1))))
(m2 (array-default '(3 3) t)))
(cl-array (matrix-transpose m1 m2))))
;; Matrices
;; Liam Healy 2008-04-15 21:57:52EDT matrix.lisp
;; Time-stamp: <2008-12-29 20:33:38EST matrix.lisp>
;; Time-stamp: <2009-01-05 22:44:13EST matrix.lisp>
;; $Id$
(in-package :gsl)
......@@ -56,7 +56,9 @@
;;;; Copying rows and columns
;;;;****************************************************************************
(defmfun row ((vector vector) (matrix matrix) i)
(defmfun row
((matrix matrix) i
&optional (vector :make-marray vector (dim1 matrix)))
("gsl_matrix" :type "_get_row")
(((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet))
:definition :generic
......@@ -79,7 +81,9 @@
"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 column ((vector vector) (matrix matrix) i)
(defmfun column
((matrix matrix) i
&optional (vector :make-marray vector (dim0 matrix)))
("gsl_matrix" :type "_get_col")
(((mpointer vector) :pointer) ((mpointer matrix) :pointer) (i sizet))
:definition :generic
......@@ -138,7 +142,7 @@
matrix in-place. The matrix must be square for this operation to
be possible.")
(defmfun matrix-transpose ((matrix matrix))
(defmfun matrix-transpose* ((matrix matrix))
("gsl_matrix" :type "_transpose")
(((mpointer matrix) :pointer))
:definition :generic
......@@ -150,7 +154,10 @@
of the matrix in-place. The matrix must be square for this
operation to be possible.")
(defmfun matrix-transpose-copy ((destination matrix) (source matrix))
(defmfun matrix-transpose
((source matrix)
&optional
(destination :make-marray matrix (reverse (dimensions source))))
("gsl_matrix" :type "_transpose_memcpy")
(((mpointer destination) :pointer) ((mpointer source) :pointer))
:definition :generic
......
;; Eigenvectors and eigenvalues
;; Liam Healy, Sun May 21 2006 - 19:52
;; Time-stamp: <2009-01-04 21:27:10EST eigensystems.lisp>
;; Time-stamp: <2009-01-05 22:33:35EST eigensystems.lisp>
;; $Id$
(in-package :gsl)
......@@ -46,14 +46,9 @@
(defmfun eigenvalues
((A matrix)
&optional
(eigenvalues
(make-marray
(element-type A)
:dimensions (first (dimensions A))))
(ws
(if (eq (class-of A) 'complex-double-float)
(make-eigen-herm (first (dimensions A)))
(make-eigen-symm (first (dimensions A))))))
(eigenvalues :make-marray vector (dim0 A))
(ws complex (make-eigen-herm (dim0 A))
t (make-eigen-symm (dim0 A))))
(double-float "gsl_eigen_symm"
complex-double-float "gsl_eigen_herm")
(((mpointer A) :pointer)
......@@ -76,18 +71,10 @@
(defmfun eigenvalues-eigenvectors
((A matrix)
&optional
(eigenvalues
(make-marray
(element-type A)
:dimensions (first (dimensions A))))
(eigenvectors
(make-marray
(element-type A)
:dimensions (dimensions A)))
(ws
(if (eq (class-of A) 'complex-double-float)
(make-eigen-hermv (first (dimensions A)))
(make-eigen-symmv (first (dimensions A))))))
(eigenvalues :make-marray vector (dim0 A))
(eigenvectors :make-marray matrix (dimensions A))
(ws complex (make-eigen-hermv (dim0 A))
t (make-eigen-symmv (dim0 A))))
(double-float "gsl_eigen_symmv"
complex-double-float "gsl_eigen_hermv")
(((mpointer A) :pointer) ((mpointer eigenvalues) :pointer)
......@@ -140,14 +127,25 @@
;;;; Example
;;;;****************************************************************************
#|
;; When GSL 1.12 is in place and elt+ is supported for complex, this
;; can be expanded to :double-types, if we can create a hermitian
;; matrix.
(generate-all-array-tests eigensystems5 (double-float)
(let ((m1 (array-default '(5 5))))
(multiple-value-bind (eval evec)
(eigenvalues-eigenvectors (elt+ m1 (matrix-transpose-copy m1)))
(list (cl-array eval) (cl-array evec)))))
|#
(defun eigenvalue-eigenvectors-example ()
(let ((evecs (make-marray 'double-float :dimensions '(3 3)))
(evals (make-marray 'double-float :dimensions 3))
(ws (make-eigen-symmv 3))
(mat #m((20.0d0 -10.0d0 0.0d0)
(-10.0d0 30.0d0 0.0d0)
(0.0d0 0.0d0 40.0d0))))
(eigenvalues-eigenvectors mat evals evecs ws)
(eigenvalues-eigenvectors mat evals evecs)
(values (cl-array evals) (cl-array evecs))))
(save-test eigensystems
......
;; Macro for defining GSL functions.
;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp
;; Time-stamp: <2009-01-03 21:48:41EST defmfun.lisp>
;; Time-stamp: <2009-01-05 20:32:59EST defmfun.lisp>
;; $Id$
(in-package :gsl)
......@@ -284,11 +284,22 @@
replace-both
(second arg))
element-type))))
(if (and (listp arg) (numberp (second arg)))
;; optional arg default numerical value
(list (first arg)
(coerce (second arg) element-type))
arg))))
(cond ((and (listp arg) (numberp (second arg)))
;; Optional arg default numerical value
(list (first arg)
(coerce (second arg) element-type)))
((and (listp arg) (eql (second arg) :make-marray))
;; Optional arg replace class
(list (first arg)
`(make-marray ',element-type
:dimensions ,(fourth arg))))
((and (listp arg) (> (length arg) 4))
;; Optional arg switch default based on element type
(list (first arg)
(loop for (type sexp) on (rest arg) by #'cddr
until (subtypep element-type type)
finally (return sexp))))
(t arg)))))
(defun arglist-plain-and-categories
(arglist &optional (include-llk t))
......
......@@ -12,7 +12,7 @@
(-8.93 34.12 -6.15)
(49.27 -13.49 32.5))))
(COL (MAKE-MARRAY 'SINGLE-FLOAT :DIMENSIONS '3)))
(CL-ARRAY (COLUMN COL M1 1)))))
(CL-ARRAY (COLUMN M1 1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(8.24d0 34.12d0 -13.49d0))
(MULTIPLE-VALUE-LIST
......@@ -22,7 +22,7 @@
(-8.93d0 34.12d0 -6.15d0)
(49.27d0 -13.49d0 32.5d0))))
(COL (MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS '3)))
(CL-ARRAY (COLUMN COL M1 1)))))
(CL-ARRAY (COLUMN M1 1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(#C(3.29 -8.93) #C(-6.15 49.27) #C(32.5 42.73)))
(MULTIPLE-VALUE-LIST
......@@ -38,7 +38,7 @@
(COL
(MAKE-MARRAY '(COMPLEX SINGLE-FLOAT)
:DIMENSIONS '3)))
(CL-ARRAY (COLUMN COL M1 1)))))
(CL-ARRAY (COLUMN M1 1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#(#C(3.29d0 -8.93d0) #C(-6.15d0 49.27d0)
......@@ -56,7 +56,7 @@
(COL
(MAKE-MARRAY '(COMPLEX DOUBLE-FLOAT)
:DIMENSIONS '3)))
(CL-ARRAY (COLUMN COL M1 1)))))
(CL-ARRAY (COLUMN M1 1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-68 52 -5))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -77,8 +77,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1)))))
(COLUMN M1
1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(44 163 215))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -99,8 +99,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1)))))
(COLUMN M1
1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-68 52 -5))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -121,8 +121,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1)))))
(COLUMN M1
1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(44 163 215))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -143,8 +143,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1)))))
(COLUMN M1
1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-68 52 -5))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -165,8 +165,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1)))))
(COLUMN M1
1 COL)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(44 163 215))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -187,8 +187,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1)))))
(COLUMN M1
1 COL)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-68 52 -5))
(MULTIPLE-VALUE-LIST
......@@ -210,8 +210,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1)))))
(COLUMN M1
1 COL)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(44 163 215))
(MULTIPLE-VALUE-LIST
......@@ -233,6 +233,6 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(COLUMN COL M1
1))))))
(COLUMN M1
1 COL))))))
;; Regression test MATRIX-TRANSPOSE-COPY for GSLL, automatically generated
;; Regression test MATRIX-TRANSPOSE for GSLL, automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST MATRIX-TRANSPOSE-COPY
(LISP-UNIT:DEFINE-TEST MATRIX-TRANSPOSE
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-34.5 -8.93 49.27)
......@@ -16,7 +16,7 @@
(49.27 -13.49 32.5))))
(M2
(MAKE-MARRAY 'SINGLE-FLOAT :DIMENSIONS '(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-34.5d0 -8.93d0 49.27d0)
......@@ -30,7 +30,7 @@
(49.27d0 -13.49d0 32.5d0))))
(M2
(MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS '(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((#C(-34.5 8.24) #C(-8.93 34.12) #C(49.27 -13.49))
......@@ -50,7 +50,7 @@
(M2
(MAKE-MARRAY '(COMPLEX SINGLE-FLOAT)
:DIMENSIONS '(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((#C(-34.5d0 8.24d0) #C(-8.93d0 34.12d0)
......@@ -72,7 +72,7 @@
(M2
(MAKE-MARRAY '(COMPLEX DOUBLE-FLOAT)
:DIMENSIONS '(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
(MULTIPLE-VALUE-LIST
......@@ -83,7 +83,7 @@
(M2
(MAKE-MARRAY '(SIGNED-BYTE 8) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
(MULTIPLE-VALUE-LIST
......@@ -95,7 +95,7 @@
(M2
(MAKE-MARRAY '(UNSIGNED-BYTE 8) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
(MULTIPLE-VALUE-LIST
......@@ -107,7 +107,7 @@
(M2
(MAKE-MARRAY '(SIGNED-BYTE 16) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
(MULTIPLE-VALUE-LIST
......@@ -119,7 +119,7 @@
(M2
(MAKE-MARRAY '(UNSIGNED-BYTE 16) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
(MULTIPLE-VALUE-LIST
......@@ -131,7 +131,7 @@
(M2
(MAKE-MARRAY '(SIGNED-BYTE 32) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
(MULTIPLE-VALUE-LIST
......@@ -143,7 +143,7 @@
(M2
(MAKE-MARRAY '(UNSIGNED-BYTE 32) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
......@@ -156,7 +156,7 @@
(M2
(MAKE-MARRAY '(SIGNED-BYTE 64) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
......@@ -169,5 +169,5 @@
(M2
(MAKE-MARRAY '(UNSIGNED-BYTE 64) :DIMENSIONS
'(3 3))))
(CL-ARRAY (MATRIX-TRANSPOSE-COPY M2 M1))))))
(CL-ARRAY (MATRIX-TRANSPOSE M1 M2))))))
......@@ -2,7 +2,7 @@
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST MATRIX-TRANSPOSE
(LISP-UNIT:DEFINE-TEST MATRIX-TRANSPOSE*
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-34.5 -8.93 49.27)
......@@ -14,7 +14,7 @@
'((-34.5 8.24 3.29)
(-8.93 34.12 -6.15)
(49.27 -13.49 32.5)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-34.5d0 -8.93d0 49.27d0)
......@@ -26,7 +26,7 @@
'((-34.5d0 8.24d0 3.29d0)
(-8.93d0 34.12d0 -6.15d0)
(49.27d0 -13.49d0 32.5d0)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((#C(-34.5 8.24) #C(-8.93 34.12) #C(49.27 -13.49))
......@@ -43,7 +43,7 @@
32.5)
(49.27 -13.49 32.5 42.73 -17.24
43.31)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((#C(-34.5d0 8.24d0) #C(-8.93d0 34.12d0)
......@@ -62,7 +62,7 @@
-13.49d0 32.5d0)
(49.27d0 -13.49d0 32.5d0 42.73d0
-17.24d0 43.31d0)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
(MULTIPLE-VALUE-LIST
......@@ -70,7 +70,7 @@
(MAKE-MARRAY '(SIGNED-BYTE 8) :INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
(MULTIPLE-VALUE-LIST
......@@ -79,7 +79,7 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
(MULTIPLE-VALUE-LIST
......@@ -88,7 +88,7 @@
:INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
(MULTIPLE-VALUE-LIST
......@@ -97,7 +97,7 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
(MULTIPLE-VALUE-LIST
......@@ -106,7 +106,7 @@
:INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
(MULTIPLE-VALUE-LIST
......@@ -115,7 +115,7 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-64 -91 73) (-68 52 -5) (71 -10 123)))
......@@ -125,7 +125,7 @@
:INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1)))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((67 116 161) (44 163 215) (189 140 98)))
......@@ -135,5 +135,5 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (MATRIX-TRANSPOSE M1))))))
(CL-ARRAY (MATRIX-TRANSPOSE* M1))))))
......@@ -12,7 +12,7 @@
(-8.93 34.12 -6.15)
(49.27 -13.49 32.5))))
(ROW (MAKE-MARRAY 'SINGLE-FLOAT :DIMENSIONS '3)))
(CL-ARRAY (ROW ROW M1 1)))))
(CL-ARRAY (ROW M1 1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(-8.93d0 34.12d0 -6.15d0))
(MULTIPLE-VALUE-LIST
......@@ -22,7 +22,7 @@
(-8.93d0 34.12d0 -6.15d0)
(49.27d0 -13.49d0 32.5d0))))
(ROW (MAKE-MARRAY 'DOUBLE-FLOAT :DIMENSIONS '3)))
(CL-ARRAY (ROW ROW M1 1)))))
(CL-ARRAY (ROW M1 1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#(#C(-8.93 34.12) #C(-6.15 49.27) #C(-13.49 32.5)))
......@@ -39,7 +39,7 @@
(ROW
(MAKE-MARRAY '(COMPLEX SINGLE-FLOAT)
:DIMENSIONS '3)))
(CL-ARRAY (ROW ROW M1 1)))))
(CL-ARRAY (ROW M1 1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#(#C(-8.93d0 34.12d0) #C(-6.15d0 49.27d0)
......@@ -57,7 +57,7 @@
(ROW
(MAKE-MARRAY '(COMPLEX DOUBLE-FLOAT)
:DIMENSIONS '3)))
(CL-ARRAY (ROW ROW M1 1)))))
(CL-ARRAY (ROW M1 1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-91 52 -10))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -78,8 +78,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1)))))
(ROW M1
1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(116 163 140))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -100,8 +100,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1)))))
(ROW M1
1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-91 52 -10))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -122,8 +122,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1)))))
(ROW M1
1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(116 163 140))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -144,8 +144,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1)))))
(ROW M1
1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-91 52 -10))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -166,8 +166,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1)))))
(ROW M1
1 ROW)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(116 163 140))
(MULTIPLE-VALUE-LIST
(LET ((M1
......@@ -188,8 +188,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1)))))
(ROW M1
1 ROW)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-91 52 -10))
(MULTIPLE-VALUE-LIST
......@@ -211,8 +211,8 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1)))))
(ROW M1
1 ROW)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(116 163 140))
(MULTIPLE-VALUE-LIST
......@@ -234,6 +234,6 @@
:DIMENSIONS
'3)))
(CL-ARRAY
(ROW ROW M1
1))))))
(ROW M1
1 ROW))))))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment