[GOODIE] Matrix-raok
David A. Smith
davidasmith at bellsouth.net
Fri Nov 22 13:57:42 UTC 2002
Actually, Andreas and I came up with this little trick. Andreas had to
(obviously) hack the compiler to make it work - which it does quite nicely.
The only reason it is not used at the moment is that it is still a bit slow
for real time 3D. Our intent is to have this dynamically compile to native
code - in particular, I want to take advantage of the vector processing
capability of many of the CPUs out there (like Altevec and MMX). Andreas
would have to package it up, but it is still missing a few items.
Otherwise, it is a completely general purpose n-dimensional matrix engine
with a much cleaner and readable syntax than APL (which was my first
language). It is a priority of Croquet, as I believe this will allow us to
exceed performance of C++ engines and be easier to program at the same time.
Regards,
David
At 02:40 PM 11/22/2002 +0100, you wrote:
>On Fri, 22 Nov 2002, Richard A. O'Keefe wrote:
>
> > The numerical linear algebra package recently posted to this list has
> > *far* wider coverage.
>
>I was talking about the Matrix class in the Croquet image. The one we
>discussed recently because the plugin was missing. It would be nice if the
>author (Dave?) would pipe up and post it as goodie, too.
>
> > My little 'Matrix' class is now of interest mainly (solely?) for these
> > two reasons:
> >
> > (1) I deliberately decided NOT to let you specify a class by the underlying
> > array. [...]
>
>Yep.
>
> > (2) A very major point was my decision, influenced by APL and S-Plus,
> > that ordinary arithmetic binary selectors should *consistently* be
> > interpreted as elementwise operations. That is,
> > / 1 2 \ * / 1 0 \ = /
> > \ 3 4 / \ 0 1 /
>
>Agreed. This is exactly what the Matrix class in Croquet does (actual
>code):
>
>| a b |
>a := Matrix[2,2] fill: #(1 2 3 4).
>b := Matrix[2,2] fill: #(1 0 0 1).
>a * b "[1 0
> 0 4]"
>
>-- Bert
More information about the Squeak-dev
mailing list
|