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

Safe HaskellNone
LanguageHaskell98

Data.Array.Repa.Repr.Delayed

Synopsis

Documentation

data D #

Delayed arrays are represented as functions from the index to element value.

Every time you index into a delayed array the element at that position is recomputed.

Instances

Source D a #

Compute elements of a delayed array.

Associated Types

data Array D sh a :: * #

Methods

extent :: Shape sh => Array D sh a -> sh #

index :: Shape sh => Array D sh a -> sh -> a #

unsafeIndex :: Shape sh => Array D sh a -> sh -> a #

linearIndex :: Shape sh => Array D sh a -> Int -> a #

unsafeLinearIndex :: Shape sh => Array D sh a -> Int -> a #

deepSeqArray :: Shape sh => Array D sh a -> b -> b #

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 () #

Shape sh => Load D sh e #

Compute all elements in an array.

Methods

loadS :: Target r2 e => Array D sh e -> MVec r2 e -> IO () #

loadP :: Target r2 e => Array D sh e -> MVec r2 e -> IO () #

Structured D a b # 

Associated Types

type TR D :: * #

Methods

smap :: Shape sh => (a -> b) -> Array D sh a -> Array (TR D) sh b #

szipWith :: (Shape sh, Source r c) => (c -> a -> b) -> Array r sh c -> Array D sh a -> Array (TR D) sh b #

(Shape sh, Load D sh e) => Load (I D) sh e # 

Methods

loadS :: Target r2 e => Array (I D) sh e -> MVec r2 e -> IO () #

loadP :: Target r2 e => Array (I D) sh e -> MVec r2 e -> IO () #

data Array D # 
data Array D = ADelayed !sh (sh -> a)
type TR D # 
type TR D = D

fromFunction :: sh -> (sh -> a) -> Array D sh a #

O(1). Wrap a function as a delayed array.

toFunction :: (Shape sh, Source r1 a) => Array r1 sh a -> (sh, sh -> a) #

O(1). Produce the extent of an array, and a function to retrieve an arbitrary element.

delay :: Shape sh => Source r e => Array r sh e -> Array D sh e #

O(1). Delay an array. This wraps the internal representation to be a function from indices to elements, so consumers don't need to worry about what the previous representation was.