repa-3.4.1.3: 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 # 

Methods

(==) :: Z -> Z -> Bool #

(/=) :: Z -> Z -> Bool #

Ord Z # 

Methods

compare :: Z -> Z -> Ordering #

(<) :: Z -> Z -> Bool #

(<=) :: Z -> Z -> Bool #

(>) :: Z -> Z -> Bool #

(>=) :: Z -> Z -> Bool #

max :: Z -> Z -> Z #

min :: Z -> Z -> Z #

Read Z # 
Show Z # 

Methods

showsPrec :: Int -> Z -> ShowS #

show :: Z -> String #

showList :: [Z] -> ShowS #

Shape Z # 

Methods

rank :: Z -> Int #

zeroDim :: Z #

unitDim :: Z #

intersectDim :: Z -> Z -> Z #

addDim :: Z -> Z -> Z #

size :: Z -> Int #

sizeIsValid :: Z -> Bool #

toIndex :: Z -> Z -> Int #

fromIndex :: Z -> Int -> Z #

inShapeRange :: Z -> Z -> Z -> Bool #

listOfShape :: Z -> [Int] #

shapeOfList :: [Int] -> Z #

deepSeq :: Z -> a -> a #

Slice Z # 
Elt e => LoadRange D DIM2 e #

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

Methods

loadRangeS :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

loadRangeP :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

Elt e => LoadRange C DIM2 e #

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

Methods

loadRangeS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

loadRangeP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

Elt e => Load C DIM2 e #

Compute all elements in an rank-2 array.

Methods

loadS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () #

loadP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () #

type SliceShape Z # 
type SliceShape Z = Z
type FullShape 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.

Methods

loadRangeS :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

loadRangeP :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

Elt e => LoadRange C DIM2 e #

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

Methods

loadRangeS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

loadRangeP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () #

Elt e => Load C DIM2 e #

Compute all elements in an rank-2 array.

Methods

loadS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () #

loadP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () #

(Eq head, Eq tail) => Eq ((:.) tail head) # 

Methods

(==) :: (tail :. head) -> (tail :. head) -> Bool #

(/=) :: (tail :. head) -> (tail :. head) -> Bool #

(Ord head, Ord tail) => Ord ((:.) tail head) # 

Methods

compare :: (tail :. head) -> (tail :. head) -> Ordering #

(<) :: (tail :. head) -> (tail :. head) -> Bool #

(<=) :: (tail :. head) -> (tail :. head) -> Bool #

(>) :: (tail :. head) -> (tail :. head) -> Bool #

(>=) :: (tail :. head) -> (tail :. head) -> Bool #

max :: (tail :. head) -> (tail :. head) -> tail :. head #

min :: (tail :. head) -> (tail :. head) -> tail :. head #

(Read head, Read tail) => Read ((:.) tail head) # 

Methods

readsPrec :: Int -> ReadS (tail :. head) #

readList :: ReadS [tail :. head] #

readPrec :: ReadPrec (tail :. head) #

readListPrec :: ReadPrec [tail :. head] #

(Show head, Show tail) => Show ((:.) tail head) # 

Methods

showsPrec :: Int -> (tail :. head) -> ShowS #

show :: (tail :. head) -> String #

showList :: [tail :. head] -> ShowS #

Shape sh => Shape ((:.) sh Int) # 

Methods

rank :: (sh :. Int) -> Int #

zeroDim :: sh :. Int #

unitDim :: sh :. Int #

intersectDim :: (sh :. Int) -> (sh :. Int) -> sh :. Int #

addDim :: (sh :. Int) -> (sh :. Int) -> sh :. Int #

size :: (sh :. Int) -> Int #

sizeIsValid :: (sh :. Int) -> Bool #

toIndex :: (sh :. Int) -> (sh :. Int) -> Int #

fromIndex :: (sh :. Int) -> Int -> sh :. Int #

inShapeRange :: (sh :. Int) -> (sh :. Int) -> (sh :. Int) -> Bool #

listOfShape :: (sh :. Int) -> [Int] #

shapeOfList :: [Int] -> sh :. Int #

deepSeq :: (sh :. Int) -> a -> a #

Slice sl => Slice ((:.) sl All) # 

Methods

sliceOfFull :: (sl :. All) -> FullShape (sl :. All) -> SliceShape (sl :. All) #

fullOfSlice :: (sl :. All) -> SliceShape (sl :. All) -> FullShape (sl :. All) #

Slice sl => Slice ((:.) sl Int) # 

Methods

sliceOfFull :: (sl :. Int) -> FullShape (sl :. Int) -> SliceShape (sl :. Int) #

fullOfSlice :: (sl :. Int) -> SliceShape (sl :. Int) -> FullShape (sl :. Int) #

type SliceShape ((:.) sl All) # 
type SliceShape ((:.) sl Int) # 
type SliceShape ((:.) sl Int) = SliceShape sl
type FullShape ((:.) sl All) # 
type FullShape ((:.) sl All) = (:.) (FullShape sl) Int
type 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 #