
I'm a bit confused on what the standard is when it comes to arrays and performance in Haskell. Say I have a function that takes an n dimensional array. The array only contains some primitive type. The function mutates the array in an deterministic but chaotic pattern. The new value of an element might depend on other values in the array, and the order of update might depend on what values are found. How would I implement this in an efficient fashion in Haskell. Is the array package the way to go? Would vector with some custom indexing scheme work well? The array package provides n dimensional indexing, vector doesn't. Does vector perform better than array? Is it realistic to approach the performance of a naive c implementation? What steps would need to be taken in order to achieve that? I know there are many question here, but I don't expect perfect answers to them. I just need to bootstrap my map of numerics in Haskell. PS: An example of the above function could be Gaussian elimination of a matrix. -- Morten Olsen Lysgaard NTNU-IT - Orakeltjenesten NTNU - Physics and Mathematics

Hi Morten, If speed is really important I would go with the vector package. It has a more modern API and better performance. -- Johan

Well actually, unless you _really_ need paramterizable indexes (i.e. not
only Ints) I don't see reasons to prefer array to vector now.
2012/5/4 Johan Tibell
Hi Morten,
If speed is really important I would go with the vector package. It has a more modern API and better performance.
-- Johan
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Johan Tibell
-
Morten Olsen lysgaard
-
Yves Parès