Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic programming in repa

Tags:

haskell

repa

Two related questions.

  • Is there a reason why there is no mutable (ST monad) implementation of repa arrays? Equivalent to Data.Vector.Mutable but with a shape.

  • Related to this, how is one supposed to implement dynamic programming algorithms (array elements computed from other elements of the same array), in the unboxed representation?

like image 743
Federico Squartini Avatar asked Jan 04 '13 10:01

Federico Squartini


1 Answers

Repa is designed for bulk data parallel programming. It must be possible to compute array elements in arbitrary order, otherwise the Repa evaluation methods won't work.

If you want to destructively update an array element based on other array elements, then this constrains the evaluation order. If you can't express your algorithm in a bulk data parallel fashion then Repa isn't going to help you.

like image 52
Ben Lippmeier Avatar answered Sep 17 '22 23:09

Ben Lippmeier