repa-3.4.1.2: High performance, regular, shape polymorphic parallel arrays.

Safe HaskellNone
LanguageHaskell98

Data.Array.Repa.Index

Contents

Description

Index types.

Synopsis

Index types

data Z

An index of dimension zero

Constructors

Z 

Instances

Eq Z 
Ord Z 
Read Z 
Show Z 
Shape Z 
Slice Z 
Elt e => LoadRange D DIM2 e

Compute a range of elements in a rank-2 array.

Elt e => LoadRange C DIM2 e

Compute a range of elements in a rank-2 array.

Elt e => Load C DIM2 e

Compute all elements in an rank-2 array.

type SliceShape Z = Z 
type FullShape Z = Z 

data tail :. head infixl 3

Our index type, used for both shapes and indices.

Constructors

!tail :. !head infixl 3 

Instances

Elt e => LoadRange D DIM2 e

Compute a range of elements in a rank-2 array.

Elt e => LoadRange C DIM2 e

Compute a range of elements in a rank-2 array.

Elt e => Load C DIM2 e

Compute all elements in an rank-2 array.

(Eq tail, Eq head) => Eq ((:.) tail head) 
(Ord tail, Ord head) => Ord ((:.) tail head) 
(Read tail, Read head) => Read ((:.) tail head) 
(Show tail, Show head) => Show ((:.) tail head) 
Shape sh => Shape ((:.) sh Int) 
Slice sl => Slice ((:.) sl All) 
Slice sl => Slice ((:.) sl Int) 
type SliceShape ((:.) sl All) = (:.) (SliceShape sl) Int 
type SliceShape ((:.) sl Int) = SliceShape sl 
type FullShape ((:.) sl All) = (:.) (FullShape sl) Int 
type FullShape ((:.) sl Int) = (:.) (FullShape sl) Int 

Common dimensions.

type DIM0 = Z

type DIM1 = DIM0 :. Int

type DIM2 = DIM1 :. Int

type DIM3 = DIM2 :. Int

type DIM4 = DIM3 :. Int

type DIM5 = DIM4 :. Int

ix1 :: Int -> DIM1

Helper for index construction.

Use this instead of explicit constructors like (Z :. (x :: Int)). The this is sometimes needed to ensure that x is constrained to be in Int.

ix2 :: Int -> Int -> DIM2

ix3 :: Int -> Int -> Int -> DIM3

ix4 :: Int -> Int -> Int -> Int -> DIM4

ix5 :: Int -> Int -> Int -> Int -> Int -> DIM5