Questions tagged [repa]

Repa is a Haskell package for high performance, regular, shape polymorphic parallel arrays.

Repa provides high performance, regular, multi-dimensional, shape polymorphic parallel arrays. All numeric data is stored unboxed. Functions written with the Repa combinators are automatically parallel provided you supply +RTS -Nwhatever on the command line when running the program.

104 questions
1
vote
1 answer

REPA: computeS and computeP?

I am trying this REPA library, and i want to process an image in both ways, parallel and sequentially. I can read the image (with other library, DevIL) and process it with computeP (parallel). Here is the code (is from a example on the wiki of…
Hamburguesa66
  • 87
  • 1
  • 7
1
vote
1 answer

Variable inner types for wrapped Repa array

I'm attempting to write a thin wrapper around repa to provide extra constraints for some domain-specific work I'm doing. I have the type: newtype Tile p r a = Tile { _array :: Array r DIM2 a } where Array comes from repa. I'd like to hide the r…
Colin Woodbury
  • 1,799
  • 2
  • 15
  • 25
1
vote
0 answers

Vector of Vectors to 2D Repa Array

What is the cleanest way to turn a Vector of vectors of unboxed doubles into a repa Array U DIM2 Double? The most obvious way is to concatenate all the unboxed vectors into one and pass it to fromUnboxed, but that feels a bit clumsy. Is there a…
Rob Agar
  • 12,337
  • 5
  • 48
  • 63
1
vote
1 answer

Yarr slice usage

I've been exploring the Data.Yarr Array library, as a possible replacement for some code I have in Repa. It seems fully featured, and the benchmarks - if correct suggest a performance improvement may be had. I'm interested in the correct use of the…
OllieB
  • 1,431
  • 9
  • 14
1
vote
1 answer

Haskell Repa - traversing a 2D array

I am trying to traverse a 2D array i created using repa, so far i have the function that gets called on every element, but i dont understand what fundamental concept exists that wont let me execute expressions inside that function, what i have so…
1
vote
1 answer

How to stack arrays in repa (Haskell)

Suppose there are two 1-D arrays of the same length: let x = fromListUnboxed (ix1 4) [1, 2, 3, 4] let y = fromListUnboxed (ix1 4) [5, 6, 7, 8] Now I would like to stack these two arrays into one 2-D array so that these arrays form the rows. How can…
zegkljan
  • 8,051
  • 5
  • 34
  • 49
1
vote
1 answer

An array of triplets in repa checked at compile time

First of all, I'm a total newbie in repa and I still consider myself a beginner in Haskell in general. I need an effective array of triplets of doubles. The naïve approach would be [(Double, Double, Double)] but that's not effective. I thought I…
zegkljan
  • 8,051
  • 5
  • 34
  • 49
1
vote
2 answers

Intersperse values into separate Vectors using generate

I am trying to generate a tuple of Vectors by using a function that creates a custom data type (or a tuple) of values from an index. Here is an approach that achieves the desired result: import Prelude hiding (map, unzip) import Data.Vector hiding…
lehins
  • 9,642
  • 2
  • 35
  • 49
1
vote
1 answer

Converting accelerate's A array representation to repa's U array representation

I'd like to convert an accelerate array to a repa array, before then using writeImageToBMP from repa-io to write the array to a BMP file. Ignore the fact that there exists such a function in accelerate-io, I'm just using it as an example of the…
Rob Stewart
  • 1,812
  • 1
  • 12
  • 25
1
vote
1 answer

Haskell Repa meaning of BoundFixed?

In the Repa package, there is a Boundary datatype: data Boundary a = BoundFixed !a | BoundConst !a | BoundClamp deriving (Show) I understand what is meant by BoundConst (cells outside of the array are treated as…
user1002430
1
vote
1 answer

GHC 7.10.2 Data.Vector.Unboxed conflict with REPA 3.4.0.1

I've installed the Vector package and REPA using Cabal for GHC 7.10.2. Running this program: import qualified Data.Array.Repa as R import qualified Data.Vector.Unboxed as U main = print $ R.fromUnboxed (R.Z R.:. 16 R.:. 16) (U.replicate 10 0) I…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
1
vote
0 answers

Haskell - build a three-dimensional array from a one-dimensional list of coordinate-tuples

I have a list of 3D coordinates (x,y,z) that specify a scalar value (rho) at each location, which I have loaded into a repa array: a :: Array D DIM1 (Int, Int, Int, Double) i.e. each array element is a 4-tuple, representing (x,y,z,rho). Also, I'm…
1
vote
1 answer

How to do a Fourier Transform of an image using haskell

How does one do the Discrete Fourier Transformation of an image using haskell. I believe the two libraries repa-devil and repa-fftw could be helpful, but I do not know how to integrate them. The reason why I would like this is so I could experiment…
PyRulez
  • 10,513
  • 10
  • 42
  • 87
1
vote
2 answers

haskell double precision underflow with repa

I've written some code calculating a distance matrix using repa: distance :: Int -> Int -> Mat -> Double distance aindx bindx arr = let a = slice arr (Any :. aindx :. All) b = slice arr (Any :. bindx :. All)- …
nont
  • 9,322
  • 7
  • 62
  • 82
1
vote
1 answer

Implementing Phase Unwrapping Algorithm with Haskell Repa Array

I'm trying to implement a Phase Unwrapping Algorithm for Three Phase Structured Light Scanning in Haskell using a Repa Array. I want to implement a flood fill based unwrapping algorithm recursing outward from the point (width / 2, height / 2).…
Rowan
  • 43
  • 6