[Haskell-cafe] Matrices in Haskell

Claus Reinke claus.reinke at talk21.com
Tue Mar 20 10:39:08 EDT 2007

>it seems unlikely to me that this would cause a degradation in
>performance with respect to lists...

that might depend on the number of operations per transposition, i guess. 

lists and explicit transpositions make it very obvious what is going on in terms of
iteration order, so i would be tempted to group operations by whether they need
a plain or transposed structure. arrays hide this kind of thing, so i might pay the
cost for every transposed operation without the code warning me.

the original poster was doing (transpose . op . transpose) for each out-of-order 
op in the list version, so that might be on par with what the array version does, or
not. optimising array computations is a fun business.

but i misread the part i quoted to talk about slowdown on switching between 
row-column and column-row, whereas it was generally about slowdown on 
switching variable-order operations from lists to arrays. so i assume that posters
here were already aware of the transposition of layout affecting arrays as well.


More information about the Haskell-Cafe mailing list