Re: Problem with matlisp:map-matrix!
Tunc Simsek <[email protected]>
| Newsgroups | gmane.lisp.matlisp.user |
|---|---|
| Organization | UC Berkeley |
| Message-ID | <[email protected]> |
I'm cc'ing my reply to matlisp-users so that this gets archived. ps. You may try sending matlisp specific messages to matlisp-users or reporting bugs from the matlisp homepage: [email protected] http://matlisp.sourceforge.net I found another bug recently with map-matrix and reported that to the bug list, I'm surprised you didn't get that error: 1. in some platforms (at least on my solaris, with CMU), map-matrix expects a compiled function (an interpreted function is not specialized correctly) 2. in your case, map-matrix is (SETF (AREF ...) (FUNCALL ..)) where the array is double-float, so the error is coming from there. As a temporary fix, you can edit the file src/map.lisp and replace: (AREF STORE K) with (MATRIX-REF MAT K) or replace (FUNCALL ..) with (COERCE (FUNCALL ..) 'real-matrix-element-type) 1 or the other, but both is not needed since MATRIX-REF will coerce as needed. Good luck, Tunc Richard James Panturis Giuly wrote: > > I'm having trouble using the map-matrix function of matlisp. I > keep getting the error "Attempt to store the wrong type of a > value in an array." > > This works fine: > (setq m (matlisp:make-real-matrix 3 3)) > > So does this: > (matlisp:map-matrix! #'+ m) > > But this does not: > (matlisp:map-matrix! #'(lambda (dummy) 1) m) > Error: Attempt to store the wrong type of a value in an array. > [condition type: SIMPLE-ERROR] > > (using Franz ACL on Linux) > > any help is appreciated > > -- > ricky > [email protected]