| Safe Haskell | None |
|---|
Data.Yarr.Shape
- type Fill sh a = (sh -> IO a) -> (sh -> a -> IO ()) -> sh -> sh -> IO ()
- type Block sh = (sh, sh)
- class (Eq sh, Bounded sh, Show sh, NFData sh) => Shape sh where
- zero :: sh
- size :: sh -> Int
- plus :: sh -> sh -> sh
- minus :: sh -> sh -> sh
- offset :: sh -> sh -> sh
- fromLinear :: sh -> Int -> sh
- toLinear :: sh -> sh -> Int
- intersect :: (Arity n, n ~ S n0) => VecList n sh -> sh
- complement :: (Arity n, n ~ S n0) => VecList n sh -> sh
- intersectBlocks :: (Arity n, n ~ S n0) => VecList n (Block sh) -> Block sh
- blockSize :: Block sh -> Int
- insideBlock :: Block sh -> sh -> Bool
- makeChunkRange :: Int -> sh -> sh -> Int -> Block sh
- foldl :: (b -> sh -> a -> IO b) -> b -> (sh -> IO a) -> sh -> sh -> IO b
- unrolledFoldl :: forall a b uf. Arity uf => uf -> (a -> IO ()) -> (b -> sh -> a -> IO b) -> b -> (sh -> IO a) -> sh -> sh -> IO b
- foldr :: (sh -> a -> b -> IO b) -> b -> (sh -> IO a) -> sh -> sh -> IO b
- unrolledFoldr :: forall a b uf. Arity uf => uf -> (a -> IO ()) -> (sh -> a -> b -> IO b) -> b -> (sh -> IO a) -> sh -> sh -> IO b
- fill :: Fill sh a
- unrolledFill :: forall a uf. Arity uf => uf -> (a -> IO ()) -> Fill sh a
- class (Shape sh, Arity (BorderCount sh)) => BlockShape sh where
- type BorderCount sh
- clipBlock :: Block sh -> Block sh -> VecList (BorderCount sh) (Block sh)
- type Dim1 = Int
- type Dim2 = (Int, Int)
- dim2BlockFill :: forall a bsx bsy. (Arity bsx, Arity bsy) => bsx -> bsy -> (a -> IO ()) -> Fill Dim2 a
- type Dim3 = (Int, Int, Int)
Documentation
Alias to frequently used get-write-from-to arguments combo.
Passed as 1st parameter of all Loading functions
from Data.Yarr.Eval module.
type Block sh = (sh, sh)Source
Mainly for internal use. Abstracts top-left -- bottom-right pair of indices.
class (Eq sh, Bounded sh, Show sh, NFData sh) => Shape sh whereSource
Class for column-major, regular composite array indices.
Methods
0, (0, 0), (0, 0, 0)
(1, 2, 3) `plus` (0, 0, 1) == (1, 2, 4)
(1, 2) `minus` (1, 0) == (0, 2)
offset :: sh -> sh -> shSource
Arguments
| :: sh | Extent of array |
| -> Int | Linear index |
| -> sh | Shape index |
Converts linear, memory index of shaped array to shape index without bound checks.
fromLinear (3, 4) 5 == (1, 1)
Arguments
| :: sh | Extent of array |
| -> sh | Shape index |
| -> Int | Linear index |
Opposite to fromLinear, converts composite array index
to linear, "memory" index without bounds checks.
toLinear (5, 5) (3, 0) == 15
Arguments
| :: (Arity n, n ~ S n0) | |
| => VecList n sh | Several array extents |
| -> sh | Maximum common shape index |
Component-wise minimum, returns maximum legal index for all given array extents
complement :: (Arity n, n ~ S n0) => VecList n sh -> shSource
Component-wise maximum, used in Data.Yarr.Convolution implementation.
intersectBlocks :: (Arity n, n ~ S n0) => VecList n (Block sh) -> Block shSource
blockSize :: Block sh -> IntSource
insideBlock :: Block sh -> sh -> BoolSource
makeChunkRange :: Int -> sh -> sh -> Int -> Block shSource
Arguments
| :: (b -> sh -> a -> IO b) | Generalized reduce |
| -> b | Zero |
| -> (sh -> IO a) | Get |
| -> sh | Start |
| -> sh | End |
| -> IO b | Result |
Following 6 functions shouldn't be called directly,
they are intented to be passed as first argument
to Load and not currently existring
Fold functions.
Arguments
| :: forall a b uf . Arity uf | |
| => uf | Unroll factor |
| -> (a -> IO ()) | |
| -> (b -> sh -> a -> IO b) | Generalized reduce |
| -> b | Zero |
| -> (sh -> IO a) | Get |
| -> sh | Start |
| -> sh | End |
| -> IO b | Result |
Arguments
| :: (sh -> a -> b -> IO b) | Generalized reduce |
| -> b | Zero |
| -> (sh -> IO a) | Get |
| -> sh | Start |
| -> sh | End |
| -> IO b | Result |
Arguments
| :: forall a b uf . Arity uf | |
| => uf | Unroll factor |
| -> (a -> IO ()) | |
| -> (sh -> a -> b -> IO b) | Generalized reduce |
| -> b | Zero |
| -> (sh -> IO a) | Get |
| -> sh | Start |
| -> sh | End |
| -> IO b | Result |
Standard fill without unrolling.
To avoid premature optimization just type fill
each time you want to Load array
to manifest representation.
class (Shape sh, Arity (BorderCount sh)) => BlockShape sh whereSource
Associated Types
type BorderCount sh Source
Methods
Arguments
| :: Block sh | Outer block |
| -> Block sh | Inner block |
| -> VecList (BorderCount sh) (Block sh) | Shavings |
Instances