Transpose using array comprehension
18 Apr
2007
18 Apr
'07
5:05 p.m.
I just started playing around with GHC.PArr and array comprehension and I was wondering if there is a way to define the transpose of a matrix using array comprehension? Cheers Chris
18 Apr
18 Apr
5:54 p.m.
On Wed, 18 Apr 2007, Chris Witte wrote:
I just started playing around with GHC.PArr and array comprehension and I was wondering if there is a way to define the transpose of a matrix using array comprehension?
Why not let swap :: (i,j) -> (j,i) swap (a,b) = (b,a) in ixmap (let (lower,upper) = bounds arr in (swap lower, swap upper)) swap arr ?
6789
Age (days ago)
6789
Last active (days ago)
1 comments
2 participants
participants (2)
-
Chris Witte -
Henning Thielemann