Custom Query (35 matches)
Results (19 - 21 of 35)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#20 | fixed | Better docs for the select function, or change the implementation. | ||
Description |
From SO: Hello! I'm a bit confused with select function in repa package:
[0,1,2,3,4,5,6,7,8] I thought i to be between 0 and 10 or 0 and 9. Why is it between 0 and 8? Getting indices from [0..8] for an extend of 10 is confusing. |
|||
#21 | fixed | Nicer syntax for taking subarrays | ||
Description |
A few people have asked how to take sub-matrices. This is an index transformation that's easy to specify, but there should be a nice wrapper for it. We could make a shape polymorphic version using addIndex to add the starting offset. let arr = fromList (Z :. (5 :: Int)) [1, 2, 3, 4, 5 :: Int] in fromFunction (Z :. 3) (\(Z :. ix) -> arr ! (Z :. ix + 1)) |
|||
#22 | fixed | Represent bitmaps as arrays of tuples | ||
Description |
Representing bitmaps as a 3D array isn't ideal because there's no way to perform a map over all the pixels. With this representation:
Suppose we want to convert the image to greyscale in a single operation. We'd really need a function like:
However, that doesn't work because we can't guarantee that the worker function always returns an array of the same length as the original. Because of this we can't guarantee that the result is rectangular, and Repa can only deal with rectangular arrays. If instead we represented Bitmaps as:
Then we could use the original map function and there'd be no problem.
Note that using triples is just as efficient as using a DIM3 array. Repa uses unboxed |