repa-array-4.0.0.2: Bulk array representations and operators.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Array.Tuple

Synopsis

Documentation

data T2 l1 l2 Source

Tupled arrays where the components are unpacked and can have separate representations.

Constructors

Tup2 !l1 !l2 

Instances

(Eq (Name l1), Eq (Name l2)) => Eq (Name (T2 l1 l2)) 
(Show (Name l1), Show (Name l2)) => Show (Name (T2 l1 l2)) 
(Eq l1, Eq l2) => Eq (T2 l1 l2) 
(Show (Array l1 a), Show (Array l2 b)) => Show (Array (T2 l1 l2) (a, b)) 
(Show l1, Show l2) => Show (T2 l1 l2) 
((~) * (Index l1) (Index l2), Layout l1, Layout l2) => Layout (T2 l1 l2) 
(Bulk l1 a, Bulk l2 b, (~) * (Index l1) (Index l2)) => Bulk (T2 l1 l2) (a, b)

Tupled arrays.

(Windowable l1 a, Windowable l2 b, (~) * (Index l1) (Index l2)) => Windowable (T2 l1 l2) (a, b)

Tupled windows.

(Target l1 a, Target l2 b, (~) * (Index l1) (Index l2)) => Target (T2 l1 l2) (a, b)

Tupled buffers.

(Unpack (Buffer s r1 a) t1, Unpack (Buffer s r2 b) t2) => Unpack (Buffer s (T2 r1 r2) (a, b)) (t1, t2) 
data Buffer s (T2 l1 l2) (a, b) = T2Buffer !(Buffer s l1 a) !(Buffer s l2 b) 
data Name (T2 l1 l2) = T2 !(Name l1) !(Name l2) 
type Index (T2 l1 l2) = Index l1 
data Array (T2 l1 l2) (a, b) = T2Array !(Array l1 a) !(Array l2 b) 

tup2 :: (Bulk l1 a, Bulk l2 b, Index l1 ~ Index l2) => Array l1 a -> Array l2 b -> Array (T2 l1 l2) (a, b) Source

Tuple two arrays into an array of pairs.

The two argument arrays must have the same index type, but can have different extents. The extent of the result is the intersection of the extents of the two argument arrays.

untup2 :: Array (T2 l1 l2) (a, b) -> (Array l1 a, Array l2 b) Source

Untuple an array of tuples in to a tuple of arrays.

  • The two returned components may have different extents, though they are guaranteed to be at least as big as the argument array. This is the key property that makes untup2 different from unzip.