On Mon, Jun 22, 2009 at 6:40 PM, Richard M Kreuter <firstname.lastname@example.org>
SVREF only works on SIMPLE-VECTORS. A SIMPLE-VECTOR is
| a vector that is not displaced to another array, has no fill pointer,
| is not expressly adjustable and is able to hold elements of any type
Your RET is a vector of SINGLE-FLOATs, not a SIMPLE-VECTOR.
Thank you... that did indeed, get me past that hump.
(declaim (ftype (function ((array single-float (3 4))
(vector single-float 3))
(vector single-float 3)) mv*))
(defun mv* (matrix vector)
(declare (optimize (speed 3) (safety 0)))
(let ((ret (make-array 3 :initial-element 0.0s0
(loop for jj from 0 below 3
do (setf (aref ret jj)
(+ (aref matrix jj 3)
(loop for ii from 0 below 3
summing (* (aref vector ii)
(aref matrix jj ii))))))
Now, to beat it up until it likes a higher speed setting. Most of the notes I get from (speed 2) (safety 0) are understandable. But, I don't have any idea what the first one is complaining about:
; file: /private/var/tmp/tmp.3.87YzPd.lisp
; in: DEFUN MV*
; (AREF MATRIX JJ 3)
; --> LET*
; (SB-KERNEL:HAIRY-DATA-VECTOR-REF ARRAY SB-INT:INDEX)
; note: unable to
; avoid runtime dispatch on array element type
; due to type uncertainty:
; The first argument is a (ARRAY SINGLE-FLOAT (3 4)), not a SIMPLE-ARRAY.
As you mentioned, a simple-array would have type uncertainty. But, shouldn't (array single-float (3 4)) be fairly type-certain?