
Hi, I am trying to parallellise genetic algorithms using haskell, but I get stuck at the stage where I need to sort the array of chromosomes based on their fitness. Using Repa, I am neither able to find a nice library implementation to sort an array, nor can I figure out how to generate a new array modifying only a few entries. I am not at a stage where I need to optimise execution time. It is still at the stage of learning exercise, wrt both to genetic algorithms, haskell, and splittable pseudo-random number generators. Thus, I would be grateful for both naïve and clever suggestions :-) Except for the sorting stage, the problem seems to well suited for Repa, with a chain of operations which can be mapped on the array. I am also planning to explore accelerate later for GPU work, and Repa seems to be a better step on the way than most other alternatives. My arrays are 1-D boxed arrays BTW. The entries are tuples including an Unboxed Vector (and a Double on which the sort order is defined). Doing it as a 2-D Unboxed Array is further down on the agenda; I need more practice before I get my head around using slices correctly. So, any advice? Whether it involves conversion to a data type where a library sort routine is available, a library sort routine I have missed, or how to create new deferred arrays by updating selected entries in the input array so that I can implement sorting myself. TIA -- :-- Hans Georg