Re: [Haskell-cafe] Matrices in Haskell

2007-07-22 Thread Ivan Lazar Miljenovic
On Tue, 2007-03-20 at 15:09 +1000, Matthew Brecknell wrote: > I'm not sure I see the problem, since any operation that touches all the > elements of a n-by-n matrix will be at least O(n^2). For such an > operation, a transposition should just add a constant factor. What I was hoping for was a dat

Re: [Haskell-cafe] Matrices in Haskell

2007-03-20 Thread Claus Reinke
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 tem

Re: [Haskell-cafe] Matrices in Haskell

2007-03-20 Thread Vincent Kraeutler
Claus Reinke wrote: >> When you tried using Arrays, I presume you used an array indexed by a >> pair (i,j), and just reversed the order of the index pair to switch from >> row-wise to column-wise access? It's hard to see how that would slow you >> down. Perhaps the slowdown was caused by excessive

Re: [Haskell-cafe] Matrices in Haskell

2007-03-20 Thread Claus Reinke
When you tried using Arrays, I presume you used an array indexed by a pair (i,j), and just reversed the order of the index pair to switch from row-wise to column-wise access? It's hard to see how that would slow you down. Perhaps the slowdown was caused by excessive array copying? the difference

Re: [Haskell-cafe] Matrices in Haskell

2007-03-20 Thread Vincent Kraeutler
Matthew Brecknell wrote: > Ivan Miljenovic: > >> As such, I'd like to know if there's any way of storing a an n-by-n >> matrix such that the algorithm/function to get either the rows or the >> columns is less than O(n^2) like transposition is. I did try using an >> Array, but my (admittedly hur

Re: [Haskell-cafe] Matrices in Haskell

2007-03-19 Thread Matthew Brecknell
Ivan Miljenovic: > As such, I'd like to know if there's any way of storing a an n-by-n > matrix such that the algorithm/function to get either the rows or the > columns is less than O(n^2) like transposition is. I did try using an > Array, but my (admittedly hurried and naive) usage of them took l