Commit 2747131e authored by Liam Healy's avatar Liam Healy

Generic functions for array addition, multiplication with scalar

Eliminated the functions #'m+c, #'m*c, turning them into methods of
#'m+ and #'m*, with the scalar permitted to appear either first or
second.  New functions #'e*, #'e/ renamed from #'m*, #'m/ to emphasize
it is elementwise multiplication and division, leaving room for a
matrix multiplication function #'m* at some point in the future.
It is now possible to defmfun :definition :methods with 'both as the
specified category.  Test results 64 bit:
SBCL: TOTAL: 1223 assertions passed, 5 failed, 0 execution errors.
CCL: TOTAL: 1228 assertions passed, 0 failed, 0 execution errors.
parent f6c5e260
;; Tests of array functions
;; Liam Healy 2008-10-20 22:41:48EDT array-tests.lisp
;; Time-stamp: <2008-12-31 21:40:17EST array-tests.lisp>
;; Time-stamp: <2009-01-03 22:04:21EST array-tests.lisp>
;; $Id: $
;;; Generate each file with #'write-test-to-file, e.g.
......@@ -95,39 +95,39 @@
(generate-all-array-tests vector-mult :no-complex
(let ((v1 (array-default 3))
(v2 (array-default 3)))
(cl-array (m* v1 v2))))
(v2 (array-default 3)))
(cl-array (e* v1 v2))))
(generate-all-array-tests matrix-mult :no-complex
(let ((m1 (array-default '(3 3)))
(m2 (array-default '(3 3))))
(cl-array (m* m1 m2))))
(m2 (array-default '(3 3))))
(cl-array (e* m1 m2))))
(generate-all-array-tests vector-div :no-complex
(let ((v1 (array-default 3))
(v2 (array-default 3)))
(cl-array (m/ v1 v2))))
(v2 (array-default 3)))
(cl-array (e/ v1 v2))))
(generate-all-array-tests matrix-div :no-complex
(let ((m1 (array-default '(3 3)))
(m2 (array-default '(3 3))))
(cl-array (m/ m1 m2))))
(m2 (array-default '(3 3))))
(cl-array (e/ m1 m2))))
(generate-all-array-tests vector-mult-scalar :no-complex
(let ((v1 (array-default 3)))
(cl-array (m*c v1 1.39d0))))
(cl-array (m* v1 1.39d0))))
(generate-all-array-tests matrix-mult-scalar :no-complex
(let ((m1 (array-default '(3 3))))
(cl-array (m*c m1 1.39d0))))
(cl-array (m* m1 1.39d0))))
(generate-all-array-tests vector-add-scalar :no-complex
(let ((v1 (array-default 3)))
(cl-array (m+c v1 18.19d0))))
(cl-array (m+ v1 18.19d0))))
(generate-all-array-tests matrix-add-scalar :no-complex
(let ((m1 (array-default '(3 3))))
(cl-array (m+c m1 18.19d0))))
(cl-array (m+ m1 18.19d0))))
;;;;****************************************************************************
;;;; Maximum and minimum elements
......
;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <2008-12-28 16:42:22EST both.lisp>
;; Time-stamp: <2009-01-03 22:01:26EST both.lisp>
;; $Id$
(in-package :gsl)
......@@ -105,6 +105,7 @@
;;; Errors in GSL:
;;; 1) complex operations in older versions of GSL
;;; https://savannah.gnu.org/bugs/index.php?22478
;;; Fixed in 1.12, can change the :no-complex spec.
(defmfun m+ ((a both) (b both))
("gsl_" :category :type "_add")
......@@ -118,6 +119,20 @@
"Add the elements of b to the elements of vector a
The two must have the same dimensions.")
(defmfun m+ ((a both) (x float))
("gsl_" :category :type "_add_constant")
(((mpointer a) :pointer) (x :double))
:definition :methods
:element-types :no-complex
:inputs (a)
:outputs (a)
:return (a)
:documentation ; FDL
"Add the scalar double-float x to all the elements of array a.")
(defmethod m+ ((x float) (a marray))
(m+ a x))
(defmfun m- ((a both) (b both))
("gsl_" :category :type "_sub")
(((mpointer a) :pointer) ((mpointer b) :pointer))
......@@ -130,7 +145,7 @@
"Subtract the elements of b from the elements of a.
The two must have the same dimensions.")
(defmfun m* ((a vector) (b vector))
(defmfun e* ((a vector) (b vector))
("gsl_" :category :type "_mul")
(((mpointer a) :pointer) ((mpointer b) :pointer))
:definition :generic
......@@ -142,7 +157,7 @@
"Multiply the elements of a by the elements of b.
The two must have the same dimensions.")
(defmfun m* ((a matrix) (b matrix))
(defmfun e* ((a matrix) (b matrix))
("gsl_" :category :type "_mul_elements")
(((mpointer a) :pointer) ((mpointer b) :pointer))
:definition :methods
......@@ -151,7 +166,7 @@
:outputs (a)
:return (a))
(defmfun m/ ((a vector) (b vector))
(defmfun e/ ((a vector) (b vector))
("gsl_" :category :type "_div")
(((mpointer a) :pointer) ((mpointer b) :pointer))
:definition :generic
......@@ -163,7 +178,7 @@
"Divide the elements of a by the elements of b.
The two must have the same dimensions.")
(defmfun m/ ((a matrix) (b matrix))
(defmfun e/ ((a matrix) (b matrix))
("gsl_" :category :type "_div_elements")
(((mpointer a) :pointer) ((mpointer b) :pointer))
:definition :methods
......@@ -172,7 +187,7 @@
:outputs (a)
:return (a))
(defmfun m*c ((a both) x)
(defmfun m* ((a both) (x float))
("gsl_" :category :type "_scale")
(((mpointer a) :pointer) (x :double))
:definition :generic
......@@ -181,18 +196,10 @@
:outputs (a)
:return (a)
:documentation ; FDL
"Multiply the elements of a by the scalar factor x.")
"Multiply the elements of a by the scalar double-float factor x.")
(defmfun m+c ((a both) x)
("gsl_" :category :type "_add_constant")
(((mpointer a) :pointer) (x :double))
:definition :generic
:element-types :no-complex
:inputs (a)
:outputs (a)
:return (a)
:documentation ; FDL
"Add the scalar double x to all the elements of array a.")
(defmethod m* ((x float) (a marray))
(m* a x))
;;;;****************************************************************************
;;;; Maximum and minimum elements
......
;; Macro for defining GSL functions.
;; Liam Healy 2008-04-16 20:49:50EDT defmfun.lisp
;; Time-stamp: <2009-01-01 18:14:27EST defmfun.lisp>
;; Time-stamp: <2009-01-03 21:48:41EST defmfun.lisp>
;; $Id$
(in-package :gsl)
......@@ -137,8 +137,40 @@
;;;; A defgeneric with methods, or the methods alone, for vectors or matrices
;;;;****************************************************************************
(defun expand-defmfun-arrays
(defn name arglist gsl-name c-arguments categories key-args)
(setf categories
(remove-if-not
(lambda (c) (member c '(both matrix vector)))
categories))
(if (member 'both categories)
(progn
(when (> (length categories) 1)
;; Specify 'both alone
(error "Internal: mixed both and actual category."))
;; Generate forms for matrix and vector
(append
(generate-methods
defn 'vector
name arglist gsl-name
(actual-array-c-type
'vector c-arguments
(optional-args-to-switch-gsl-functions arglist gsl-name))
(copy-list key-args) 'vector)
(generate-methods
defn 'matrix
name arglist gsl-name
(actual-array-c-type
'matrix c-arguments
(optional-args-to-switch-gsl-functions arglist gsl-name))
(copy-list key-args) 'matrix)))
;; Generate forms for one category
(generate-methods
defn (first categories)
name arglist gsl-name c-arguments key-args)))
(defun expand-defmfun-generic (name arglist gsl-name c-arguments key-args)
"Define a generic function and methods."
"Define a generic function and methods for all kinds of arrays."
;; Need to scan the arglist for categories.
;; Can be mixed, unless it says 'both, in which case it can only be both.
(with-defmfun-key-args key-args
......@@ -146,39 +178,14 @@
(arglist-plain-and-categories arglist)
`(defgeneric ,name ,noclass-arglist
(:documentation ,documentation)
,@(if (member 'both categories)
(progn
(when (> (length categories) 1)
;; Specify 'both alone
(error "Internal: mixed both and actual category."))
;; Generate forms for matrix and vector
(append
(generate-methods
:method 'vector
name arglist gsl-name
(actual-array-c-type
'vector c-arguments
(optional-args-to-switch-gsl-functions arglist gsl-name))
(copy-list key-args) 'vector)
(generate-methods
:method 'matrix
name arglist gsl-name
(actual-array-c-type
'matrix c-arguments
(optional-args-to-switch-gsl-functions arglist gsl-name))
(copy-list key-args) 'matrix)))
;; Generate forms for one category
(generate-methods
:method (first categories)
name arglist gsl-name c-arguments key-args))))))
,@(expand-defmfun-arrays
:method name arglist gsl-name c-arguments categories key-args)))))
(defun expand-defmfun-defmethods (name arglist gsl-name c-arguments key-args)
"Define methods."
;; I presume 'both will not occur for pure methods
"Define methods for all kinds of arrays."
(let ((categories (nth-value 1 (arglist-plain-and-categories arglist))))
(generate-methods
'cl:defmethod (first categories)
name arglist gsl-name c-arguments key-args)))
(expand-defmfun-arrays
'cl:defmethod name arglist gsl-name c-arguments categories key-args)))
(defun generate-methods
(defn category name arglist gsl-name c-arguments key-args
......
......@@ -14,7 +14,7 @@
'((-34.5 8.24 3.29)
(-8.93 34.12 -6.15)
(49.27 -13.49 32.5)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-16.31d0 26.43d0 21.48d0)
......@@ -27,7 +27,7 @@
'((-34.5d0 8.24d0 3.29d0)
(-8.93d0 34.12d0 -6.15d0)
(49.27d0 -13.49d0 32.5d0)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-45 -49 89) (-72 70 8) (91 13 -115)))
(MULTIPLE-VALUE-LIST
......@@ -35,7 +35,7 @@
(MAKE-MARRAY '(SIGNED-BYTE 8) :INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((85 62 207) (134 181 158) (179 233 116)))
(MULTIPLE-VALUE-LIST
......@@ -44,7 +44,7 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-45 -49 89) (-72 70 8) (91 13 141)))
(MULTIPLE-VALUE-LIST
......@@ -53,7 +53,7 @@
:INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((85 62 207) (134 181 158) (179 233 116)))
(MULTIPLE-VALUE-LIST
......@@ -62,7 +62,7 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-45 -49 89) (-72 70 8) (91 13 141)))
(MULTIPLE-VALUE-LIST
......@@ -71,7 +71,7 @@
:INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((85 62 207) (134 181 158) (179 233 116)))
(MULTIPLE-VALUE-LIST
......@@ -80,7 +80,7 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-45 -49 89) (-72 70 8) (91 13 141)))
......@@ -90,7 +90,7 @@
:INITIAL-CONTENTS
'((-64 -68 71) (-91 52 -10)
(73 -5 123)))))
(CL-ARRAY (M+C M1 18.19d0)))))
(CL-ARRAY (M+ M1 18.19d0)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((85 62 207) (134 181 158) (179 233 116)))
......@@ -100,5 +100,5 @@
:INITIAL-CONTENTS
'((67 44 189) (116 163 140)
(161 215 98)))))
(CL-ARRAY (M+C M1 18.19d0))))))
(CL-ARRAY (M+ M1 18.19d0))))))
......@@ -19,7 +19,7 @@
'((42.73 -17.24 43.31)
(-16.12 -8.25 21.44)
(-49.08 -39.66 -49.46)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-0.8073952726421718d0 -0.4779582366589328d0
......@@ -39,7 +39,7 @@
'((42.73d0 -17.24d0 43.31d0)
(-16.12d0 -8.25d0 21.44d0)
(-49.08d0 -39.66d0 -49.46d0)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-2 -2 2) (-2 0 1) (-4 0 1)))
(MULTIPLE-VALUE-LIST
......@@ -51,7 +51,7 @@
(MAKE-MARRAY '(SIGNED-BYTE 8) :INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((2 4 9) (4 0 0) (4 1 0)))
(MULTIPLE-VALUE-LIST
......@@ -65,7 +65,7 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-2 -2 2) (-2 0 1) (-4 0 1)))
(MULTIPLE-VALUE-LIST
......@@ -79,7 +79,7 @@
:INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((2 4 9) (4 0 0) (4 1 0)))
(MULTIPLE-VALUE-LIST
......@@ -93,7 +93,7 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-2 -2 2) (-2 0 1) (-4 0 1)))
(MULTIPLE-VALUE-LIST
......@@ -107,7 +107,7 @@
:INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((2 4 9) (4 0 0) (4 1 0)))
(MULTIPLE-VALUE-LIST
......@@ -121,7 +121,7 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((-2 -2 2) (-2 0 1) (-4 0 1)))
......@@ -136,7 +136,7 @@
:INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M/ M1 M2)))))
(CL-ARRAY (E/ M1 M2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((2 4 9) (4 0 0) (4 1 0)))
......@@ -151,5 +151,5 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M/ M1 M2))))))
(CL-ARRAY (E/ M1 M2))))))
......@@ -19,7 +19,7 @@
'((42.73 -17.24 43.31)
(-16.12 -8.25 21.44)
(-49.08 -39.66 -49.46)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-1474.185d0 -142.05759999999998d0 142.4899d0)
......@@ -37,7 +37,7 @@
'((42.73d0 -17.24d0 43.31d0)
(-16.12d0 -8.25d0 21.44d0)
(-49.08d0 -39.66d0 -49.46d0)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((0 -112 82) (-39 44 80) (-71 110 -84)))
(MULTIPLE-VALUE-LIST
......@@ -49,7 +49,7 @@
(MAKE-MARRAY '(SIGNED-BYTE 8) :INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #2A((84 184 7) (176 86 172) (164 139 252)))
(MULTIPLE-VALUE-LIST
......@@ -63,7 +63,7 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-2048 -1904 2130)
......@@ -80,7 +80,7 @@
:INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((1876 440 3591)
......@@ -97,7 +97,7 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((-2048 -1904 2130)
......@@ -114,7 +114,7 @@
:INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#2A((1876 440 3591)
......@@ -131,7 +131,7 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
......@@ -149,7 +149,7 @@
:INITIAL-CONTENTS
'((32 28 30) (37 -73 -8)
(-15 -22 68)))))
(CL-ARRAY (M* M1 M2)))))
(CL-ARRAY (E* M1 M2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
......@@ -167,5 +167,5 @@
:INITIAL-CONTENTS
'((28 10 19) (28 178 217)
(36 109 222)))))
(CL-ARRAY (M* M1 M2))))))
(CL-ARRAY (E* M1 M2))))))
......@@ -9,14 +9,14 @@
(LET ((V1
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(-34.5 8.24 3.29))))
(CL-ARRAY (M+C V1 18.19d0)))))
(CL-ARRAY (M+ V1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(-16.31d0 26.43d0 21.48d0))
(MULTIPLE-VALUE-LIST
(LET ((V1
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(-34.5d0 8.24d0 3.29d0))))
(CL-ARRAY (M+C V1 18.19d0)))))
(CL-ARRAY (M+ V1 18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-45 -49 89))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -27,7 +27,7 @@
'(-64 -68
71))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(85 62 207))
(MULTIPLE-VALUE-LIST
......@@ -39,7 +39,7 @@
'(67 44
189))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-45 -49 89))
(MULTIPLE-VALUE-LIST
......@@ -51,7 +51,7 @@
'(-64 -68
71))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(85 62 207))
(MULTIPLE-VALUE-LIST
......@@ -63,7 +63,7 @@
'(67 44
189))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-45 -49 89))
(MULTIPLE-VALUE-LIST
......@@ -75,7 +75,7 @@
'(-64 -68
71))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(85 62 207))
(MULTIPLE-VALUE-LIST
......@@ -87,7 +87,7 @@
'(67 44
189))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-45 -49 89))
(MULTIPLE-VALUE-LIST
......@@ -99,7 +99,7 @@
'(-64 -68
71))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(85 62 207))
(MULTIPLE-VALUE-LIST
......@@ -111,6 +111,6 @@
'(67 44
189))))
(CL-ARRAY
(M+C V1
(M+ V1
18.19d0))))))
......@@ -12,7 +12,7 @@
(V2
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(-8.93 34.12 -6.15))))
(CL-ARRAY (M/ V1 V2)))))
(CL-ARRAY (E/ V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
#(3.8633818589025757d0 0.2415005861664713d0
......@@ -24,7 +24,7 @@
(V2
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(-8.93d0 34.12d0 -6.15d0))))
(CL-ARRAY (M/ V1 V2)))))
(CL-ARRAY (E/ V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 -1 -7))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -42,7 +42,7 @@
'(-91 52
-10))))
(CL-ARRAY
(M/ V1 V2)))))
(E/ V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 0 1))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -60,7 +60,7 @@
'(116 163
140))))
(CL-ARRAY
(M/ V1 V2)))))
(E/ V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 -1 -7))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -78,7 +78,7 @@
'(-91 52
-10))))
(CL-ARRAY
(M/ V1 V2)))))
(E/ V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 0 1))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -96,7 +96,7 @@
'(116 163
140))))
(CL-ARRAY
(M/ V1 V2)))))
(E/ V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 -1 -7))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -114,7 +114,7 @@
'(-91 52
-10))))
(CL-ARRAY
(M/ V1 V2)))))
(E/ V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 0 1))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -132,7 +132,7 @@
'(116 163
140))))
(CL-ARRAY
(M/ V1 V2)))))
(E/ V1 V2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 -1 -7))
(MULTIPLE-VALUE-LIST
......@@ -151,7 +151,7 @@
'(-91 52
-10))))
(CL-ARRAY
(M/ V1 V2)))))
(E/ V1 V2)))))
#+int64
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(0 0 1))
(MULTIPLE-VALUE-LIST
......@@ -170,5 +170,5 @@
'(116 163
140))))
(CL-ARRAY
(M/ V1 V2))))))
(E/ V1 V2))))))
......@@ -12,7 +12,7 @@
(V2
(MAKE-MARRAY 'SINGLE-FLOAT :INITIAL-CONTENTS
'(-8.93 34.12 -6.15))))
(CL-ARRAY (M* V1 V2)))))
(CL-ARRAY (E* V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(308.085d0 281.1488d0 -20.233500000000003d0))
(MULTIPLE-VALUE-LIST
......@@ -22,7 +22,7 @@
(V2
(MAKE-MARRAY 'DOUBLE-FLOAT :INITIAL-CONTENTS
'(-8.93d0 34.12d0 -6.15d0))))
(CL-ARRAY (M* V1 V2)))))
(CL-ARRAY (E* V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(-64 48 58))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -40,7 +40,7 @@
'(-91 52
-10))))
(CL-ARRAY
(M* V1 V2)))))
(E* V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL (LIST #(92 4 92))
(MULTIPLE-VALUE-LIST
(LET ((V1
......@@ -58,7 +58,7 @@
'(116 163
140))))
(CL-ARRAY
(M* V1 V2)))))
(E* V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(5824 -3536 -710))
(MULTIPLE-VALUE-LIST
......@@ -68,7 +68,7 @@
(V2
(MAKE-MARRAY '(SIGNED-BYTE 16)
:INITIAL-CONTENTS '(-91 52 -10))))
(CL-ARRAY (M* V1 V2)))))
(CL-ARRAY (E* V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(7772 7172 26460))
(MULTIPLE-VALUE-LIST
......@@ -78,7 +78,7 @@
(V2
(MAKE-MARRAY '(UNSIGNED-BYTE 16)
:INITIAL-CONTENTS '(116 163 140))))
(CL-ARRAY (M* V1 V2)))))
(CL-ARRAY (E* V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(5824 -3536 -710))
(MULTIPLE-VALUE-LIST
......@@ -88,7 +88,7 @@
(V2
(MAKE-MARRAY '(SIGNED-BYTE 32)
:INITIAL-CONTENTS '(-91 52 -10))))
(CL-ARRAY (M* V1 V2)))))
(CL-ARRAY (E* V1 V2)))))
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST #(7772 7172 26460))
(MULTIPLE-VALUE-LIST
......@@ -98,7 +98,7 @@
(V2
(MAKE-MARRAY '(UNSIGNED-BYTE 32)
:INITIAL-CONTENTS '(116 163 140))))