Copyright | (c) Alexey Kuleshevich 2018 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data D = D
- delay :: Source r ix e => Array r ix e -> Array D ix e
- data DI = DI
- toInterleaved :: Source r ix e => Array r ix e -> Array DI ix e
- fromInterleaved :: Array DI ix e -> Array D ix e
- data DW = DW
- data Window ix e = Window {
- windowStart :: !ix
- windowSize :: !ix
- windowIndex :: ix -> e
- getWindow :: Array DW ix e -> Maybe (Window ix e)
- makeWindowedArray :: Source r ix e => Array r ix e -> ix -> ix -> (ix -> e) -> Array DW ix e
Documentation
Delayed representation.
Instances
Show D Source # | |
(Index ix, Index (Lower ix), Elt D ix e ~ Array D (Lower ix) e) => Slice D ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
(Elt D ix e ~ Array D (Lower ix) e, Index ix) => InnerSlice D ix e Source # | |
(Elt D ix e ~ Array D (Lower ix) e, Index ix) => OuterSlice D ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
Index ix => Load D ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Internal loadS :: Monad m => Array D ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadP :: [Int] -> Array D ix e -> (Int -> IO e) -> (Int -> e -> IO ()) -> IO () Source # loadArrayWithStride :: Monad m => Int -> (m () -> m ()) -> Stride ix -> ix -> Array D ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadArray :: Monad m => Int -> (m () -> m ()) -> Array D ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # | |
Index ix => Source D ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
Index ix => Size D ix e Source # | |
Index ix => Construct D ix e Source # | |
Functor (Array D ix) Source # | |
Index ix => Applicative (Array D ix) Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
Index ix => Foldable (Array D ix) Source # | Row-major sequential folding over a Delayed array. |
Defined in Data.Massiv.Array.Delayed.Internal fold :: Monoid m => Array D ix m -> m # foldMap :: Monoid m => (a -> m) -> Array D ix a -> m # foldr :: (a -> b -> b) -> b -> Array D ix a -> b # foldr' :: (a -> b -> b) -> b -> Array D ix a -> b # foldl :: (b -> a -> b) -> b -> Array D ix a -> b # foldl' :: (b -> a -> b) -> b -> Array D ix a -> b # foldr1 :: (a -> a -> a) -> Array D ix a -> a # foldl1 :: (a -> a -> a) -> Array D ix a -> a # toList :: Array D ix a -> [a] # null :: Array D ix a -> Bool # length :: Array D ix a -> Int # elem :: Eq a => a -> Array D ix a -> Bool # maximum :: Ord a => Array D ix a -> a # minimum :: Ord a => Array D ix a -> a # | |
(Eq e, Index ix) => Eq (Array D ix e) Source # | |
(Index ix, Floating e) => Floating (Array D ix e) Source # | |
Defined in Data.Massiv.Array.Delayed.Internal exp :: Array D ix e -> Array D ix e # log :: Array D ix e -> Array D ix e # sqrt :: Array D ix e -> Array D ix e # (**) :: Array D ix e -> Array D ix e -> Array D ix e # logBase :: Array D ix e -> Array D ix e -> Array D ix e # sin :: Array D ix e -> Array D ix e # cos :: Array D ix e -> Array D ix e # tan :: Array D ix e -> Array D ix e # asin :: Array D ix e -> Array D ix e # acos :: Array D ix e -> Array D ix e # atan :: Array D ix e -> Array D ix e # sinh :: Array D ix e -> Array D ix e # cosh :: Array D ix e -> Array D ix e # tanh :: Array D ix e -> Array D ix e # asinh :: Array D ix e -> Array D ix e # acosh :: Array D ix e -> Array D ix e # atanh :: Array D ix e -> Array D ix e # log1p :: Array D ix e -> Array D ix e # expm1 :: Array D ix e -> Array D ix e # | |
(Index ix, Fractional e) => Fractional (Array D ix e) Source # | |
(Index ix, Num e) => Num (Array D ix e) Source # | |
Defined in Data.Massiv.Array.Delayed.Internal (+) :: Array D ix e -> Array D ix e -> Array D ix e # (-) :: Array D ix e -> Array D ix e -> Array D ix e # (*) :: Array D ix e -> Array D ix e -> Array D ix e # negate :: Array D ix e -> Array D ix e # abs :: Array D ix e -> Array D ix e # signum :: Array D ix e -> Array D ix e # fromInteger :: Integer -> Array D ix e # | |
(Ord e, Index ix) => Ord (Array D ix e) Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
data Array D ix e Source # | |
type EltRepr D ix Source # | |
Defined in Data.Massiv.Array.Delayed.Internal |
delay :: Source r ix e => Array r ix e -> Array D ix e Source #
O(1) Conversion from a source array to D
representation.
Delayed array that will be loaded in an interleaved fasion during parallel computation.
Instances
Index ix => Load DI ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Interleaved loadS :: Monad m => Array DI ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadP :: [Int] -> Array DI ix e -> (Int -> IO e) -> (Int -> e -> IO ()) -> IO () Source # loadArrayWithStride :: Monad m => Int -> (m () -> m ()) -> Stride ix -> ix -> Array DI ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadArray :: Monad m => Int -> (m () -> m ()) -> Array DI ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # | |
Index ix => Size DI ix e Source # | |
Index ix => Construct DI ix e Source # | |
Functor (Array DI ix) Source # | |
data Array DI ix e Source # | |
type EltRepr DI ix Source # | |
Defined in Data.Massiv.Array.Delayed.Interleaved |
toInterleaved :: Source r ix e => Array r ix e -> Array DI ix e Source #
Convert a source array into an array that, when computed, will have its elemets evaluated out of order (interleaved amoungs cores), hence making unbalanced computation better parallelizable.
fromInterleaved :: Array DI ix e -> Array D ix e Source #
O(1) - Unwrap the interleved array.
Since: massiv-0.2.1
Delayed Windowed Array representation.
Instances
(Index ix, Load DW (Lower ix) e) => Load DW ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Windowed loadS :: Monad m => Array DW ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadP :: [Int] -> Array DW ix e -> (Int -> IO e) -> (Int -> e -> IO ()) -> IO () Source # loadArrayWithStride :: Monad m => Int -> (m () -> m ()) -> Stride ix -> ix -> Array DW ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadArray :: Monad m => Int -> (m () -> m ()) -> Array DW ix e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # | |
Load DW Ix2T e Source # | |
Defined in Data.Massiv.Array.Delayed.Windowed loadS :: Monad m => Array DW Ix2T e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadP :: [Int] -> Array DW Ix2T e -> (Int -> IO e) -> (Int -> e -> IO ()) -> IO () Source # loadArrayWithStride :: Monad m => Int -> (m () -> m ()) -> Stride Ix2T -> Ix2T -> Array DW Ix2T e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadArray :: Monad m => Int -> (m () -> m ()) -> Array DW Ix2T e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # | |
Load DW Ix2 e Source # | |
Defined in Data.Massiv.Array.Delayed.Windowed loadS :: Monad m => Array DW Ix2 e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadP :: [Int] -> Array DW Ix2 e -> (Int -> IO e) -> (Int -> e -> IO ()) -> IO () Source # loadArrayWithStride :: Monad m => Int -> (m () -> m ()) -> Stride Ix2 -> Ix2 -> Array DW Ix2 e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadArray :: Monad m => Int -> (m () -> m ()) -> Array DW Ix2 e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # | |
Load DW Ix1 e Source # | |
Defined in Data.Massiv.Array.Delayed.Windowed loadS :: Monad m => Array DW Ix1 e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadP :: [Int] -> Array DW Ix1 e -> (Int -> IO e) -> (Int -> e -> IO ()) -> IO () Source # loadArrayWithStride :: Monad m => Int -> (m () -> m ()) -> Stride Ix1 -> Ix1 -> Array DW Ix1 e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # loadArray :: Monad m => Int -> (m () -> m ()) -> Array DW Ix1 e -> (Int -> m e) -> (Int -> e -> m ()) -> m () Source # | |
Index ix => Size DW ix e Source # | Any resize or extract on Windowed Array will loose the interior window and all other optimizations, thus hurting the performance a lot. |
Index ix => Construct DW ix e Source # | |
Functor (Array DW ix) Source # | |
(Show e, Ragged L ix e, Load DW ix e) => Show (Array DW ix e) Source # | |
data Array DW ix e Source # | |
type EltRepr DW ix Source # | |
Defined in Data.Massiv.Array.Delayed.Windowed |
Window | |
|
getWindow :: Array DW ix e -> Maybe (Window ix e) Source #
Get the Window
from the Windowed array.
Since: massiv-0.2.1
:: Source r ix e | |
=> Array r ix e | Source array that will have a window inserted into it |
-> ix | Start index for the window |
-> ix | Size of the window |
-> (ix -> e) | Inside window indexing function |
-> Array DW ix e |
Supply a separate generating function for interior of an array. This is very usful for stencil mapping, where interior function does not perform boundary checks, thus significantly speeding up computation process.
Since: massiv-0.1.3