Operations on arrays
John van Groningen
johnvg@cs.kun.nl
Fri, 5 Mar 1999 14:30:17 +0100
>Oh yes, here's the good news. I've rewritten the NN program to use
>
>:: Number :== !Real
>:: Vector :== !{#Real}
>:: Matrix :== !{Vector}
>
>instead of
>
>:: Number :== !Real
>:: Vector :== !{Number}
>:: Matrix :== !{Vector}
>
>and the program now takes 452 seconds, down from 2248 last time. So
>that's nearly a factor of five going from lists of lists of doubles
>to arrays of arrays of unboxed doubles; I was expecting a factor of 4.
Using
:: Matrix :== !{#Vector}
instead of
:: Matrix :== !{Vector}
may be even faster. The ! is probably not necessary. This does not unbox the Vector array, but removes an (ARRAY) indirection node that points to the Vector.
John van Groningen