massiv-0.2.1.0: Massiv (Массив) is an Array Library.

Copyright(c) Alexey Kuleshevich 2018
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Massiv.Array.Delayed

Description

 
Synopsis

Documentation

data D Source #

Delayed representation.

Constructors

D 
Instances
Show D Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

showsPrec :: Int -> D -> ShowS #

show :: D -> String #

showList :: [D] -> ShowS #

(Index ix, Index (Lower ix), Elt D ix e ~ Array D (Lower ix) e) => Slice D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

unsafeSlice :: Array D ix e -> ix -> ix -> Dim -> Maybe (Elt D ix e) Source #

(Elt D ix e ~ Array D (Lower ix) e, Index ix) => InnerSlice D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

unsafeInnerSlice :: Array D ix e -> (Lower ix, Int) -> Int -> Elt D ix e Source #

(Elt D ix e ~ Array D (Lower ix) e, Index ix) => OuterSlice D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

unsafeOuterSlice :: Array D ix e -> Int -> Elt D ix e Source #

outerLength :: Array D ix e -> Int Source #

Index ix => Load D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

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 # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

unsafeIndex :: Array D ix e -> ix -> e Source #

unsafeLinearIndex :: Array D ix e -> Int -> e Source #

Index ix => Size D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

size :: Array D ix e -> ix Source #

unsafeResize :: Index ix' => ix' -> Array D ix e -> Array D ix' e Source #

unsafeExtract :: ix -> ix -> Array D ix e -> Array (EltRepr D ix) ix e Source #

Index ix => Construct D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

getComp :: Array D ix e -> Comp Source #

setComp :: Comp -> Array D ix e -> Array D ix e Source #

unsafeMakeArray :: Comp -> ix -> (ix -> e) -> Array D ix e Source #

Functor (Array D ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

fmap :: (a -> b) -> Array D ix a -> Array D ix b #

(<$) :: a -> Array D ix b -> Array D ix a #

Index ix => Applicative (Array D ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

pure :: a -> Array D ix a #

(<*>) :: Array D ix (a -> b) -> Array D ix a -> Array D ix b #

liftA2 :: (a -> b -> c) -> Array D ix a -> Array D ix b -> Array D ix c #

(*>) :: Array D ix a -> Array D ix b -> Array D ix b #

(<*) :: Array D ix a -> Array D ix b -> Array D ix a #

Index ix => Foldable (Array D ix) Source #

Row-major sequential folding over a Delayed array.

Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

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 #

sum :: Num a => Array D ix a -> a #

product :: Num a => Array D ix a -> a #

(Eq e, Index ix) => Eq (Array D ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

(==) :: Array D ix e -> Array D ix e -> Bool #

(/=) :: Array D ix e -> Array D ix e -> Bool #

(Index ix, Floating e) => Floating (Array D ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

pi :: Array D ix e #

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 #

log1pexp :: Array D ix e -> Array D ix e #

log1mexp :: Array D ix e -> Array D ix e #

(Index ix, Fractional e) => Fractional (Array D ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

(/) :: Array D ix e -> Array D ix e -> Array D ix e #

recip :: Array D ix e -> Array D ix e #

fromRational :: Rational -> Array D ix e #

(Index ix, Num e) => Num (Array D ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

(+) :: 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 # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

Methods

compare :: Array D ix e -> Array D ix e -> Ordering #

(<) :: Array D ix e -> Array D ix e -> Bool #

(<=) :: Array D ix e -> Array D ix e -> Bool #

(>) :: Array D ix e -> Array D ix e -> Bool #

(>=) :: Array D ix e -> Array D ix e -> Bool #

max :: Array D ix e -> Array D ix e -> Array D ix e #

min :: Array D ix e -> Array D ix e -> Array D ix e #

data Array D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

data Array D ix e = DArray {}
type EltRepr D ix Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Internal

type EltRepr D ix = D

delay :: Source r ix e => Array r ix e -> Array D ix e Source #

O(1) Conversion from a source array to D representation.

data DI Source #

Delayed array that will be loaded in an interleaved fasion during parallel computation.

Constructors

DI 
Instances
Index ix => Load DI ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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 # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

size :: Array DI ix e -> ix Source #

unsafeResize :: Index ix' => ix' -> Array DI ix e -> Array DI ix' e Source #

unsafeExtract :: ix -> ix -> Array DI ix e -> Array (EltRepr DI ix) ix e Source #

Index ix => Construct DI ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

getComp :: Array DI ix e -> Comp Source #

setComp :: Comp -> Array DI ix e -> Array DI ix e Source #

unsafeMakeArray :: Comp -> ix -> (ix -> e) -> Array DI ix e Source #

Functor (Array DI ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

fmap :: (a -> b) -> Array DI ix a -> Array DI ix b #

(<$) :: a -> Array DI ix b -> Array DI ix a #

data Array DI ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

data Array DI ix e = DIArray {}
type EltRepr DI ix Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

type EltRepr DI ix = DI

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

data DW Source #

Delayed Windowed Array representation.

Constructors

DW 
Instances
(Index ix, Load DW (Lower ix) e) => Load DW ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

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 # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

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 # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

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 # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

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.

Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

size :: Array DW ix e -> ix Source #

unsafeResize :: Index ix' => ix' -> Array DW ix e -> Array DW ix' e Source #

unsafeExtract :: ix -> ix -> Array DW ix e -> Array (EltRepr DW ix) ix e Source #

Index ix => Construct DW ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

getComp :: Array DW ix e -> Comp Source #

setComp :: Comp -> Array DW ix e -> Array DW ix e Source #

unsafeMakeArray :: Comp -> ix -> (ix -> e) -> Array DW ix e Source #

Functor (Array DW ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

fmap :: (a -> b) -> Array DW ix a -> Array DW ix b #

(<$) :: a -> Array DW ix b -> Array DW ix a #

(Show e, Ragged L ix e, Load DW ix e) => Show (Array DW ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

showsPrec :: Int -> Array DW ix e -> ShowS #

show :: Array DW ix e -> String #

showList :: [Array DW ix e] -> ShowS #

data Array DW ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

data Array DW ix e = DWArray {}
type EltRepr DW ix Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type EltRepr DW ix = D

data Window ix e Source #

Constructors

Window 

Fields

Instances
Functor (Window ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

fmap :: (a -> b) -> Window ix a -> Window ix b #

(<$) :: a -> Window ix b -> Window ix a #

getWindow :: Array DW ix e -> Maybe (Window ix e) Source #

Get the Window from the Windowed array.

Since: massiv-0.2.1

makeWindowedArray Source #

Arguments

:: 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