[Gsll-devel] make-marray, :cl-array keyword

Liam Healy lhealy at common-lisp.net
Fri Apr 16 02:13:07 UTC 2010


No, not really.  :cl-array was put in for internal use, and
I tried after you posted to comp.lang.lisp (I'm assuming
you are allchemist) and it doesn't work.  I'll need to clean
that up.  I think your use of :data is on the right track
but you'll have to make your array with c-array:make-ffa
if you want to use it in GSL.

In general I think it would be a good idea to be able
easily go back and forth between CL and marrays.
I'm not sure the best way to do that at present and
what changes need to be made.  I'll have to think about
it.   Unfortunately I won't be able to get to this for a
while.

Liam


On Wed, Apr 14, 2010 at 4:26 PM, ivan hohlov <hohlovivan at gmail.com> wrote:
> Hi all!
>
> There is a keyword :cl-array for the gsll:make-marray function. Can I
> use it to convert native lisp array into marray?
> I'm trying to do this:
> (defparameter *m* (make-array '(3 3)
>                              :element-type 'single-float
>                              :initial-contents '((1.0 2.0 3.0)
>                                                  (4.0 5.0 6.0)
>                                                  (7.0 8.0 9.0))))
> (gsll:make-marray 'single-float :dimensions '(3 3) :cl-array *m*)
> leads to error "Invalid initialization argument: :cl-array". (sbcl, of course)
> Am I right, using :cl-array in such a way? I have searched for
> examples with thes key, but found nothing.
>
> Also, if I use :data key instead of :cl-array, it works, but tue
> resulting marray couldn't be used in common routines, such as matrix
> multiplication, because it isn't simple-array.
>
> To generalize the problem - Is it possible to convert lisp array to
> gsll marray without copying data?
>
> Thanks




More information about the gsll-devel mailing list