[REBOL] Transpose Re:
From: larry:ecotope at: 6-Oct-2000 18:07
Hi Andrew, Joel
I'll throw in one more implementation of transpose. Way back last January
and December, Gerald Goertzel and I wrote many routines for linear algebra
and matrix manipulation. We tested many versions of basic matrix functions
like add, multiply, transpose and inverse for speed. Jerry won the speed
contest for transpose with this function which assumes matrices are in the
form created by the ARRAY function. (row major order)
transpose: func [m /local r c mt] [
r: length? m
c: length? m/1
mt: array reduce [c r]
repeat i r [
repeat j c [
poke pick mt j i pick pick m i j
]
]
mt
]
Enjoy
-Larry