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

Safe Haskell | None
Language | Haskell98

Data.Array.Repa.Index

Contents

- Index types
- Common dimensions.

Description

Index types.

Synopsis

- data Z = Z
- data tail :. head = !tail :. !head
- 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
- ix2 :: Int -> Int -> DIM2
- ix3 :: Int -> Int -> Int -> DIM3
- ix4 :: Int -> Int -> Int -> Int -> DIM4
- ix5 :: Int -> Int -> Int -> Int -> Int -> DIM5

# Index types

data Z Source #

An index of dimension zero

Constructors

Z |

Instances

Eq Z Source # |
Instance details Defined in Data.Array.Repa.Index Methods (==) :: Z -> Z -> Bool Source # (/=) :: Z -> Z -> Bool Source #
Ord Z Source # |
Instance details Defined in Data.Array.Repa.Index Methods compare :: Z -> Z -> Ordering Source # (<) :: Z -> Z -> Bool Source # (<=) :: Z -> Z -> Bool Source # (>) :: Z -> Z -> Bool Source # (>=) :: Z -> Z -> Bool Source # max :: Z -> Z -> Z Source # min :: Z -> Z -> Z Source #
Read Z Source # |
Instance details Defined in Data.Array.Repa.Index Methods readsPrec :: Int -> ReadS Z Source # readList :: ReadS [Z] Source # readPrec :: ReadPrec Z Source # readListPrec :: ReadPrec [Z] Source #
Show Z Source # |
Instance details Defined in Data.Array.Repa.Index Methods showsPrec :: Int -> Z -> ShowS Source # show :: Z -> String Source # showList :: [Z] -> ShowS Source #
Arbitrary Z Source # | This module exports instances of `Arbitrary` and `CoArbitrary` for unboxed Repa arrays.
Instance details Defined in Data.Array.Repa.Arbitrary Methods arbitrary :: Gen Z Source # shrink :: Z -> [Z] Source #
CoArbitrary Z Source # |
Instance details Defined in Data.Array.Repa.Arbitrary Methods coarbitrary :: Z -> Gen b -> Gen b Source #
Shape Z Source # |

Instance details

Defined in Data.Array.Repa.Index

Methods

rank :: Z -> Int Source #

zeroDim :: Z Source #

unitDim :: Z Source #

intersectDim :: Z -> Z -> Z Source #

addDim :: Z -> Z -> Z Source #

size :: Z -> Int Source #

sizeIsValid :: Z -> Bool Source #

toIndex :: Z -> Z -> Int Source #

fromIndex :: Z -> Int -> Z Source #

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

listOfShape :: Z -> [Int] Source #

shapeOfList :: [Int] -> Z Source #

deepSeq :: Z -> a -> a Source #

Slice Z Source # |
Instance details Defined in Data.Array.Repa.Slice Methods sliceOfFull :: Z -> FullShape Z -> SliceShape Z Source # fullOfSlice :: Z -> SliceShape Z -> FullShape Z Source #
Elt e => LoadRange D DIM2 e Source # | Compute a range of elements in a rank-2 array.
Instance details Defined in Data.Array.Repa.Repr.Delayed Methods loadRangeS :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source # loadRangeP :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source #
Elt e => LoadRange C DIM2 e Source # | Compute a range of elements in a rank-2 array.
Instance details Defined in Data.Array.Repa.Repr.Cursored Methods loadRangeS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source # loadRangeP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source #
Elt e => Load C DIM2 e Source # | Compute all elements in an rank-2 array.
Instance details Defined in Data.Array.Repa.Repr.Cursored Methods loadS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () Source # loadP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () Source #
type SliceShape Z Source # |
Instance details Defined in Data.Array.Repa.Slice type SliceShape Z = Z
type FullShape Z Source # |
Instance details Defined in Data.Array.Repa.Slice type FullShape Z = Z

data tail :. head infixl 3 Source #

Our index type, used for both shapes and indices.

Constructors

!tail :. !head infixl 3 |

Instances

Elt e => LoadRange D DIM2 e Source # | Compute a range of elements in a rank-2 array.
Instance details Defined in Data.Array.Repa.Repr.Delayed Methods loadRangeS :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source # loadRangeP :: Target r2 e => Array D DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source #
Elt e => LoadRange C DIM2 e Source # | Compute a range of elements in a rank-2 array.
Instance details Defined in Data.Array.Repa.Repr.Cursored Methods loadRangeS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source # loadRangeP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> DIM2 -> DIM2 -> IO () Source #
Elt e => Load C DIM2 e Source # | Compute all elements in an rank-2 array.
Instance details Defined in Data.Array.Repa.Repr.Cursored Methods loadS :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () Source # loadP :: Target r2 e => Array C DIM2 e -> MVec r2 e -> IO () Source #
(Eq tail, Eq head) => Eq (tail :. head) Source # |
Instance details Defined in Data.Array.Repa.Index Methods (==) :: (tail :. head) -> (tail :. head) -> Bool Source # (/=) :: (tail :. head) -> (tail :. head) -> Bool Source #
(Ord tail, Ord head) => Ord (tail :. head) Source # |

Instance details

Defined in Data.Array.Repa.Index

Methods

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

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

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

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

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

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

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

(Read tail, Read head) => Read (tail :. head) Source # |
Instance details Defined in Data.Array.Repa.Index Methods readsPrec :: Int -> ReadS (tail :. head) Source # readList :: ReadS [tail :. head] Source # readPrec :: ReadPrec (tail :. head) Source # readListPrec :: ReadPrec [tail :. head] Source #
(Show tail, Show head) => Show (tail :. head) Source # |
Instance details Defined in Data.Array.Repa.Index Methods showsPrec :: Int -> (tail :. head) -> ShowS Source # show :: (tail :. head) -> String Source # showList :: [tail :. head] -> ShowS Source #
Arbitrary a => Arbitrary (a :. Int) Source # |
Instance details Defined in Data.Array.Repa.Arbitrary Methods arbitrary :: Gen (a :. Int) Source # shrink :: (a :. Int) -> [a :. Int] Source #
CoArbitrary a => CoArbitrary (a :. Int) Source # |
Instance details Defined in Data.Array.Repa.Arbitrary Methods coarbitrary :: (a :. Int) -> Gen b -> Gen b Source #
Shape sh => Shape (sh :. Int) Source # |

Instance details

Defined in Data.Array.Repa.Index

Methods

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

zeroDim :: sh :. Int Source #

unitDim :: sh :. Int Source #

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

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

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

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

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

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

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

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

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

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

Slice sl => Slice (sl :. All) Source # |
Instance details Defined in Data.Array.Repa.Slice Methods sliceOfFull :: (sl :. All) -> FullShape (sl :. All) -> SliceShape (sl :. All) Source # fullOfSlice :: (sl :. All) -> SliceShape (sl :. All) -> FullShape (sl :. All) Source #
Slice sl => Slice (sl :. Int) Source # |
Instance details Defined in Data.Array.Repa.Slice Methods sliceOfFull :: (sl :. Int) -> FullShape (sl :. Int) -> SliceShape (sl :. Int) Source # fullOfSlice :: (sl :. Int) -> SliceShape (sl :. Int) -> FullShape (sl :. Int) Source #
type SliceShape (sl :. All) Source # |
Instance details Defined in Data.Array.Repa.Slice type SliceShape (sl :. All) = SliceShape sl :. Int
type SliceShape (sl :. Int) Source # |
Instance details Defined in Data.Array.Repa.Slice type SliceShape (sl :. Int) = SliceShape sl
type FullShape (sl :. All) Source # |
Instance details Defined in Data.Array.Repa.Slice type FullShape (sl :. All) = FullShape sl :. Int
type FullShape (sl :. Int) Source # |
Instance details Defined in Data.Array.Repa.Slice type FullShape (sl :. Int) = FullShape sl :. Int

# Common dimensions.

type DIM0 = Z Source #

type DIM1 = DIM0 :. Int Source #

type DIM2 = DIM1 :. Int Source #

type DIM3 = DIM2 :. Int Source #

type DIM4 = DIM3 :. Int Source #

type DIM5 = DIM4 :. Int Source #

ix1 :: Int -> DIM1 Source #

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 Source #

ix3 :: Int -> Int -> Int -> DIM3 Source #

ix4 :: Int -> Int -> Int -> Int -> DIM4 Source #

ix5 :: Int -> Int -> Int -> Int -> Int -> DIM5 Source #