Yes, it does. You can only use members of the Elt class in repa arrays, and Elt has Unbox as a superclass.
Does Repa always use unboxed Vectors?
But a Repa array can store any element, so how does it handles types which haven't an unboxed equivalent? Or is the unboxing done automatically?2011/11/10 Bas van Dijk <v.dijk.bas@gmail.com>On 9 November 2011 22:33, kaffeepause73 <kaffeepause73@yahoo.de> wrote:Even if it is possible to create an unboxed vector of unboxed vectors,
> Repa is indeed very Interesting, but I have changing vector length in the
> second dimension and later on only want to generate Data on demand. If I use
> Matrices, I will use loads of space for no reason.
if the inner unboxed vectors have variable lengths as you require,
indexing will become O(n) instead of O(1) because you need to traverse
the inner unboxed vectors and check their length to find the desired
index. I'm not sure that's what you want.
Yes your second alternative: a boxed vector of unboxed vectors seems
> Seems like sticking to Boxed Vector for now is best Choice for me.
to do what you want.
I don't think so. All indexing functions get a single Int argument. Of
> isn't data.vector also providing multidimensional arrays?
course it's easy to build a layer on top that adds more dimensions.
The latter, repa provides a layer on top of vector.
> So is Repa just another Version of Data.Vector or is it building another level on top.
Note that you can also convert Vectors to repa Arrays using:
fromVector :: Shape sh => sh -> Vector a -> Array sh a
I believe its O(1).
I guess when your vectors are multi-dimensional and you want to
> And when to use best which of the two ?
benefit from parallelism you should use repa instead of vector.
Cheers,
Bas
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe