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

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

Data.Massiv.Array.Delayed

Contents

Description

 
Synopsis

Delayed

Delayed Pull Array

data D Source #

Delayed representation.

Constructors

D 
Instances
Show D Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

Methods

showsPrec :: Int -> D -> ShowS #

show :: D -> String #

showList :: [D] -> ShowS #

Index ix => Resize D ix Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

Methods

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

Floating e => NumericFloat D e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

Methods

divideScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

divisionPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

recipPointwise :: Index ix => Array D ix e -> Array D ix e Source #

sqrtPointwise :: Index ix => Array D ix e -> Array D ix e Source #

Num e => Numeric D e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

Methods

plusScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

minusScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

multiplyScalar :: Index ix => Array D ix e -> e -> Array D ix e Source #

absPointwise :: Index ix => Array D ix e -> Array D ix e Source #

additionPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

subtractionPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

multiplicationPointwise :: Index ix => Array D ix e -> Array D ix e -> Array D ix e Source #

powerPointwise :: Index ix => Array D ix e -> Int -> Array D ix e Source #

unsafeLiftArray :: Index ix => (a -> e) -> Array D ix a -> Array D ix e Source #

unsafeLiftArray2 :: Index ix => (a -> b -> e) -> Array D ix a -> Array D ix b -> Array D ix e Source #

(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.Pull

Methods

unsafeSlice :: MonadThrow m => Array D ix e -> ix -> Sz ix -> Dim -> m (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.Pull

Methods

unsafeInnerSlice :: Array D ix e -> (Sz (Lower ix), Sz 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.Pull

Methods

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

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

Defined in Data.Massiv.Array.Delayed.Pull

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride ix -> Sz ix -> Array D ix e -> (Int -> e -> m ()) -> m () Source #

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

Defined in Data.Massiv.Array.Delayed.Pull

Associated Types

type R D :: Type Source #

Methods

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

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

loadArrayM :: Monad m => Scheduler m () -> Array D ix e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array D ix e -> Maybe e Source #

maxSize :: Array D ix e -> Maybe (Sz ix)

unsafeLoadIntoS :: (Mutable r' ix e, PrimMonad m) => MArray (PrimState m) r' ix e -> Array D ix e -> m (MArray (PrimState m) r' ix e)

unsafeLoadInto :: (Mutable r' ix e, MonadIO m) => MArray RealWorld r' ix e -> Array D ix e -> m (MArray RealWorld r' ix e)

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

Defined in Data.Massiv.Array.Delayed.Pull

Methods

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

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

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

Defined in Data.Massiv.Array.Delayed.Pull

Methods

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

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

Defined in Data.Massiv.Array.Delayed.Pull

Methods

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

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

makeArrayLinear :: Comp -> Sz ix -> (Int -> e) -> Array D ix e Source #

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

Defined in Data.Massiv.Array.Delayed.Pull

Methods

toStream :: Array D ix e -> Steps Id e Source #

Functor (Array D ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

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.Pull

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.Pull

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.Pull

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.Pull

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.Pull

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.Pull

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.Pull

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 #

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

Defined in Data.Massiv.Array.Delayed.Pull

Methods

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

show :: Array D ix e -> String #

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

type R D Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

type R D = D
data Array D ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Pull

data Array D ix e = DArray {}

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 Push Array

data DL Source #

Delayed load representation. Also known as Push array.

Constructors

DL 
Instances
Show DL Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Push

Methods

showsPrec :: Int -> DL -> ShowS #

show :: DL -> String #

showList :: [DL] -> ShowS #

Index ix => Resize DL ix Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Push

Methods

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

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

Defined in Data.Massiv.Array.Delayed.Push

Associated Types

type R DL :: Type Source #

Methods

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

size :: Array DL ix e -> Sz ix Source #

loadArrayM :: Monad m => Scheduler m () -> Array DL ix e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DL ix e -> Maybe e Source #

maxSize :: Array DL ix e -> Maybe (Sz ix)

unsafeLoadIntoS :: (Mutable r' ix e, PrimMonad m) => MArray (PrimState m) r' ix e -> Array DL ix e -> m (MArray (PrimState m) r' ix e)

unsafeLoadInto :: (Mutable r' ix e, MonadIO m) => MArray RealWorld r' ix e -> Array DL ix e -> m (MArray RealWorld r' ix e)

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

Defined in Data.Massiv.Array.Delayed.Push

Methods

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

makeArray :: Comp -> Sz ix -> (ix -> e) -> Array DL ix e Source #

makeArrayLinear :: Comp -> Sz ix -> (Int -> e) -> Array DL ix e Source #

Functor (Array DL ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Push

Methods

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

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

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

show :: Array DL ix e -> String #

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

Semigroup (Array DL Ix1 e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Push

Methods

(<>) :: Array DL Ix1 e -> Array DL Ix1 e -> Array DL Ix1 e #

sconcat :: NonEmpty (Array DL Ix1 e) -> Array DL Ix1 e #

stimes :: Integral b => b -> Array DL Ix1 e -> Array DL Ix1 e #

Monoid (Array DL Ix1 e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Push

Methods

mempty :: Array DL Ix1 e #

mappend :: Array DL Ix1 e -> Array DL Ix1 e -> Array DL Ix1 e #

mconcat :: [Array DL Ix1 e] -> Array DL Ix1 e #

type R DL Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Push

type R DL = DL
data Array DL ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Push

data Array DL ix e = DLArray {}

toLoadArray :: Load r ix e => Array r ix e -> Array DL ix e Source #

Convert any Loadable array into DL representation.

Since: 0.3.0

makeLoadArrayS Source #

Arguments

:: Index ix 
=> Sz ix

Size of the resulting array

-> e

Default value to use for all cells that might have been ommitted by the writing function

-> (forall m. Monad m => (ix -> e -> m Bool) -> m ())

Writing function that described which elements to write into the target array.

-> Array DL ix e 

Describe how an array should be loaded into memory sequentially. For parallelizable version see makeLoadArray.

Since: 0.3.1

makeLoadArray Source #

Arguments

:: Index ix 
=> Comp

Computation strategy to use. Directly affects the scheduler that gets created for the loading function.

-> Sz ix

Size of the resulting array

-> e

Default value to use for all cells that might have been ommitted by the writing function

-> (forall m. Monad m => Scheduler m () -> (ix -> e -> m Bool) -> m ())

Writing function that described which elements to write into the target array. It accepts a scheduler, that can be used for parallelization, as well as a safe element writing function.

-> Array DL ix e 

Specify how an array should be loaded into memory. Unlike makeLoadArrayS, loading function accepts a scheduler, thus can be parallelized. If you need an unsafe version of this function see unsafeMakeLoadArray.

Since: 0.4.0

fromStrideLoad :: StrideLoad r ix e => Stride ix -> Array r ix e -> Array DL ix e Source #

Convert an array that can be loaded with stride into DL representation.

Since: 0.3.0

Delayed Stream Array

data DS Source #

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

Constructors

DS 
Instances
Load DS Ix1 e Source #

O(n) - size implementation.

Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Associated Types

type R DS :: Type Source #

Methods

getComp :: Array DS Ix1 e -> Comp Source #

size :: Array DS Ix1 e -> Sz Ix1 Source #

loadArrayM :: Monad m => Scheduler m () -> Array DS Ix1 e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DS Ix1 e -> Maybe e Source #

maxSize :: Array DS Ix1 e -> Maybe (Sz Ix1)

unsafeLoadIntoS :: (Mutable r' Ix1 e, PrimMonad m) => MArray (PrimState m) r' Ix1 e -> Array DS Ix1 e -> m (MArray (PrimState m) r' Ix1 e)

unsafeLoadInto :: (Mutable r' Ix1 e, MonadIO m) => MArray RealWorld r' Ix1 e -> Array DS Ix1 e -> m (MArray RealWorld r' Ix1 e)

Extract DS Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

unsafeExtract :: Ix1 -> Sz Ix1 -> Array DS Ix1 e -> Array (R DS) Ix1 e Source #

Construct DS Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

setComp :: Comp -> Array DS Ix1 e -> Array DS Ix1 e Source #

makeArray :: Comp -> Sz Ix1 -> (Ix1 -> e) -> Array DS Ix1 e Source #

makeArrayLinear :: Comp -> Sz Ix1 -> (Int -> e) -> Array DS Ix1 e Source #

Stream DS Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

toStream :: Array DS Ix1 e -> Steps Id e Source #

Monad (Array DS Ix1) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

(>>=) :: Array DS Ix1 a -> (a -> Array DS Ix1 b) -> Array DS Ix1 b #

(>>) :: Array DS Ix1 a -> Array DS Ix1 b -> Array DS Ix1 b #

return :: a -> Array DS Ix1 a #

fail :: String -> Array DS Ix1 a #

Functor (Array DS Ix1) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

fmap :: (a -> b) -> Array DS Ix1 a -> Array DS Ix1 b #

(<$) :: a -> Array DS Ix1 b -> Array DS Ix1 a #

Applicative (Array DS Ix1) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

pure :: a -> Array DS Ix1 a #

(<*>) :: Array DS Ix1 (a -> b) -> Array DS Ix1 a -> Array DS Ix1 b #

liftA2 :: (a -> b -> c) -> Array DS Ix1 a -> Array DS Ix1 b -> Array DS Ix1 c #

(*>) :: Array DS Ix1 a -> Array DS Ix1 b -> Array DS Ix1 b #

(<*) :: Array DS Ix1 a -> Array DS Ix1 b -> Array DS Ix1 a #

Foldable (Array DS Ix1) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

fold :: Monoid m => Array DS Ix1 m -> m #

foldMap :: Monoid m => (a -> m) -> Array DS Ix1 a -> m #

foldr :: (a -> b -> b) -> b -> Array DS Ix1 a -> b #

foldr' :: (a -> b -> b) -> b -> Array DS Ix1 a -> b #

foldl :: (b -> a -> b) -> b -> Array DS Ix1 a -> b #

foldl' :: (b -> a -> b) -> b -> Array DS Ix1 a -> b #

foldr1 :: (a -> a -> a) -> Array DS Ix1 a -> a #

foldl1 :: (a -> a -> a) -> Array DS Ix1 a -> a #

toList :: Array DS Ix1 a -> [a] #

null :: Array DS Ix1 a -> Bool #

length :: Array DS Ix1 a -> Int #

elem :: Eq a => a -> Array DS Ix1 a -> Bool #

maximum :: Ord a => Array DS Ix1 a -> a #

minimum :: Ord a => Array DS Ix1 a -> a #

sum :: Num a => Array DS Ix1 a -> a #

product :: Num a => Array DS Ix1 a -> a #

IsList (Array DS Ix1 e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Associated Types

type Item (Array DS Ix1 e) :: Type #

Methods

fromList :: [Item (Array DS Ix1 e)] -> Array DS Ix1 e #

fromListN :: Int -> [Item (Array DS Ix1 e)] -> Array DS Ix1 e #

toList :: Array DS Ix1 e -> [Item (Array DS Ix1 e)] #

Show e => Show (Array DS Ix1 e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

showsPrec :: Int -> Array DS Ix1 e -> ShowS #

show :: Array DS Ix1 e -> String #

showList :: [Array DS Ix1 e] -> ShowS #

Semigroup (Array DS Ix1 e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

(<>) :: Array DS Ix1 e -> Array DS Ix1 e -> Array DS Ix1 e #

sconcat :: NonEmpty (Array DS Ix1 e) -> Array DS Ix1 e #

stimes :: Integral b => b -> Array DS Ix1 e -> Array DS Ix1 e #

Monoid (Array DS Ix1 e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

Methods

mempty :: Array DS Ix1 e #

mappend :: Array DS Ix1 e -> Array DS Ix1 e -> Array DS Ix1 e #

mconcat :: [Array DS Ix1 e] -> Array DS Ix1 e #

type R DS Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

type R DS = DS
newtype Array DS Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

newtype Array DS Ix1 e = DSArray {}
type Item (Array DS Ix1 e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Stream

type Item (Array DS Ix1 e) = e

toStreamArray :: Source r ix e => Array r ix e -> Array DS Ix1 e Source #

Flatten an array into a stream of values.

Since: 0.4.1

toSteps :: Array DS Ix1 e -> Steps Id e Source #

O(1) - Convert delayed stream arrray into Steps.

Since: 0.4.1

fromSteps :: Steps Id e -> Array DS Ix1 e Source #

O(1) - Convert Steps into delayed stream arrray

Since: 0.4.1

Delayed Interleaved Array

data DI Source #

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

Constructors

DI 
Instances
Index ix => Resize DI ix Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride ix -> Sz ix -> Array DI ix e -> (Int -> e -> m ()) -> m () Source #

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Associated Types

type R DI :: Type Source #

Methods

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

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

loadArrayM :: Monad m => Scheduler m () -> Array DI ix e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DI ix e -> Maybe e Source #

maxSize :: Array DI ix e -> Maybe (Sz ix)

unsafeLoadIntoS :: (Mutable r' ix e, PrimMonad m) => MArray (PrimState m) r' ix e -> Array DI ix e -> m (MArray (PrimState m) r' ix e)

unsafeLoadInto :: (Mutable r' ix e, MonadIO m) => MArray RealWorld r' ix e -> Array DI ix e -> m (MArray RealWorld r' ix e)

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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

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

makeArrayLinear :: Comp -> Sz ix -> (Int -> 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 #

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

pure :: a -> Array DI ix a #

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

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

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

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

Index ix => Foldable (Array DI ix) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

fold :: Monoid m => Array DI ix m -> m #

foldMap :: Monoid m => (a -> m) -> Array DI ix a -> m #

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

foldr' :: (a -> b -> b) -> b -> Array DI ix a -> b #

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

foldl' :: (b -> a -> b) -> b -> Array DI ix a -> b #

foldr1 :: (a -> a -> a) -> Array DI ix a -> a #

foldl1 :: (a -> a -> a) -> Array DI ix a -> a #

toList :: Array DI ix a -> [a] #

null :: Array DI ix a -> Bool #

length :: Array DI ix a -> Int #

elem :: Eq a => a -> Array DI ix a -> Bool #

maximum :: Ord a => Array DI ix a -> a #

minimum :: Ord a => Array DI ix a -> a #

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

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

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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

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

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

pi :: Array DI ix e #

exp :: Array DI ix e -> Array DI ix e #

log :: Array DI ix e -> Array DI ix e #

sqrt :: Array DI ix e -> Array DI ix e #

(**) :: Array DI ix e -> Array DI ix e -> Array DI ix e #

logBase :: Array DI ix e -> Array DI ix e -> Array DI ix e #

sin :: Array DI ix e -> Array DI ix e #

cos :: Array DI ix e -> Array DI ix e #

tan :: Array DI ix e -> Array DI ix e #

asin :: Array DI ix e -> Array DI ix e #

acos :: Array DI ix e -> Array DI ix e #

atan :: Array DI ix e -> Array DI ix e #

sinh :: Array DI ix e -> Array DI ix e #

cosh :: Array DI ix e -> Array DI ix e #

tanh :: Array DI ix e -> Array DI ix e #

asinh :: Array DI ix e -> Array DI ix e #

acosh :: Array DI ix e -> Array DI ix e #

atanh :: Array DI ix e -> Array DI ix e #

log1p :: Array DI ix e -> Array DI ix e #

expm1 :: Array DI ix e -> Array DI ix e #

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

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

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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

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

fromRational :: Rational -> Array DI ix e #

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

(+) :: Array DI ix e -> Array DI ix e -> Array DI ix e #

(-) :: Array DI ix e -> Array DI ix e -> Array DI ix e #

(*) :: Array DI ix e -> Array DI ix e -> Array DI ix e #

negate :: Array DI ix e -> Array DI ix e #

abs :: Array DI ix e -> Array DI ix e #

signum :: Array DI ix e -> Array DI ix e #

fromInteger :: Integer -> Array DI ix e #

(Index ix, Ord e) => Ord (Array DI ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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

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

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

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

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

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

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

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

Defined in Data.Massiv.Array.Delayed.Interleaved

Methods

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

show :: Array DI ix e -> String #

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

type R DI Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

type R DI = DI
newtype Array DI ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Interleaved

newtype Array DI ix e = DIArray {}

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 amongst cores), hence making unbalanced computation better parallelizable.

fromInterleaved :: Array DI ix e -> Array D ix e Source #

O(1) - Unwrap the interleved array.

Since: 0.2.1

Delayed Windowed Array

data DW Source #

Delayed Windowed Array representation.

Constructors

DW 
Instances
StrideLoad DW Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride Ix1 -> Sz Ix1 -> Array DW Ix1 e -> (Int -> e -> m ()) -> m () Source #

StrideLoad DW Ix2 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride Ix2 -> Sz Ix2 -> Array DW Ix2 e -> (Int -> e -> m ()) -> m () Source #

StrideLoad DW Ix5T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride Ix5T -> Sz Ix5T -> Array DW Ix5T e -> (Int -> e -> m ()) -> m () Source #

StrideLoad DW Ix4T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride Ix4T -> Sz Ix4T -> Array DW Ix4T e -> (Int -> e -> m ()) -> m () Source #

StrideLoad DW Ix3T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride Ix3T -> Sz Ix3T -> Array DW Ix3T e -> (Int -> e -> m ()) -> m () Source #

StrideLoad DW Ix2T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride Ix2T -> Sz Ix2T -> Array DW Ix2T e -> (Int -> e -> m ()) -> m () Source #

Load DW Ix1 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Associated Types

type R DW :: Type Source #

Methods

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

size :: Array DW Ix1 e -> Sz Ix1 Source #

loadArrayM :: Monad m => Scheduler m () -> Array DW Ix1 e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DW Ix1 e -> Maybe e Source #

maxSize :: Array DW Ix1 e -> Maybe (Sz Ix1)

unsafeLoadIntoS :: (Mutable r' Ix1 e, PrimMonad m) => MArray (PrimState m) r' Ix1 e -> Array DW Ix1 e -> m (MArray (PrimState m) r' Ix1 e)

unsafeLoadInto :: (Mutable r' Ix1 e, MonadIO m) => MArray RealWorld r' Ix1 e -> Array DW Ix1 e -> m (MArray RealWorld r' Ix1 e)

Load DW Ix2 e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Associated Types

type R DW :: Type Source #

Methods

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

size :: Array DW Ix2 e -> Sz Ix2 Source #

loadArrayM :: Monad m => Scheduler m () -> Array DW Ix2 e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DW Ix2 e -> Maybe e Source #

maxSize :: Array DW Ix2 e -> Maybe (Sz Ix2)

unsafeLoadIntoS :: (Mutable r' Ix2 e, PrimMonad m) => MArray (PrimState m) r' Ix2 e -> Array DW Ix2 e -> m (MArray (PrimState m) r' Ix2 e)

unsafeLoadInto :: (Mutable r' Ix2 e, MonadIO m) => MArray RealWorld r' Ix2 e -> Array DW Ix2 e -> m (MArray RealWorld r' Ix2 e)

Load DW Ix5T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Associated Types

type R DW :: Type Source #

Methods

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

size :: Array DW Ix5T e -> Sz Ix5T Source #

loadArrayM :: Monad m => Scheduler m () -> Array DW Ix5T e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DW Ix5T e -> Maybe e Source #

maxSize :: Array DW Ix5T e -> Maybe (Sz Ix5T)

unsafeLoadIntoS :: (Mutable r' Ix5T e, PrimMonad m) => MArray (PrimState m) r' Ix5T e -> Array DW Ix5T e -> m (MArray (PrimState m) r' Ix5T e)

unsafeLoadInto :: (Mutable r' Ix5T e, MonadIO m) => MArray RealWorld r' Ix5T e -> Array DW Ix5T e -> m (MArray RealWorld r' Ix5T e)

Load DW Ix4T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Associated Types

type R DW :: Type Source #

Methods

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

size :: Array DW Ix4T e -> Sz Ix4T Source #

loadArrayM :: Monad m => Scheduler m () -> Array DW Ix4T e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DW Ix4T e -> Maybe e Source #

maxSize :: Array DW Ix4T e -> Maybe (Sz Ix4T)

unsafeLoadIntoS :: (Mutable r' Ix4T e, PrimMonad m) => MArray (PrimState m) r' Ix4T e -> Array DW Ix4T e -> m (MArray (PrimState m) r' Ix4T e)

unsafeLoadInto :: (Mutable r' Ix4T e, MonadIO m) => MArray RealWorld r' Ix4T e -> Array DW Ix4T e -> m (MArray RealWorld r' Ix4T e)

Load DW Ix3T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Associated Types

type R DW :: Type Source #

Methods

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

size :: Array DW Ix3T e -> Sz Ix3T Source #

loadArrayM :: Monad m => Scheduler m () -> Array DW Ix3T e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DW Ix3T e -> Maybe e Source #

maxSize :: Array DW Ix3T e -> Maybe (Sz Ix3T)

unsafeLoadIntoS :: (Mutable r' Ix3T e, PrimMonad m) => MArray (PrimState m) r' Ix3T e -> Array DW Ix3T e -> m (MArray (PrimState m) r' Ix3T e)

unsafeLoadInto :: (Mutable r' Ix3T e, MonadIO m) => MArray RealWorld r' Ix3T e -> Array DW Ix3T e -> m (MArray RealWorld r' Ix3T e)

Load DW Ix2T e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Associated Types

type R DW :: Type Source #

Methods

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

size :: Array DW Ix2T e -> Sz Ix2T Source #

loadArrayM :: Monad m => Scheduler m () -> Array DW Ix2T e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DW Ix2T e -> Maybe e Source #

maxSize :: Array DW Ix2T e -> Maybe (Sz Ix2T)

unsafeLoadIntoS :: (Mutable r' Ix2T e, PrimMonad m) => MArray (PrimState m) r' Ix2T e -> Array DW Ix2T e -> m (MArray (PrimState m) r' Ix2T e)

unsafeLoadInto :: (Mutable r' Ix2T e, MonadIO m) => MArray RealWorld r' Ix2T e -> Array DW Ix2T e -> m (MArray RealWorld r' Ix2T e)

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

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

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

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

makeArrayLinear :: Comp -> Sz ix -> (Int -> e) -> Array DW ix e Source #

(Index (IxN n), StrideLoad DW (Ix (n - 1)) e) => StrideLoad DW (IxN n) e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Methods

loadArrayWithStrideM :: Monad m => Scheduler m () -> Stride (IxN n) -> Sz (IxN n) -> Array DW (IxN n) e -> (Int -> e -> m ()) -> m () Source #

(Index (IxN n), Load DW (Ix (n - 1)) e) => Load DW (IxN n) e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

Associated Types

type R DW :: Type Source #

Methods

getComp :: Array DW (IxN n) e -> Comp Source #

size :: Array DW (IxN n) e -> Sz (IxN n) Source #

loadArrayM :: Monad m => Scheduler m () -> Array DW (IxN n) e -> (Int -> e -> m ()) -> m () Source #

defaultElement :: Array DW (IxN n) e -> Maybe e Source #

maxSize :: Array DW (IxN n) e -> Maybe (Sz (IxN n))

unsafeLoadIntoS :: (Mutable r' (IxN n) e, PrimMonad m) => MArray (PrimState m) r' (IxN n) e -> Array DW (IxN n) e -> m (MArray (PrimState m) r' (IxN n) e)

unsafeLoadInto :: (Mutable r' (IxN n) e, MonadIO m) => MArray RealWorld r' (IxN n) e -> Array DW (IxN n) e -> m (MArray RealWorld r' (IxN n) e)

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 #

(Ragged L ix e, Load DW ix e, Show 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 #

type R DW Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type R DW = DW
type R DW Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type R DW = DW
type R DW Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type R DW = DW
type R DW Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type R DW = DW
type R DW Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type R DW = DW
type R DW Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type R DW = DW
type R DW Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

type R DW = DW
data Array DW ix e Source # 
Instance details

Defined in Data.Massiv.Array.Delayed.Windowed

data Array DW ix e = DWArray {}

data Window ix e Source #

Constructors

Window 

Fields

  • windowStart :: !ix

    Index of where window will start at.

  • windowSize :: !(Sz ix)

    Size of the window

  • windowIndex :: ix -> e

    Indexing function for the window

  • windowUnrollIx2 :: !(Maybe Int)

    Setting this value during stencil application improves cache utilization by unrolling the loop for Ix2 and higher dimensions. Has no affect on arrays with one dimension.

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 #

insertWindow Source #

Arguments

:: Source D ix e 
=> Array D ix e

Source array that will have a window inserted into it

-> Window ix e

Window to place inside the delayed array

-> Array DW ix e 

Inserts a Window into a delayed array while scaling the window down if it doesn't fit inside that array.

Since: 0.3.0

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

Get the Window from a windowed array.

Since: 0.2.1

dropWindow :: Array DW ix e -> Array D ix e Source #

Drop the Window from a windowed array.

Since: 0.3.0

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

-> Sz ix

Size of the window

-> (ix -> e)

Indexing function foto use inside window

-> Array DW ix e 

Construct a delayed windowed array by supply a separate element producing function for the 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: 0.1.3