repa-3.4.1.5: High performance, regular, shape polymorphic parallel arrays.
Safe HaskellNone
LanguageHaskell2010

Data.Array.Repa.Stencil.Dim2

Synopsis

Stencil creation

makeStencil2 Source #

Arguments

:: Num a 
=> Int 
-> Int

extent of stencil

-> (DIM2 -> Maybe a)

Get the coefficient at this index.

-> Stencil DIM2 a 

Wrapper for makeStencil that requires a DIM2 stencil.

stencil2 :: QuasiQuoter Source #

QuasiQuoter for producing a static stencil defintion.

A definition like

    [stencil2|  0 1 0
                1 0 1
                0 1 0 |]
  

Is converted to:

    makeStencil2 (Z:.3:.3)
       (\ix -> case ix of
                 Z :. -1 :.  0  -> Just 1
                 Z :.  0 :. -1  -> Just 1
                 Z :.  0 :.  1  -> Just 1
                 Z :.  1 :.  0  -> Just 1
                 _              -> Nothing)
  

Stencil operators

type PC5 = P C (P (S D) (P (S D) (P (S D) (P (S D) X)))) Source #

mapStencil2 Source #

Arguments

:: Source r a 
=> Boundary a

How to handle the boundary of the array.

-> Stencil DIM2 a

Stencil to apply.

-> Array r DIM2 a

Array to apply stencil to.

-> Array PC5 DIM2 a 

Apply a stencil to every element of a 2D array.

forStencil2 :: Source r a => Boundary a -> Array r DIM2 a -> Stencil DIM2 a -> Array PC5 DIM2 a Source #

Like mapStencil2 but with the parameters flipped.