[Gsll-devel] grid tranpose & diagonal compatibility with marray's
Mirko Vukovic
mirko.vukovic at gmail.com
Tue Jan 26 15:59:59 UTC 2010
On Tue, Jan 12, 2010 at 10:42 AM, Mirko Vukovic <mirko.vukovic at gmail.com>wrote:
> I am converting some of my code to use grid.
>
> The following is on clisp & cygwin (my sbcl & linux is behind a firewall,
> so it takes a bit for me to transfer stuff to them)
>
> It seems that while `transpose' can handle both arrays and marrays,
> diagonal can handle only arrays. I traced the execution to
> `make-specification' in specification.lisp: SYSTEM::LIST-ACCESS: NIL is not
> a pair.
>
>
> GSL> #m(1 2 3 ^ 4 5 6 ^ 7 8 9)
> #<MATRIX-DOUBLE-FLOAT #2A((1.0d0 2.0d0 3.0d0) (4.0d0 5.0d0 6.0d0) (7.0d0
> 8.0d0 9.0d0))>
> GSL> (grid:transpose #m(1 2 3 ^ 4 5 6 ^ 7 8 9))
> #<MATRIX-DOUBLE-FLOAT #2A((1.0d0 4.0d0 7.0d0) (2.0d0 5.0d0 8.0d0) (3.0d0
> 6.0d0 9.0d0))>
> GSL> (grid:diagonal #m(1 2 3 ^ 4 5 6 ^ 7 8 9))
> ; Evaluation aborted.
> GSL> (grid:transpose (cl-array #m(1 2 3 ^ 4 5 6 ^ 7 8 9)))
> #2A((1.0d0 4.0d0 7.0d0) (2.0d0 5.0d0 8.0d0) (3.0d0 6.0d0 9.0d0))
> GSL> (grid:diagonal (cl-array #m(1 2 3 ^ 4 5 6 ^ 7 8 9)))
> #(1.0d0 5.0d0 9.0d0)
> GSL>
>
> FWIW, in the test suite (tests/compose.lisp), the diagonal tests are on
> arrays, and not marrays.
>
> Thanks,
>
> Mirko
>
I confirmed that `grid:diagonal' operates only on cl-arrays and not on
marrays on clisp & sbcl (the latest version of grid, downloaded a few
minutes ago). Bug or feature?
Mirko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/gsll-devel/attachments/20100126/4b577804/attachment.html>
More information about the gsll-devel
mailing list