Matrix transposition: Difference between revisions
Content added Content deleted
(→{{header|Haskell}}: Removed an entry (pending reassurances) which appears to violate copyright.) |
|||
Line 1,898: | Line 1,898: | ||
transpArray a = ixmap (swap l, swap u) swap a where |
transpArray a = ixmap (swap l, swap u) swap a where |
||
(l,u) = bounds a</lang> |
(l,u) = bounds a</lang> |
||
From Davie ''Introduction to Functional Programming Systems Using Haskell'': |
|||
<lang haskell>transpose ([]:rest) = [] |
|||
transpose x = Prelude.map hd x : transpose (Prelude.map tl x) |
|||
where hd (p:_) = p |
|||
tl (_:q) = q</lang> |
|||
===With Numeric.LinearAlgebra=== |
===With Numeric.LinearAlgebra=== |