| Copyright | (c) Alexey Kuleshevich 2018-2019 |
|---|---|
| License | BSD3 |
| Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Massiv.Array.Stencil.Unsafe
Contents
Description
Synopsis
- makeUnsafeStencil :: Index ix => Sz ix -> ix -> (ix -> (ix -> e) -> a) -> Stencil ix e a
- mapStencilUnsafe :: Manifest r ix e => Border e -> Sz ix -> ix -> ((ix -> e) -> a) -> Array r ix e -> Array DW ix a
- forStencilUnsafe :: (Source r ix e, Manifest r ix e) => Array r ix e -> Sz ix -> ix -> ((ix -> Maybe e) -> a) -> Array DW ix a
Stencil
Arguments
| :: Index ix | |
| => Sz ix | Size of the stencil |
| -> ix | Center of the stencil |
| -> (ix -> (ix -> e) -> a) | Stencil function. |
| -> Stencil ix e a |
Similar to makeStencil, but there are no guarantees that the
stencil will not read out of bounds memory. This stencil is also a bit more powerful in sense it
gets an extra peice of information, namely the exact index for the element it is constructing.
Since: 0.3.0
mapStencilUnsafe :: Manifest r ix e => Border e -> Sz ix -> ix -> ((ix -> e) -> a) -> Array r ix e -> Array DW ix a Source #
This is an unsafe version of mapStencil, that does no
stencil validation. There is no performance difference between the two, but the unsafe
version has an advantage of not requiring to deal with Value wrapper.
Since: 0.4.3
Arguments
| :: (Source r ix e, Manifest r ix e) | |
| => Array r ix e | |
| -> Sz ix | Size of the stencil |
| -> ix | Center of the stencil |
| -> ((ix -> Maybe e) -> a) | Stencil function that receives a "get" function as it's argument that can retrieve values of cells in the source array with respect to the center of the stencil. Stencil function must return a value that will be assigned to the cell in the result array. Offset supplied to the "get" function cannot go outside the boundaries of the stencil. |
| -> Array DW ix a |
Just as mapStencilUnsafe this is an unsafe version of the stencil
mapping. Arguments are in slightly different order and the indexing function returns
Nothing for elements outside the border.
Since: 0.1.7