|
From: Akshay S. <ak...@us...> - 2012-03-12 17:28:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "matlisp".
The branch, matlisp-cffi has been updated
via 2cbbcb64c997e7ed95c2e9a344347ca9606fce66 (commit)
via b0f1cb2dd42338c9189c83cbcbcb177eaf1c7845 (commit)
via 98cdecd68f57b4a561ac8f68a0ede4a0374a6a95 (commit)
via 097c9251aaa15f702cc8b9701832dbdc1d9bcb13 (commit)
via b0415f8f7e3a4af5682f22aed1885e20f3484188 (commit)
from 96f2abfd9395d6f25520c3b828c4c69a0f35d8a3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2cbbcb64c997e7ed95c2e9a344347ca9606fce66
Author: Akshay Srinivasan <aks...@gm...>
Date: Mon Mar 12 22:48:55 2012 +0530
-> Support for copy(!) and scal(!) are reasonably complete.
-> Restricted the store type of {real/complex}-matrix to one-dimension.
-> Usual churning in utilities.lisp, made mlet* even more incomprehensible (but nicer!).
diff --git a/packages.lisp b/packages.lisp
index 383af89..566dbd6 100644
--- a/packages.lisp
+++ b/packages.lisp
@@ -298,6 +298,7 @@
"*PRINT-MATRIX*"
"AXPY!"
"AXPY"
+ "BLAS-COPYABLE-P"
"COL-VECTOR-P"
"COMPLEX-COERCE"
"COMPLEX-MATRIX"
@@ -420,6 +421,7 @@
"SWAP!"
"TR"
"TRANSPOSE"
+ "TRANSPOSE!"
"VEC"
"UNLOAD-BLAS-&-LAPACK-LIBRARIES"
"ZEROS"
diff --git a/src/axpy.lisp b/src/axpy.lisp
index c3a6baf..57104cf 100644
--- a/src/axpy.lisp
+++ b/src/axpy.lisp
@@ -150,8 +150,8 @@
(store-y (store y))
(store-result (store result)))
(declare (type fixnum n m nxm)
- (type (real-matrix-store-type (*)) store-y)
- (type (complex-matrix-store-type (*)) store-x store-result))
+ (type (real-matrix-store-type *) store-y)
+ (type (complex-matrix-store-type *) store-x store-result))
(zcopy nxm store-x 1 store-result 1) ;; same as (COPY! x result)
(zdscal nxm alpha store-result 1) ;; same as (SCAL! alpha result)
@@ -192,8 +192,8 @@
(c-alpha (complex-coerce alpha)))
(declare (type complex-double-float c-alpha)
(type fixnum n m nxm)
- (type (real-matrix-store-type (*)) store-x)
- (type (complex-matrix-store-type (*)) store-y store-result))
+ (type (real-matrix-store-type *) store-x)
+ (type (complex-matrix-store-type *) store-y store-result))
(dcopy nxm store-x 1 store-result 2)
(zscal nxm c-alpha store-result 1)
@@ -209,7 +209,7 @@
(c-alpha (complex-coerce alpha)))
(declare (type complex-double-float c-alpha)
(type fixnum nxm)
- (type (complex-matrix-store-type (*)) store-result))
+ (type (complex-matrix-store-type *) store-result))
(zscal nxm c-alpha store-result 1)
(daxpy nxm 1.0d0 (store y) 1 store-result 2)
@@ -283,8 +283,8 @@ don't know how to coerce COMPLEX to REAL"))
(c-alpha (complex-coerce alpha)))
(declare (type complex-double-float c-alpha)
(type fixnum nxm)
- (type (real-matrix-store-type (*)) store-x)
- (type (complex-matrix-store-type (*)) store-y))
+ (type (real-matrix-store-type *) store-x)
+ (type (complex-matrix-store-type *) store-y))
(daxpy nxm (realpart c-alpha) store-x 1 store-y 2)
(with-vector-data-addresses ((addr-y store-y)
diff --git a/src/blas.lisp b/src/blas.lisp
index 999b389..964f7b0 100644
--- a/src/blas.lisp
+++ b/src/blas.lisp
@@ -1,4 +1,4 @@
-t;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: :blas; Base: 10 -*-
+;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: :blas; Base: 10 -*-
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
@@ -204,7 +204,7 @@ t;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: :blas; Base: 10 -*-
"
(n :integer :input)
(da :double-float :input)
- (dx (* :double-float :inc head-dx) :output)
+ (dx (* :double-float :inc head-x) :output)
(incx :integer :input)
)
@@ -363,7 +363,7 @@ t;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: :blas; Base: 10 -*-
"
(n :integer :input)
(da :double-float :input)
- (zx (* :complex-double-float :inc head-zx) :output)
+ (zx (* :complex-double-float :inc head-x) :output)
(incx :integer :input)
)
@@ -405,7 +405,7 @@ t;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: :blas; Base: 10 -*-
"
(n :integer :input)
(za :complex-double-float)
- (zx (* :complex-double-float) :output)
+ (zx (* :complex-double-float :inc head-x) :output)
(incx :integer :input)
)
@@ -530,7 +530,8 @@ t;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: :blas; Base: 10 -*-
considered in the operations are:
Y(0),Y(2*INCY), ... , Y(2*(N-1)*INCY)
-" (n :integer :input)
+"
+ (n :integer :input)
(zx (* :complex-double-float) :input)
(incx :integer :input)
(zy (* :complex-double-float) :input)
@@ -547,6 +548,11 @@ t;;; -*- Mode: lisp; Syntax: ansi-common-lisp; Package: :blas; Base: 10 -*-
(def-fortran-routine dasum :double-float
"
+ Purpose
+ =======
+
+ Takes the sum of the absolute values.
+
"
(n :integer :input)
(dx (* :double-float) :input)
diff --git a/src/compat.lisp b/src/compat.lisp
index 4b0f329..b30383e 100644
--- a/src/compat.lisp
+++ b/src/compat.lisp
@@ -93,11 +93,11 @@
(deftype float-matrix-array-type (size)
"Defines the same type as (REAL-MATRIX-STORE-TYPE (*))"
- `(simple-array double-float ,size))
+ `(simple-array double-float (,size)))
(deftype complex-matrix-array-type (size)
"Defines the same type as (COMPLEX-MATRIX-STORE-TYPE (*))"
- `(simple-array double-float ,size))
+ `(simple-array double-float (,size)))
(deftype float-matrix ()
"Defines the same type as REAL-MATRIX"
diff --git a/src/complex-matrix.lisp b/src/complex-matrix.lisp
index 48e7d0f..64382d7 100644
--- a/src/complex-matrix.lisp
+++ b/src/complex-matrix.lisp
@@ -9,7 +9,7 @@
(deftype complex-matrix-store-type (size)
"The type of the storage structure for a COMPLEX-MATRIX"
- `(simple-array double-float ,size))
+ `(simple-array double-float (,size)))
)
;;
@@ -37,7 +37,7 @@
(defclass complex-matrix (standard-matrix)
((store
:initform nil
- :type (simple-array complex-matrix-element-type (*))))
+ :type (complex-matrix-store-type *)))
(:documentation "A class of matrices with complex elements."))
;;
@@ -55,13 +55,13 @@
;;
(defmethod matrix-ref-1d ((matrix complex-matrix) (idx fixnum))
(let ((store (store matrix)))
- (declare (type (complex-matrix-store-type (*)) store))
+ (declare (type (complex-matrix-store-type *) store))
(complex (aref store (* 2 idx)) (aref store (+ 1 (* 2 idx))))))
(defmethod (setf matrix-ref-1d) ((value number) (matrix complex-matrix) (idx fixnum))
(let ((store (store matrix))
(coerced-value (complex-coerce value)))
- (declare (type (complex-matrix-store-type (*)) store))
+ (declare (type (complex-matrix-store-type *) store))
(setf (aref store (* 2 idx)) (realpart coerced-value)
(aref store (+ 1 (* 2 idx))) (imagpart coerced-value))))
@@ -121,7 +121,7 @@
(size (* n m))
(store (allocate-complex-store size)))
(declare (type fixnum n m size)
- (type (complex-matrix-store-type (*)) store))
+ (type (complex-matrix-store-type *) store))
(multiple-value-bind (row-stride col-stride)
(ecase order
(:row-major (values m 1))
@@ -151,7 +151,7 @@
(size (* n m))
(store (allocate-complex-store size)))
(declare (type fixnum n m size)
- (type (complex-matrix-store-type (*)) store))
+ (type (complex-matrix-store-type *) store))
(multiple-value-bind (row-stride col-stride)
(ecase order
(:row-major (values m 1))
@@ -182,7 +182,7 @@
(let* ((n (length seq))
(store (allocate-complex-store n)))
(declare (type fixnum n)
- (type (complex-matrix-store-type (*)) store))
+ (type (complex-matrix-store-type *) store))
(dotimes (k n)
(declare (type fixnum k))
(let* ((val (complex-coerce (elt seq k)))
diff --git a/src/copy.lisp b/src/copy.lisp
index 586aaf0..68dff10 100644
--- a/src/copy.lisp
+++ b/src/copy.lisp
@@ -79,29 +79,6 @@
(in-package "MATLISP")
;;
-(defun blas-copyable-p (matrix)
- (declare (optimize (safety 0) (speed 3))
- (type (or real-matrix complex-matrix) matrix))
- (mlet* ((nr (nrows matrix) :type fixnum)
- (nc (ncols matrix) :type fixnum)
- (rs (row-stride matrix) :type fixnum)
- (cs (col-stride matrix) :type fixnum)
- (ne (number-of-elements matrix) :type fixnum))
- (cond
- ((= nc 1) (values t rs ne))
- ((= nr 1) (values t cs ne))
- ((= rs (* nc cs)) (values t cs ne))
- ((= cs (* nr rs)) (values t rs ne))
- (t (values nil -1 -1)))))
-
-;;
-(defmacro with-transpose! (matlst &rest body)
- `(progn
- ,@(mapcar #'(lambda (mat) `(transpose! ,mat)) matlst)
- ,@body
- ,@(mapcar #'(lambda (mat) `(transpose! ,mat)) matlst)))
-
-;;
(defmacro generate-typed-copy!-func (func store-type matrix-type blas-func)
`(defun ,func (mat-a mat-b)
(declare (type ,matrix-type mat-a mat-b)
@@ -111,7 +88,7 @@
((hd-a st-a sz) (slot-values mat-a '(head store number-of-elements)) :type (fixnum (,store-type *) fixnum))
((hd-b st-b) (slot-values mat-b '(head store)) :type (fixnum (,store-type *))))
(if (and cp-a cp-b)
- (,blas-func sz (store mat-a) inc-a (store mat-b) inc-b :head-x hd-a :head-y hd-b)
+ (,blas-func sz st-a inc-a st-b inc-b :head-x hd-a :head-y hd-b)
(symbol-macrolet
((common-code
(mlet* (((nr-a nc-a rs-a cs-a) (slot-values mat-a '(number-of-rows number-of-cols row-stride col-stride))
@@ -128,8 +105,33 @@
mat-b)))
;;
-(defvar *1x1-real-array* (make-array 1 :element-type 'double-float))
-(defvar *1x1-complex-array* (make-array 2 :element-type 'double-float))
+(defmacro generate-typed-num-copy!-func (func element-type store-type matrix-type blas-func
+ array-decl)
+ (let ((num-arg (car array-decl)))
+ (destructuring-bind (var var-maker-form var-setf-form &key type) (cadr array-decl)
+ `(mlet* (((,var) (,@var-maker-form) ,@(if type
+ `(:type (,type)))))
+ (defun ,func (,num-arg mat-x)
+ (declare (type ,element-type ,num-arg)
+ (type ,matrix-type mat-x)
+ (optimize (safety 0) (speed 3)))
+ (,@var-setf-form)
+ (mlet* (((cp-x inc-x sz-x) (blas-copyable-p mat-x) :type (boolean fixnum nil))
+ ((hd-x st-x sz) (slot-values mat-x '(head store number-of-elements)) :type (fixnum (,store-type *) fixnum)))
+ (if cp-x
+ (,blas-func sz ,var 0 st-x inc-x :head-y hd-x)
+ (symbol-macrolet
+ ((common-code
+ (mlet* (((nr-x nc-x rs-x cs-x) (slot-values mat-x '(number-of-rows number-of-cols row-stride col-stride))
+ :type (fixnum fixnum fixnum fixnum)))
+ (loop for i from 0 below nr-x
+ do (,blas-func nc-x ,var 0 st-x cs-x :head-y (+ hd-x (* i rs-x)))))))
+ ;;Choose the smaller of the loops
+ (if (> (nrows mat-x) (ncols mat-x))
+ (with-transpose! (mat-x)
+ common-code)
+ common-code)))
+ mat-x))))))
;;
(defgeneric copy! (matrix new-matrix)
@@ -157,102 +159,72 @@
"))
(defmethod copy! :before ((x standard-matrix) (y standard-matrix))
- (let ((nxm-x (number-of-elements x))
- (nxm-y (number-of-elements y)))
- (declare (type fixnum nxm-x nxm-y))
- (if (not (= nxm-x nxm-y))
- (warn "arguments X,Y to COPY! are of different sizes"))))
+ (mlet* (((nr-x nc-x) (slot-values x '(number-of-rows number-of-cols)) :type (fixnum fixnum))
+ ((nr-y nc-y) (slot-values y '(number-of-rows number-of-cols)) :type (fixnum fixnum)))
+ (unless (and (= nr-x nr-y) (= nc-x nc-y))
+ (error "Arguments X,Y to COPY! are of different dimensions."))))
;;
-(generate-typed-copy!-func real-double-copy!-typed real-matrix-store-type real-matrix blas:dcopy)
-
-(defmethod copy! ((x real-matrix) (y real-matrix))
- (let* ((nxm-x (number-of-elements x))
- (nxm-y (number-of-elements y))
- (nxm (min nxm-x nxm-y)))
- (declare (type fixnum nxm-x nxm-y nxm))
- (dcopy nxm (store x) 1 (store y) 1)
+(defmethod copy! ((x standard-matrix) (y standard-matrix))
+ (mlet* (((nr-x nc-x) (slot-values x '(number-of-rows number-of-cols))
+ :type (fixnum fixnum)))
+ (dotimes (i nr-x)
+ (dotimes (j nc-x)
+ (declare (type fixnum i j))
+ (setf (matrix-ref-2d y i j) (matrix-ref-2d x i j))))
y))
-(defmethod copy! ((x real-matrix) (y complex-matrix))
- (let* ((nxm-x (number-of-elements x))
- (nxm-y (number-of-elements y))
- (nxm (min nxm-x nxm-y)))
- (declare (type fixnum nxm-x nxm-y nxm))
+;;
+(generate-typed-copy!-func real-double-copy!-typed real-matrix-store-type real-matrix blas:dcopy)
- ;; Set the imaginary parts of Y to zero.
- (zdscal nxm 0.0d0 (store y) 1)
+(generate-typed-num-copy!-func real-double-num-copy!-typed
+ double-float real-matrix-store-type real-matrix
+ blas:dcopy
+ (num
+ (1x1-array
+ (allocate-real-store 1)
+ (setf (aref 1x1-array 0) num)
+ :type (real-matrix-store-type 1))))
- ;; Copy the elements of X to the real parts of Y.
- (dcopy nxm (store x) 1 (store y) 2)
- y))
-
(defmethod copy! ((x complex-matrix) (y real-matrix))
- (error "cannot copy a COMPLEX-MATRIX into a REAL-MATRIX,
+ (error "Cannot copy a COMPLEX-MATRIX into a REAL-MATRIX,
don't know how to coerce a COMPLEX to a REAL"))
+(defmethod copy! ((x complex) (y real-matrix))
+ (error "Cannot copy ~a to ~a, don't know how to coerce COMPLEX to REAL"
+ x y))
-;;
-(generate-typed-copy!-func complex-double-copy!-typed complex-matrix-store-type complex-matrix blas:zcopy)
-
-(defmethod copy! ((x complex-matrix) (y complex-matrix))
- (let* ((nxm-x (number-of-elements x))
- (nxm-y (number-of-elements y))
- (nxm (min nxm-x nxm-y)))
- (declare (type fixnum nxm-x nxm-y nxm))
- (dcopy (* 2 nxm) (store x) 1 (store y) 1)
- y))
-
-(defmethod copy! ((x standard-matrix) (y standard-matrix))
- (let* ((nxm-x (number-of-elements x))
- (nxm-y (number-of-elements y))
- (nxm (min nxm-x nxm-y)))
- (declare (type fixnum nxm-x nxm-y nxm))
-
- (dotimes (i nxm)
- (declare (type fixnum i))
- (setf (matrix-ref y i) (matrix-ref x i)))
-
- y))
-
-(defmethod copy! ((x #+(or cmu sbcl) double-float #-(or cmu sbcl) float) (y real-matrix))
- (let ((nxm (number-of-elements y)))
- (setf (aref *1x1-real-array* 0) x)
- (dcopy nxm *1x1-real-array* 0 (store y) 1)
- y))
+(defmethod copy! ((x real-matrix) (y real-matrix))
+ (real-double-copy!-typed x y))
(defmethod copy! ((x cl:real) (y real-matrix))
- (let ((nxm (number-of-elements y)))
- (setf (aref *1x1-real-array* 0) (coerce x 'real-matrix-element-type))
- (dcopy nxm *1x1-real-array* 0 (store y) 1)
- y))
+ (real-double-num-copy!-typed (coerce x 'double-float) y))
-(defmethod copy! ((x complex) (y real-matrix))
- (error "cannot copy ~a to ~a, don't know how to coerce COMPLEX to REAL"
- x
- y))
+;;
+(generate-typed-copy!-func complex-double-copy!-typed complex-matrix-store-type complex-matrix blas:zcopy)
-(defmethod copy! ((x #+:cmu kernel::complex-double-float
- #+:sbcl sb-kernel::complex-double-float
- #-(or cmu sbcl) complex) (y complex-matrix))
- (let ((nxm (number-of-elements y)))
+(generate-typed-num-copy!-func complex-double-num-copy!-typed
+ (complex (double-float * *)) complex-matrix-store-type complex-matrix
+ blas:zcopy
+ (num
+ (1x1-z-array
+ (allocate-complex-store 1)
+ (setf (aref 1x1-z-array 0) (realpart num)
+ (aref 1x1-z-array 1) (imagpart num))
+ :type (complex-matrix-store-type 2))))
- #-(or cmu sbcl) (setq x (complex-coerce x))
+(defmethod copy! ((x complex-matrix) (y complex-matrix))
+ (complex-double-copy!-typed x y))
- (setf (aref *1x1-complex-array* 0) (realpart x))
- (setf (aref *1x1-complex-array* 1) (imagpart x))
- (zcopy nxm *1x1-complex-array* 0 (store y) 1)
- y))
+(defmethod copy! ((x real-matrix) (y complex-matrix))
+ (real-double-copy!-typed x (realpart! y))
+ (scal! 0d0 (imagpart! y))
+ y)
(defmethod copy! ((x number) (y complex-matrix))
- (let ((nxm (number-of-elements y)))
- (setq x (complex-coerce x))
- (setf (aref *1x1-complex-array* 0) (realpart x))
- (setf (aref *1x1-complex-array* 1) (imagpart x))
- (zcopy nxm *1x1-complex-array* 0 (store y) 1)
- y))
+ (complex-double-num-copy!-typed (complex-coerce x) y))
-;;
+;;;;
(defgeneric copy (matrix)
(:documentation
"
@@ -264,32 +236,23 @@ don't know how to coerce a COMPLEX to a REAL"))
=======
Return a copy of the matrix X"))
-(defmethod copy ((matrix standard-matrix))
- (make-instance 'standard-matrix :nrows (nrows matrix) :ncols (ncols matrix) :store (copy-seq (store matrix))))
-
(defmethod copy ((matrix real-matrix))
- (let* ((size (number-of-elements matrix))
- (n (nrows matrix))
- (m (ncols matrix))
+ (let* ((n (nrows matrix))
+ (m (nrows matrix))
(result (make-real-matrix-dim n m)))
- (declare (type fixnum size n m))
- (blas:dcopy size (store matrix) 1 (store result) 1)
- result))
+ (declare (type fixnum n m))
+ (copy! matrix result)))
(defmethod copy ((matrix complex-matrix))
- (let* ((size (number-of-elements matrix))
- (n (nrows matrix))
+ (let* ((n (nrows matrix))
(m (ncols matrix))
(result (make-complex-matrix-dim n m)))
- (declare (type fixnum size n m))
- (blas:zcopy size (store matrix) 1 (store result) 1)
- result))
+ (declare (type fixnum n m))
+ (copy! matrix result)))
(defmethod copy ((matrix number))
matrix)
-
-
;;
(defgeneric convert-to-lisp-array (matrix)
(:documentation
diff --git a/src/dot.lisp b/src/dot.lisp
index 4b643c2..badff89 100644
--- a/src/dot.lisp
+++ b/src/dot.lisp
@@ -133,8 +133,8 @@
(store-x (store x))
(store-y (store y)))
(declare (type fixnum nxm)
- (type (real-matrix-store-type (*)) store-x)
- (type (complex-matrix-store-type (*)) store-y))
+ (type (real-matrix-store-type *) store-x)
+ (type (complex-matrix-store-type *) store-y))
(let ((realpart (ddot nxm store-x 1 store-y 2))
(imagpart (with-vector-data-addresses ((addr-x store-x)
@@ -186,8 +186,8 @@
(store-x (store x))
(store-y (store y)))
(declare (type fixnum nxm)
- (type (real-matrix-store-type (*)) store-y)
- (type (complex-matrix-store-type (*)) store-x))
+ (type (real-matrix-store-type *) store-y)
+ (type (complex-matrix-store-type *) store-x))
(let ((realpart (ddot nxm store-x 2 store-y 1))
(imagpart (with-vector-data-addresses ((addr-x store-x)
diff --git a/src/map.lisp b/src/map.lisp
index 8206e55..5b2afa4 100644
--- a/src/map.lisp
+++ b/src/map.lisp
@@ -124,7 +124,7 @@
(let ((nxm (number-of-elements mat))
(store (store mat)))
(declare (type fixnum nxm)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(dotimes (k nxm mat)
(declare (type fixnum k))
(setf (aref store k) (funcall func (aref store k))))))
@@ -143,7 +143,7 @@
(let ((nxm (number-of-elements mat))
(store (store mat)))
(declare (type fixnum nxm)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(dotimes (k nxm mat)
(declare (type fixnum k))
(setf (aref store k) (funcall func (aref store k))))))
diff --git a/src/norm.lisp b/src/norm.lisp
index b03b512..7087dbe 100644
--- a/src/norm.lisp
+++ b/src/norm.lisp
@@ -128,7 +128,7 @@
(nxm (number-of-elements a))
(store (store a)))
(declare (type fixnum n m nxm)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(if (row-or-col-vector-p a)
(case p
@@ -199,7 +199,7 @@
(nxm (number-of-elements a))
(store (store a)))
(declare (type fixnum n m nxm)
- (type (complex-matrix-store-type (*)) store))
+ (type (complex-matrix-store-type *) store))
(if (row-or-col-vector-p a)
(case p
diff --git a/src/real-matrix.lisp b/src/real-matrix.lisp
index f6a0e0e..87b6684 100644
--- a/src/real-matrix.lisp
+++ b/src/real-matrix.lisp
@@ -9,14 +9,13 @@
(deftype real-matrix-store-type (size)
"The type of the storage structure for a REAL-MATRIX"
- `(simple-array double-float ,size))
+ `(simple-array double-float (,size)))
)
-
;;
(defclass real-matrix (standard-matrix)
((store
:initform nil
- :type (simple-array real-matrix-element-type (*))))
+ :type (real-matrix-store-type *)))
(:documentation "A class of matrices with real elements."))
;;
@@ -34,13 +33,13 @@
;;
(defmethod matrix-ref-1d ((matrix real-matrix) (idx fixnum))
(let ((store (store matrix)))
- (declare (type (real-matrix-store-type (*)) store))
+ (declare (type (real-matrix-store-type *) store))
(aref store idx)))
(defmethod (setf matrix-ref-1d) ((value cl:real) (matrix real-matrix) (idx fixnum))
(let ((store (store matrix)))
- (declare (type (real-matrix-store-type (*)) store))
+ (declare (type (real-matrix-store-type *) store))
(setf (aref store idx) value)))
;;
@@ -103,7 +102,7 @@ don't know how to coerce COMPLEX to REAL"))
(size (* n m))
(store (allocate-real-store size)))
(declare (type fixnum n m size)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(multiple-value-bind (row-stride col-stride)
(ecase order
(:row-major (values m 1))
@@ -126,7 +125,7 @@ don't know how to coerce COMPLEX to REAL"))
(size (* n m))
(store (allocate-real-store size)))
(declare (type fixnum n m size)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(multiple-value-bind (row-stride col-stride)
(ecase order
(:row-major (values m 1))
diff --git a/src/realimag.lisp b/src/realimag.lisp
index 0b7ae11..2b35319 100644
--- a/src/realimag.lisp
+++ b/src/realimag.lisp
@@ -112,8 +112,8 @@
(store (store mat))
(new-store (allocate-real-store nxm)))
(declare (type fixnum n m nxm)
- (type (complex-matrix-store-type (*)) store)
- (type (real-matrix-store-type (*)) new-store))
+ (type (complex-matrix-store-type *) store)
+ (type (real-matrix-store-type *) new-store))
(dcopy nxm store 2 new-store 1)
@@ -140,8 +140,8 @@ its element types are unknown"))
(store (store mat))
(new-store (allocate-real-store nxm)))
(declare (type fixnum n m nxm)
- (type (complex-matrix-store-type (*)) store)
- (type (real-matrix-store-type (*)) new-store))
+ (type (complex-matrix-store-type *) store)
+ (type (real-matrix-store-type *) new-store))
(with-vector-data-addresses ((addr-store store)
(addr-new-store new-store))
diff --git a/src/ref.lisp b/src/ref.lisp
index ce21f79..c5619ef 100644
--- a/src/ref.lisp
+++ b/src/ref.lisp
@@ -152,7 +152,7 @@
(store (allocate-real-store k)))
(declare (optimize (speed 3) (safety 0))
(type fixnum n m k)
- (type (real-matrix-store-type (*)) idx-store mat-store store))
+ (type (real-matrix-store-type *) idx-store mat-store store))
(if (and (> n 1)
(> m 1))
@@ -183,7 +183,7 @@
(store (allocate-real-store k)))
(declare (optimize (speed 3) (safety 0))
(type fixnum n m k)
- (type (real-matrix-store-type (*)) mat-store store))
+ (type (real-matrix-store-type *) mat-store store))
(if (and (> n 1)
(> m 1))
@@ -216,7 +216,7 @@
(mat-store (store mat))
(store (store slice)))
(declare (type fixnum l n m)
- (type (real-matrix-store-type (*))
+ (type (real-matrix-store-type *)
row-idx-store
col-idx-store
mat-store
@@ -247,7 +247,7 @@
(store (store slice)))
(declare (type fixnum l n m)
- (type (real-matrix-store-type (*))
+ (type (real-matrix-store-type *)
mat-store
store))
@@ -269,7 +269,7 @@
(store (store mat)))
(declare (optimize (speed 3) (safety 0))
(type fixnum n m)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(dotimes (i n)
(declare (type fixnum i))
@@ -303,7 +303,7 @@
(m (ncols matrix))
(store (store matrix)))
(declare (type fixnum n m)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(labels ((consistent-i (i)
(and (integerp i)
@@ -472,7 +472,7 @@
(declare (optimize (speed 3) (safety 0))
(type fixnum n m k)
- (type (real-matrix-store-type (*)) idx-store new-store mat-store))
+ (type (real-matrix-store-type *) idx-store new-store mat-store))
(if (and (> n 1)
(> m 1))
@@ -496,7 +496,7 @@
(mat-store (store mat)))
(declare (optimize (speed 3) (safety 0))
(type fixnum n m)
- (type (real-matrix-store-type (*)) new-store mat-store))
+ (type (real-matrix-store-type *) new-store mat-store))
(if (and (> n 1)
(> m 1))
@@ -519,7 +519,7 @@
(new-store (store new))
(mat-store (store mat)))
(declare (type fixnum l n m)
- (type (real-matrix-store-type (*))
+ (type (real-matrix-store-type *)
row-idx-store
col-idx-store
new-store
@@ -545,7 +545,7 @@
(mat-store (store mat)))
(declare (type fixnum l n)
- (type (real-matrix-store-type (*))
+ (type (real-matrix-store-type *)
new-store
mat-store))
@@ -572,7 +572,7 @@
(declare (optimize (speed 3) (safety 0))
(type fixnum n m k)
- (type (real-matrix-store-type (*)) idx-store mat-store))
+ (type (real-matrix-store-type *) idx-store mat-store))
(if (and (> n 1)
(> m 1))
@@ -594,7 +594,7 @@
(mat-store (store mat)))
(declare (optimize (speed 3) (safety 0))
(type fixnum n m)
- (type (real-matrix-store-type (*)) mat-store))
+ (type (real-matrix-store-type *) mat-store))
(if (and (> n 1)
(> m 1))
@@ -618,7 +618,7 @@
(col-idx-store (store col-idx))
(mat-store (store mat)))
(declare (type fixnum l n m)
- (type (real-matrix-store-type (*))
+ (type (real-matrix-store-type *)
row-idx-store
col-idx-store
mat-store))
@@ -642,7 +642,7 @@
(mat-store (store mat)))
(declare (type fixnum l)
- (type (real-matrix-store-type (*))
+ (type (real-matrix-store-type *)
mat-store))
@@ -676,7 +676,7 @@
(new-store (store new)))
(declare (type fixnum n m new-n new-m)
- (type (real-matrix-store-type (*)) store new-store))
+ (type (real-matrix-store-type *) store new-store))
(let ((p (if (integerp i)
@@ -775,7 +775,7 @@
(new-store (store new)))
(declare (type fixnum n m new-n new-m)
- (type (real-matrix-store-type (*)) store new-store))
+ (type (real-matrix-store-type *) store new-store))
(let ((p (if (integerp i)
@@ -838,7 +838,7 @@
(new-store (store new)))
(declare (type fixnum n)
- (type (real-matrix-store-type (*)) store new-store))
+ (type (real-matrix-store-type *) store new-store))
(setf (aref store (fortran-matrix-indexing i 0 n))
(aref new-store 0))))
@@ -888,7 +888,7 @@
(new-store (store new)))
(declare (type fixnum n m new-n new-m)
- (type (real-matrix-store-type (*)) store new-store))
+ (type (real-matrix-store-type *) store new-store))
(let ((p (if (integerp i)
@@ -1025,7 +1025,7 @@
(store (store matrix)))
(declare (type fixnum n m)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(labels ((consistent-i (i)
(and (integerp i)
@@ -1100,7 +1100,7 @@
(store (store matrix)))
(declare (type fixnum n m)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(labels ((consistent-i (i)
(and (integerp i)
@@ -1134,7 +1134,7 @@
(store (store matrix)))
(declare (type fixnum n m)
- (type (real-matrix-store-type (*)) store))
+ (type (real-matrix-store-type *) store))
(labels ((consistent-i (i)
(and (integerp i)
@@ -1235,8 +1235,8 @@
(store (allocate-complex-store k)))
(declare (optimize (speed 3) (safety 0))
(type fixnum n m k)
- (type (real-matrix-store-type (*)) idx-store)
- (type (complex-matrix-store-type (*)) mat-store store))
+ (type (real-matrix-store-type *) idx-store)
+ (type (complex-matrix-store-type *) mat-store store))
(if (and (> n 1)
(> m 1))
@@ -1272,7 +1272,7 @@
(store (allocate-complex-store k)))
(declare (optimize (speed 3) (safety 0))
(type fixnum n m k)
- (type (complex-matrix-store-type (*)) mat-store store))
+ (type (complex-matrix-store-type *) mat-store store))
(if (and (> n 1)
(> m 1))
@@ -1311,10 +1311,10 @@
(mat-store (store mat))
(store (store slice)))
(declare (type fixnum l n m)
- (type (real-matrix-store-type (*))
+ (type (real-matrix-store-type *)
row-idx-store
col-idx-store)
- (type (complex-matrix-store-type (*))
+ (type (complex-matrix-store-type *)
mat-store
store))
@@ -1347,7 +1347,7 @@
(store (store slice)))
(declare (type fixnum l n m)
- (type (complex-matrix-store-type (*))
+ (type (complex-matrix-store-type *)
mat-store
store))
@@ -1375,7 +1375,7 @@
(m (ncols matrix))
(store (store matrix)))
(declare (type fixnum n m)
- (type (complex-matrix-store-type (*)) store))
+ (type (complex-matrix-store-type *) store))
(labels ((consistent-i (i)
(and (integerp i)
@@ -1452,7 +1452,7 @@
(m (ncols matrix))
(store (store matrix)))
(declare (type fixnum n m)
- (type (complex-matrix-store-type (*)) store))
+ (type (complex-matrix-store-type *) store))
(labels ((consistent-i (i)
...
[truncated message content] |