massiv-1.0.0.0: Massiv (Массив) is an Array Library.
Copyright(c) Alexey Kuleshevich 2018-2021
LicenseBSD3
MaintainerAlexey Kuleshevich <lehins@yandex.ru>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Massiv.Array.Manifest

Description

 
Synopsis

Manifest

class Source r e => Manifest r e Source #

Manifest arrays are backed by actual memory and values are looked up versus computed as it is with delayed arrays. Because manifest arrays are located in memory their contents can be mutated once thawed into MArray. The process of changed a mutable MArray back into an immutable Array is called freezing.

Instances

Instances details
Unbox e => Manifest U e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Unboxed

Methods

unsafeLinearIndexM :: Index ix => Array U ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s U ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s U ix e -> MArray s U ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s U ix e -> MVector s U e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array U ix e -> m (MArray (PrimState m) U ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) U ix e -> m (Array U ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) U ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) U ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) U ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) U ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) U ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) U ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) U ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) U ix' e -> Ix1 -> MArray (PrimState m) U ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array U ix' e -> Ix1 -> MArray (PrimState m) U ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) U ix e -> Sz ix -> m (MArray (PrimState m) U ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) U ix e -> Sz ix -> m (MArray (PrimState m) U ix e) Source #

Storable e => Manifest S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeLinearIndexM :: Index ix => Array S ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s S ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s S ix e -> MArray s S ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s S ix e -> MVector s S e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array S ix e -> m (MArray (PrimState m) S ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) S ix e -> m (Array S ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) S ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) S ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) S ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) S ix' e -> Ix1 -> MArray (PrimState m) S ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array S ix' e -> Ix1 -> MArray (PrimState m) S ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Sz ix -> m (MArray (PrimState m) S ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Sz ix -> m (MArray (PrimState m) S ix e) Source #

Prim e => Manifest P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeLinearIndexM :: Index ix => Array P ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s P ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s P ix e -> MArray s P ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s P ix e -> MVector s P e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array P ix e -> m (MArray (PrimState m) P ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) P ix e -> m (Array P ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) P ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) P ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) P ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) P ix' e -> Ix1 -> MArray (PrimState m) P ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array P ix' e -> Ix1 -> MArray (PrimState m) P ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Sz ix -> m (MArray (PrimState m) P ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Sz ix -> m (MArray (PrimState m) P ix e) Source #

NFData e => Manifest BN e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Index ix => Array BN ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s BN ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s BN ix e -> MArray s BN ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s BN ix e -> MVector s BN e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array BN ix e -> m (MArray (PrimState m) BN ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) BN ix e -> m (Array BN ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) BN ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) BN ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) BN ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) BN ix' e -> Ix1 -> MArray (PrimState m) BN ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array BN ix' e -> Ix1 -> MArray (PrimState m) BN ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Sz ix -> m (MArray (PrimState m) BN ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Sz ix -> m (MArray (PrimState m) BN ix e) Source #

Manifest B e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Index ix => Array B ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s B ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s B ix e -> MArray s B ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s B ix e -> MVector s B e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array B ix e -> m (MArray (PrimState m) B ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) B ix e -> m (Array B ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) B ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) B ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) B ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) B ix' e -> Ix1 -> MArray (PrimState m) B ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array B ix' e -> Ix1 -> MArray (PrimState m) B ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Sz ix -> m (MArray (PrimState m) B ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Sz ix -> m (MArray (PrimState m) B ix e) Source #

Manifest BL e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Index ix => Array BL ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s BL ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s BL ix e -> MArray s BL ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s BL ix e -> MVector s BL e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array BL ix e -> m (MArray (PrimState m) BL ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) BL ix e -> m (Array BL ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) BL ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) BL ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) BL ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) BL ix' e -> Ix1 -> MArray (PrimState m) BL ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array BL ix' e -> Ix1 -> MArray (PrimState m) BL ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Sz ix -> m (MArray (PrimState m) BL ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Sz ix -> m (MArray (PrimState m) BL ix e) Source #

Boxed

data B Source #

Array representation for Boxed elements. This structure is element and spine strict, but elements are strict to Weak Head Normal Form (WHNF) only.

Constructors

B 

Instances

Instances details
Show B Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

showsPrec :: Int -> B -> ShowS #

show :: B -> String #

showList :: [B] -> ShowS #

Size B Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

unsafeResize :: (Index ix, Index ix') => Sz ix' -> Array B ix e -> Array B ix' e Source #

Strategy B Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

Manifest B e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Index ix => Array B ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s B ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s B ix e -> MArray s B ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s B ix e -> MVector s B e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array B ix e -> m (MArray (PrimState m) B ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) B ix e -> m (Array B ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) B ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) B ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) B ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) B ix' e -> Ix1 -> MArray (PrimState m) B ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array B ix' e -> Ix1 -> MArray (PrimState m) B ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Sz ix -> m (MArray (PrimState m) B ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) B ix e -> Sz ix -> m (MArray (PrimState m) B ix e) Source #

Source B e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeIndex :: Index ix => Array B ix e -> ix -> e Source #

unsafeLinearIndex :: Index ix => Array B ix e -> Int -> e Source #

unsafeOuterSlice :: (Index ix, Index (Lower ix)) => Array B ix e -> Sz (Lower ix) -> Int -> Array B (Lower ix) e Source #

unsafeLinearSlice :: Index ix => Ix1 -> Sz1 -> Array B ix e -> Array B Ix1 e Source #

Index ix => Shape B ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Num e => Numeric B e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

scalarMinus :: Index ix => e -> Array B ix e -> Array B ix e Source #

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

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

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

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

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

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

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

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array B ix e -> Array B ix e -> Array B ix e Source #

Num e => FoldNumeric B e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

sumArray :: Index ix => Array B ix e -> e Source #

productArray :: Index ix => Array B ix e -> e Source #

powerSumArray :: Index ix => Array B ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array B ix e -> Array B ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array B ix e -> e Source #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

iterArrayLinearWithStrideST_ :: Scheduler s () -> Stride ix -> Sz ix -> Array B ix e -> (Int -> e -> ST s ()) -> ST s () Source #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

replicate :: Comp -> Sz ix -> e -> Array B ix e Source #

iterArrayLinearST_ :: Scheduler s () -> Array B ix e -> (Int -> e -> ST s ()) -> ST s () Source #

iterArrayLinearWithSetST_ :: Scheduler s () -> Array B ix e -> (Ix1 -> e -> ST s ()) -> (Ix1 -> Sz1 -> e -> ST s ()) -> ST s () Source #

unsafeLoadIntoST :: Manifest r' e => MVector s r' e -> Array B ix e -> ST s (MArray s r' ix e) Source #

unsafeLoadIntoIO :: Manifest r' e => MVector RealWorld r' e -> Array B ix e -> IO (MArray RealWorld r' ix e) Source #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

toStreamIx :: Array B ix e -> Steps Id (ix, e) Source #

Index ix => Functor (Array B ix) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

Row-major sequential folding over a Boxed array.

Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

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

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

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

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

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

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

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

null :: Array B ix a -> Bool #

length :: Array B ix a -> Int #

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

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

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

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

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

Index ix => Traversable (Array B ix) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

traverse :: Applicative f => (a -> f b) -> Array B ix a -> f (Array B ix b) #

sequenceA :: Applicative f => Array B ix (f a) -> f (Array B ix a) #

mapM :: Monad m => (a -> m b) -> Array B ix a -> m (Array B ix b) #

sequence :: Monad m => Array B ix (m a) -> m (Array B ix a) #

(IsList (Array L ix e), Ragged L ix e) => IsList (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Associated Types

type Item (Array B ix e) #

Methods

fromList :: [Item (Array B ix e)] -> Array B ix e #

fromListN :: Int -> [Item (Array B ix e)] -> Array B ix e #

toList :: Array B ix e -> [Item (Array B ix e)] #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

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

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

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

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

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

show :: Array B ix e -> String #

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

(Index ix, NFData e) => NFData (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

rnf :: Array B ix e -> () #

newtype Array B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

newtype Array B ix e = BArray (Array BL ix e)
newtype MArray s B ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

newtype MArray s B ix e = MBArray (MArray s BL ix e)
type Item (Array B ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

type Item (Array B ix e) = Item (Array L ix e)

data BL Source #

Array representation for Boxed elements. This data structure is lazy with respect to its elements, but is strict with respect to the spine.

Constructors

BL 

Instances

Instances details
Show BL Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

showsPrec :: Int -> BL -> ShowS #

show :: BL -> String #

showList :: [BL] -> ShowS #

Size BL Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

unsafeResize :: (Index ix, Index ix') => Sz ix' -> Array BL ix e -> Array BL ix' e Source #

Strategy BL Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

Manifest BL e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Index ix => Array BL ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s BL ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s BL ix e -> MArray s BL ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s BL ix e -> MVector s BL e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array BL ix e -> m (MArray (PrimState m) BL ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) BL ix e -> m (Array BL ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) BL ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) BL ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) BL ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) BL ix' e -> Ix1 -> MArray (PrimState m) BL ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array BL ix' e -> Ix1 -> MArray (PrimState m) BL ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Sz ix -> m (MArray (PrimState m) BL ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) BL ix e -> Sz ix -> m (MArray (PrimState m) BL ix e) Source #

Source BL e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeIndex :: Index ix => Array BL ix e -> ix -> e Source #

unsafeLinearIndex :: Index ix => Array BL ix e -> Int -> e Source #

unsafeOuterSlice :: (Index ix, Index (Lower ix)) => Array BL ix e -> Sz (Lower ix) -> Int -> Array BL (Lower ix) e Source #

unsafeLinearSlice :: Index ix => Ix1 -> Sz1 -> Array BL ix e -> Array BL Ix1 e Source #

Index ix => Shape BL ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Num e => Numeric BL e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

scalarMinus :: Index ix => e -> Array BL ix e -> Array BL ix e Source #

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

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

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

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

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

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

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

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array BL ix e -> Array BL ix e -> Array BL ix e Source #

Num e => FoldNumeric BL e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

sumArray :: Index ix => Array BL ix e -> e Source #

productArray :: Index ix => Array BL ix e -> e Source #

powerSumArray :: Index ix => Array BL ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array BL ix e -> Array BL ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array BL ix e -> e Source #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

iterArrayLinearWithStrideST_ :: Scheduler s () -> Stride ix -> Sz ix -> Array BL ix e -> (Int -> e -> ST s ()) -> ST s () Source #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

replicate :: Comp -> Sz ix -> e -> Array BL ix e Source #

iterArrayLinearST_ :: Scheduler s () -> Array BL ix e -> (Int -> e -> ST s ()) -> ST s () Source #

iterArrayLinearWithSetST_ :: Scheduler s () -> Array BL ix e -> (Ix1 -> e -> ST s ()) -> (Ix1 -> Sz1 -> e -> ST s ()) -> ST s () Source #

unsafeLoadIntoST :: Manifest r' e => MVector s r' e -> Array BL ix e -> ST s (MArray s r' ix e) Source #

unsafeLoadIntoIO :: Manifest r' e => MVector RealWorld r' e -> Array BL ix e -> IO (MArray RealWorld r' ix e) Source #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

toStreamIx :: Array BL ix e -> Steps Id (ix, e) Source #

Index ix => Functor (Array BL ix) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

Row-major sequential folding over a Boxed array.

Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

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

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

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

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

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

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

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

null :: Array BL ix a -> Bool #

length :: Array BL ix a -> Int #

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

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

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

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

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

Index ix => Traversable (Array BL ix) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

traverse :: Applicative f => (a -> f b) -> Array BL ix a -> f (Array BL ix b) #

sequenceA :: Applicative f => Array BL ix (f a) -> f (Array BL ix a) #

mapM :: Monad m => (a -> m b) -> Array BL ix a -> m (Array BL ix b) #

sequence :: Monad m => Array BL ix (m a) -> m (Array BL ix a) #

(IsList (Array L ix e), Ragged L ix e) => IsList (Array BL ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Associated Types

type Item (Array BL ix e) #

Methods

fromList :: [Item (Array BL ix e)] -> Array BL ix e #

fromListN :: Int -> [Item (Array BL ix e)] -> Array BL ix e #

toList :: Array BL ix e -> [Item (Array BL ix e)] #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

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

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

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

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

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

show :: Array BL ix e -> String #

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

(Index ix, NFData e) => NFData (Array BL ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

rnf :: Array BL ix e -> () #

data Array BL ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

data Array BL ix e = BLArray {}
data MArray s BL ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

data MArray s BL ix e = MBLArray !(Sz ix) !Int !(MutableArray s e)
type Item (Array BL ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

type Item (Array BL ix e) = Item (Array L ix e)

data BN Source #

Array representation for Boxed elements. This structure is element and spine strict, and elements are always in Normal Form (NF), therefore NFData instance is required.

Constructors

BN 

Instances

Instances details
Show BN Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

showsPrec :: Int -> BN -> ShowS #

show :: BN -> String #

showList :: [BN] -> ShowS #

Size BN Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

unsafeResize :: (Index ix, Index ix') => Sz ix' -> Array BN ix e -> Array BN ix' e Source #

Strategy N Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

NFData e => Manifest BN e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeLinearIndexM :: Index ix => Array BN ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s BN ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s BN ix e -> MArray s BN ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s BN ix e -> MVector s BN e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array BN ix e -> m (MArray (PrimState m) BN ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) BN ix e -> m (Array BN ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) BN ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) BN ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) BN ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) BN ix' e -> Ix1 -> MArray (PrimState m) BN ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array BN ix' e -> Ix1 -> MArray (PrimState m) BN ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Sz ix -> m (MArray (PrimState m) BN ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) BN ix e -> Sz ix -> m (MArray (PrimState m) BN ix e) Source #

NFData e => Source BN e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

unsafeIndex :: Index ix => Array BN ix e -> ix -> e Source #

unsafeLinearIndex :: Index ix => Array BN ix e -> Int -> e Source #

unsafeOuterSlice :: (Index ix, Index (Lower ix)) => Array BN ix e -> Sz (Lower ix) -> Int -> Array BN (Lower ix) e Source #

unsafeLinearSlice :: Index ix => Ix1 -> Sz1 -> Array BN ix e -> Array BN Ix1 e Source #

Index ix => Shape BN ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

(NFData e, Num e) => Numeric BN e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

scalarMinus :: Index ix => e -> Array BN ix e -> Array BN ix e Source #

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

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

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

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

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

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

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

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array BN ix e -> Array BN ix e -> Array BN ix e Source #

(NFData e, Num e) => FoldNumeric BN e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

sumArray :: Index ix => Array BN ix e -> e Source #

productArray :: Index ix => Array BN ix e -> e Source #

powerSumArray :: Index ix => Array BN ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array BN ix e -> Array BN ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array BN ix e -> e Source #

(Index ix, NFData e) => StrideLoad BN ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

iterArrayLinearWithStrideST_ :: Scheduler s () -> Stride ix -> Sz ix -> Array BN ix e -> (Int -> e -> ST s ()) -> ST s () Source #

(Index ix, NFData e) => Load BN ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

replicate :: Comp -> Sz ix -> e -> Array BN ix e Source #

iterArrayLinearST_ :: Scheduler s () -> Array BN ix e -> (Int -> e -> ST s ()) -> ST s () Source #

iterArrayLinearWithSetST_ :: Scheduler s () -> Array BN ix e -> (Ix1 -> e -> ST s ()) -> (Ix1 -> Sz1 -> e -> ST s ()) -> ST s () Source #

unsafeLoadIntoST :: Manifest r' e => MVector s r' e -> Array BN ix e -> ST s (MArray s r' ix e) Source #

unsafeLoadIntoIO :: Manifest r' e => MVector RealWorld r' e -> Array BN ix e -> IO (MArray RealWorld r' ix e) Source #

(Index ix, NFData e) => Stream BN ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

toStreamIx :: Array BN ix e -> Steps Id (ix, e) Source #

(NFData e, IsList (Array L ix e), Ragged L ix e) => IsList (Array BN ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Associated Types

type Item (Array BN ix e) #

Methods

fromList :: [Item (Array BN ix e)] -> Array BN ix e #

fromListN :: Int -> [Item (Array BN ix e)] -> Array BN ix e #

toList :: Array BN ix e -> [Item (Array BN ix e)] #

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

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

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

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

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

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

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

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

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

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

show :: Array BN ix e -> String #

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

NFData (Array BN ix e) Source #

O(1) - BN is already in normal form

Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

Methods

rnf :: Array BN ix e -> () #

newtype Array BN ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

newtype Array BN ix e = BNArray (Array BL ix e)
newtype MArray s BN ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

newtype MArray s BN ix e = MBNArray (MArray s BL ix e)
type Item (Array BN ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Boxed

type Item (Array BN ix e) = Item (Array L ix e)

type N = BN Source #

Deprecated: In favor of more consistently named BN

Type and pattern N have been added for backwards compatibility and will be replaced in the future in favor of BN.

Deprecated - since 1.0.0

pattern N :: N Source #

Deprecated: In favor of more consistently named BN

data Uninitialized Source #

An error that gets thrown when an unitialized element of a boxed array gets accessed. Can only happen when array was constructed with unsafeNew.

Constructors

Uninitialized 

Access

findIndex :: (Index ix, Manifest r e) => (e -> Bool) -> Array r ix e -> Maybe ix Source #

O(n) - Perform a row-major search starting at 0 for an element. Returns the index of the first occurance of an element or Nothing if a predicate could not be satisifed after it was applyied to all elements of the array.

Since: 0.5.5

Conversion

Important part of all conversions in this section is that the actual boxed Array, which holds the pointers to values isn't copied around, it is always kept as the same array. Conversion to Massiv boxed array will undergo evaluation during which computation strategies will be respected.

toLazyArray :: Array B ix e -> Array BL ix e Source #

O(1) - Cast a strict boxed array into a lazy boxed array.

Since: 0.6.0

evalLazyArray :: Index ix => Array BL ix e -> Array B ix e Source #

O(n) - Evaluate all elements of a boxed lazy array to weak head normal form

Since: 0.6.0

forceLazyArray :: (NFData e, Index ix) => Array BL ix e -> Array N ix e Source #

O(n) - Evaluate all elements of a boxed lazy array to normal form

Since: 0.6.0

unwrapNormalForm :: Array N ix e -> Array B ix e Source #

O(1) - Converts array from N to B representation.

Since: 0.5.0

evalNormalForm :: (Index ix, NFData e) => Array B ix e -> Array N ix e Source #

O(n) - Compute all elements of a boxed array to NF (normal form)

Since: 0.5.0

Primitive Boxed Array

unwrapLazyArray :: Array BL ix e -> Array e Source #

O(1) - Unwrap boxed array. This will discard any possible slicing that has been applied to the array.

Since: 0.6.0

wrapLazyArray :: Array e -> Vector BL e Source #

O(1) - Wrap a boxed array.

Since: 0.6.0

unwrapArray :: Array B ix e -> Array e Source #

O(1) - Unwrap boxed array. This will discard any possible slicing that has been applied to the array.

Since: 0.2.1

evalArray Source #

Arguments

:: Comp

Computation strategy

-> Array e

Lazy boxed array from primitive package.

-> Vector B e 

O(n) - Wrap a boxed array and evaluate all elements to a WHNF.

Since: 0.2.1

unwrapMutableArray :: MArray s B ix e -> MutableArray s e Source #

O(1) - Unwrap mutable boxed array. This will discard any possible slicing that has been applied to the array.

Since: 0.2.1

unwrapMutableLazyArray :: MArray s BL ix e -> MutableArray s e Source #

O(1) - Unwrap mutable boxed lazy array. This will discard any possible slicing that has been applied to the array.

Since: 0.6.0

evalMutableArray Source #

Arguments

:: PrimMonad m 
=> MutableArray (PrimState m) e

Mutable array that will get wrapped

-> m (MArray (PrimState m) B Ix1 e) 

O(n) - Wrap mutable boxed array and evaluate all elements to WHNF.

Since: 0.2.1

unwrapNormalFormArray :: Array N ix e -> Array e Source #

O(1) - Unwrap a fully evaluated boxed array. This will discard any possible slicing that has been applied to the array.

Since: 0.2.1

evalNormalFormArray Source #

Arguments

:: NFData e 
=> Comp

Computation strategy

-> Array e

Lazy boxed array

-> Array N Ix1 e 

O(n) - Wrap a boxed array and evaluate all elements to a Normal Form (NF).

Since: 0.2.1

unwrapNormalFormMutableArray :: MArray s N ix e -> MutableArray s e Source #

O(1) - Unwrap a fully evaluated mutable boxed array. This will discard any possible slicing that has been applied to the array.

Since: 0.2.1

evalNormalFormMutableArray :: (PrimMonad m, NFData e) => MutableArray (PrimState m) e -> m (MArray (PrimState m) N Ix1 e) Source #

O(n) - Wrap mutable boxed array and evaluate all elements to NF.

Since: 0.2.1

Boxed Vector

toBoxedVector :: Index ix => Array BL ix a -> Vector a Source #

O(1) - Converts a boxed Array into a Vector.

Since: 0.5.0

toBoxedMVector :: Index ix => MArray s BL ix a -> MVector s a Source #

O(1) - Converts a boxed MArray into a MVector.

Since: 0.5.0

fromBoxedVector :: Vector a -> Vector BL a Source #

O(1) - Cast a boxed vector without touching any elements.

Since: 0.6.0

fromBoxedMVector :: MVector s a -> MArray s BL Ix1 a Source #

O(1) - Convert mutable boxed vector to a lazy mutable boxed array. Both keep pointing to the same memory

Since: 0.6.0

evalBoxedVector :: Comp -> Vector a -> Array B Ix1 a Source #

O(n) - Convert a boxed vector and evaluate all elements to WHNF. Computation strategy will be respected during evaluation

Since: 0.5.0

evalBoxedMVector :: PrimMonad m => MVector (PrimState m) a -> m (MArray (PrimState m) B Ix1 a) Source #

O(n) - Convert mutable boxed vector and evaluate all elements to WHNF sequentially. Both keep pointing to the same memory

Since: 0.5.0

Primitive

data P Source #

Representation for Primitive elements

Constructors

P 

Instances

Instances details
Show P Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

showsPrec :: Int -> P -> ShowS #

show :: P -> String #

showList :: [P] -> ShowS #

Size P Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

unsafeResize :: (Index ix, Index ix') => Sz ix' -> Array P ix e -> Array P ix' e Source #

Strategy P Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

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

Prim e => Manifest P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeLinearIndexM :: Index ix => Array P ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s P ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s P ix e -> MArray s P ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s P ix e -> MVector s P e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array P ix e -> m (MArray (PrimState m) P ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) P ix e -> m (Array P ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) P ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) P ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) P ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) P ix' e -> Ix1 -> MArray (PrimState m) P ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array P ix' e -> Ix1 -> MArray (PrimState m) P ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Sz ix -> m (MArray (PrimState m) P ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> Sz ix -> m (MArray (PrimState m) P ix e) Source #

Prim e => Source P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

unsafeIndex :: Index ix => Array P ix e -> ix -> e Source #

unsafeLinearIndex :: Index ix => Array P ix e -> Int -> e Source #

unsafeOuterSlice :: (Index ix, Index (Lower ix)) => Array P ix e -> Sz (Lower ix) -> Int -> Array P (Lower ix) e Source #

unsafeLinearSlice :: Index ix => Ix1 -> Sz1 -> Array P ix e -> Array P Ix1 e Source #

Index ix => Shape P ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

(Prim e, Floating e) => NumericFloat P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

scalarDivide :: Index ix => e -> Array P ix e -> Array P ix e Source #

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

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

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

(Prim e, Num e) => Numeric P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

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

scalarMinus :: Index ix => e -> Array P ix e -> Array P ix e Source #

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

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

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

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

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

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

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

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array P ix e -> Array P ix e -> Array P ix e Source #

(Prim e, Num e) => FoldNumeric P e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

sumArray :: Index ix => Array P ix e -> e Source #

productArray :: Index ix => Array P ix e -> e Source #

powerSumArray :: Index ix => Array P ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array P ix e -> Array P ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array P ix e -> e Source #

(Prim e, Index ix) => StrideLoad P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

iterArrayLinearWithStrideST_ :: Scheduler s () -> Stride ix -> Sz ix -> Array P ix e -> (Int -> e -> ST s ()) -> ST s () Source #

(Prim e, Index ix) => Load P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

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

replicate :: Comp -> Sz ix -> e -> Array P ix e Source #

iterArrayLinearST_ :: Scheduler s () -> Array P ix e -> (Int -> e -> ST s ()) -> ST s () Source #

iterArrayLinearWithSetST_ :: Scheduler s () -> Array P ix e -> (Ix1 -> e -> ST s ()) -> (Ix1 -> Sz1 -> e -> ST s ()) -> ST s () Source #

unsafeLoadIntoST :: Manifest r' e => MVector s r' e -> Array P ix e -> ST s (MArray s r' ix e) Source #

unsafeLoadIntoIO :: Manifest r' e => MVector RealWorld r' e -> Array P ix e -> IO (MArray RealWorld r' ix e) Source #

(Prim e, Index ix) => Stream P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

toStreamIx :: Array P ix e -> Steps Id (ix, e) Source #

(Prim e, IsList (Array L ix e), Ragged L ix e) => IsList (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Associated Types

type Item (Array P ix e) #

Methods

fromList :: [Item (Array P ix e)] -> Array P ix e #

fromListN :: Int -> [Item (Array P ix e)] -> Array P ix e #

toList :: Array P ix e -> [Item (Array P ix e)] #

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

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

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

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

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

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

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

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

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

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

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

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

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

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

show :: Array P ix e -> String #

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

Index ix => NFData (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

rnf :: Array P ix e -> () #

NFData ix => NFData (MArray s P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

Methods

rnf :: MArray s P ix e -> () #

data Array P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

data Array P ix e = PArray {}
data MArray s P ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

data MArray s P ix e = MPArray !(Sz ix) !Int !(MutableByteArray s)
type Item (Array P ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Primitive

type Item (Array P ix e) = Item (Array L ix e)

class Prim a #

Class of types supporting primitive array operations. This includes interfacing with GC-managed memory (functions suffixed with ByteArray#) and interfacing with unmanaged memory (functions suffixed with Addr#). Endianness is platform-dependent.

Instances

Instances details
Prim Char 
Instance details

Defined in Data.Primitive.Types

Prim Double 
Instance details

Defined in Data.Primitive.Types

Prim Float 
Instance details

Defined in Data.Primitive.Types

Prim Int 
Instance details

Defined in Data.Primitive.Types

Prim Int8 
Instance details

Defined in Data.Primitive.Types

Prim Int16 
Instance details

Defined in Data.Primitive.Types

Prim Int32 
Instance details

Defined in Data.Primitive.Types

Prim Int64 
Instance details

Defined in Data.Primitive.Types

Prim Word 
Instance details

Defined in Data.Primitive.Types

Prim Word8 
Instance details

Defined in Data.Primitive.Types

Prim Word16 
Instance details

Defined in Data.Primitive.Types

Prim Word32 
Instance details

Defined in Data.Primitive.Types

Prim Word64 
Instance details

Defined in Data.Primitive.Types

Prim CDev 
Instance details

Defined in Data.Primitive.Types

Prim CIno 
Instance details

Defined in Data.Primitive.Types

Prim CMode 
Instance details

Defined in Data.Primitive.Types

Prim COff 
Instance details

Defined in Data.Primitive.Types

Prim CPid 
Instance details

Defined in Data.Primitive.Types

Prim CSsize 
Instance details

Defined in Data.Primitive.Types

Prim CGid 
Instance details

Defined in Data.Primitive.Types

Prim CNlink 
Instance details

Defined in Data.Primitive.Types

Prim CUid 
Instance details

Defined in Data.Primitive.Types

Prim CCc 
Instance details

Defined in Data.Primitive.Types

Prim CSpeed 
Instance details

Defined in Data.Primitive.Types

Prim CTcflag 
Instance details

Defined in Data.Primitive.Types

Prim CRLim 
Instance details

Defined in Data.Primitive.Types

Prim CBlkSize 
Instance details

Defined in Data.Primitive.Types

Prim CBlkCnt 
Instance details

Defined in Data.Primitive.Types

Prim CClockId 
Instance details

Defined in Data.Primitive.Types

Prim CFsBlkCnt 
Instance details

Defined in Data.Primitive.Types

Prim CFsFilCnt 
Instance details

Defined in Data.Primitive.Types

Prim CId 
Instance details

Defined in Data.Primitive.Types

Prim CKey 
Instance details

Defined in Data.Primitive.Types

Prim CTimer 
Instance details

Defined in Data.Primitive.Types

Prim Fd 
Instance details

Defined in Data.Primitive.Types

Prim CChar 
Instance details

Defined in Data.Primitive.Types

Prim CSChar 
Instance details

Defined in Data.Primitive.Types

Prim CUChar 
Instance details

Defined in Data.Primitive.Types

Prim CShort 
Instance details

Defined in Data.Primitive.Types

Prim CUShort 
Instance details

Defined in Data.Primitive.Types

Prim CInt 
Instance details

Defined in Data.Primitive.Types

Prim CUInt 
Instance details

Defined in Data.Primitive.Types

Prim CLong 
Instance details

Defined in Data.Primitive.Types

Prim CULong 
Instance details

Defined in Data.Primitive.Types

Prim CLLong 
Instance details

Defined in Data.Primitive.Types

Prim CULLong 
Instance details

Defined in Data.Primitive.Types

Prim CBool 
Instance details

Defined in Data.Primitive.Types

Prim CFloat 
Instance details

Defined in Data.Primitive.Types

Prim CDouble 
Instance details

Defined in Data.Primitive.Types

Prim CPtrdiff 
Instance details

Defined in Data.Primitive.Types

Prim CSize 
Instance details

Defined in Data.Primitive.Types

Prim CWchar 
Instance details

Defined in Data.Primitive.Types

Prim CSigAtomic 
Instance details

Defined in Data.Primitive.Types

Prim CClock 
Instance details

Defined in Data.Primitive.Types

Prim CTime 
Instance details

Defined in Data.Primitive.Types

Prim CUSeconds 
Instance details

Defined in Data.Primitive.Types

Prim CSUSeconds 
Instance details

Defined in Data.Primitive.Types

Prim CIntPtr 
Instance details

Defined in Data.Primitive.Types

Prim CUIntPtr 
Instance details

Defined in Data.Primitive.Types

Prim CIntMax 
Instance details

Defined in Data.Primitive.Types

Prim CUIntMax 
Instance details

Defined in Data.Primitive.Types

Prim WordPtr

Since: primitive-0.7.1.0

Instance details

Defined in Data.Primitive.Types

Prim IntPtr

Since: primitive-0.7.1.0

Instance details

Defined in Data.Primitive.Types

Prim (StablePtr a) 
Instance details

Defined in Data.Primitive.Types

Prim (Ptr a) 
Instance details

Defined in Data.Primitive.Types

Methods

sizeOf# :: Ptr a -> Int# #

alignment# :: Ptr a -> Int# #

indexByteArray# :: ByteArray# -> Int# -> Ptr a #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Ptr a #) #

writeByteArray# :: MutableByteArray# s -> Int# -> Ptr a -> State# s -> State# s #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Ptr a -> State# s -> State# s #

indexOffAddr# :: Addr# -> Int# -> Ptr a #

readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Ptr a #) #

writeOffAddr# :: Addr# -> Int# -> Ptr a -> State# s -> State# s #

setOffAddr# :: Addr# -> Int# -> Int# -> Ptr a -> State# s -> State# s #

Prim (FunPtr a) 
Instance details

Defined in Data.Primitive.Types

Prim a => Prim (Min a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Methods

sizeOf# :: Min a -> Int# #

alignment# :: Min a -> Int# #

indexByteArray# :: ByteArray# -> Int# -> Min a #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Min a #) #

writeByteArray# :: MutableByteArray# s -> Int# -> Min a -> State# s -> State# s #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Min a -> State# s -> State# s #

indexOffAddr# :: Addr# -> Int# -> Min a #

readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Min a #) #

writeOffAddr# :: Addr# -> Int# -> Min a -> State# s -> State# s #

setOffAddr# :: Addr# -> Int# -> Int# -> Min a -> State# s -> State# s #

Prim a => Prim (Max a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Methods

sizeOf# :: Max a -> Int# #

alignment# :: Max a -> Int# #

indexByteArray# :: ByteArray# -> Int# -> Max a #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Max a #) #

writeByteArray# :: MutableByteArray# s -> Int# -> Max a -> State# s -> State# s #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Max a -> State# s -> State# s #

indexOffAddr# :: Addr# -> Int# -> Max a #

readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Max a #) #

writeOffAddr# :: Addr# -> Int# -> Max a -> State# s -> State# s #

setOffAddr# :: Addr# -> Int# -> Int# -> Max a -> State# s -> State# s #

Prim a => Prim (First a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Prim a => Prim (Last a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Prim a => Prim (Identity a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Prim a => Prim (Dual a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Prim a => Prim (Sum a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Methods

sizeOf# :: Sum a -> Int# #

alignment# :: Sum a -> Int# #

indexByteArray# :: ByteArray# -> Int# -> Sum a #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Sum a #) #

writeByteArray# :: MutableByteArray# s -> Int# -> Sum a -> State# s -> State# s #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Sum a -> State# s -> State# s #

indexOffAddr# :: Addr# -> Int# -> Sum a #

readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Sum a #) #

writeOffAddr# :: Addr# -> Int# -> Sum a -> State# s -> State# s #

setOffAddr# :: Addr# -> Int# -> Int# -> Sum a -> State# s -> State# s #

Prim a => Prim (Product a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Prim a => Prim (Down a)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Prim a => Prim (Const a b)

Since: primitive-0.6.5.0

Instance details

Defined in Data.Primitive.Types

Methods

sizeOf# :: Const a b -> Int# #

alignment# :: Const a b -> Int# #

indexByteArray# :: ByteArray# -> Int# -> Const a b #

readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (# State# s, Const a b #) #

writeByteArray# :: MutableByteArray# s -> Int# -> Const a b -> State# s -> State# s #

setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Const a b -> State# s -> State# s #

indexOffAddr# :: Addr# -> Int# -> Const a b #

readOffAddr# :: Addr# -> Int# -> State# s -> (# State# s, Const a b #) #

writeOffAddr# :: Addr# -> Int# -> Const a b -> State# s -> State# s #

setOffAddr# :: Addr# -> Int# -> Int# -> Const a b -> State# s -> State# s #

Conversion

Primitive ByteArray

toByteArray :: (Index ix, Prim e) => Array P ix e -> ByteArray Source #

O(n) - Ensure that the size matches the internal ByteArray. If not make a copy of the slice and return it as ByteArray

Since: 0.2.1

toByteArrayM :: (Prim e, Index ix, MonadThrow m) => Array P ix e -> m ByteArray Source #

O(1) - Unwrap Ensure that the size matches the internal ByteArray.

Since: 0.5.0

unwrapByteArray :: Array P ix e -> ByteArray Source #

O(1) - Extract the internal ByteArray. This will ignore any possible slicing that has been applied to the array. Use toByteArray in order to preserve slicing or unwrapByteArrayOffset to get ahold of the offset

Since: 0.5.0

unwrapByteArrayOffset :: Array P ix e -> Int Source #

O(1) - Extract potential linear offset into the underlying ByteArray, which can also be extracted with unwrapByteArray.

Since: 0.5.9

fromByteArray :: forall e. Prim e => Comp -> ByteArray -> Array P Ix1 e Source #

O(1) - Construct a flat Array from ByteArray

Since: 0.4.0

fromByteArrayM :: (MonadThrow m, Index ix, Prim e) => Comp -> Sz ix -> ByteArray -> m (Array P ix e) Source #

O(1) - Construct a primitive array from the ByteArray. Will return Nothing if number of elements doesn't match.

Since: 0.3.0

fromByteArrayOffsetM :: (MonadThrow m, Index ix, Prim e) => Comp -> Sz ix -> Int -> ByteArray -> m (Array P ix e) Source #

O(1) - Construct a primitive array from the ByteArray. Will return Nothing if number of elements doesn't match.

Since: 0.5.9

toMutableByteArray :: forall ix e m. (Prim e, Index ix, PrimMonad m) => MArray (PrimState m) P ix e -> m (Bool, MutableByteArray (PrimState m)) Source #

O(n) - Try to cast a mutable array to MutableByteArray, if sizes do not match make a copy. Returns True if an array was converted without a copy, in which case it means that the source at the resulting array are still pointing to the same location in memory.

Since: 0.5.0

unwrapMutableByteArray :: MArray s P ix e -> MutableByteArray s Source #

O(1) - Extract the internal MutableByteArray. This will discard any possible slicing that has been applied to the array.

Since: 0.5.0

unwrapMutableByteArrayOffset :: MArray s P ix e -> Int Source #

O(1) - Extract the linear offset into underlying MutableByteArray, which can aslo be extracted with unwrapMutableByteArray.

Since: 0.5.9

fromMutableByteArray :: forall e s. Prim e => MutableByteArray s -> MArray s P Ix1 e Source #

O(1) - Construct a flat Array from MutableByteArray

Since: 0.4.0

fromMutableByteArrayM :: (MonadThrow m, Index ix, Prim e) => Sz ix -> MutableByteArray s -> m (MArray s P ix e) Source #

O(1) - Construct a primitive mutable array from the MutableByteArray. Will throw SizeElementsMismatchException if number of elements doesn't match.

Since: 0.3.0

fromMutableByteArrayOffsetM :: (MonadThrow m, Index ix, Prim e) => Sz ix -> Ix1 -> MutableByteArray s -> m (MArray s P ix e) Source #

O(1) - Construct a primitive mutable array from the MutableByteArray. Will throw SizeElementsMismatchException if number of elements doesn't match.

Since: 0.5.9

Primitive Vector

toPrimitiveVector :: Index ix => Array P ix e -> Vector e Source #

O(1) - Cast a primitive array to a primitive vector.

Since: 0.5.0

toPrimitiveMVector :: Index ix => MArray s P ix e -> MVector s e Source #

O(1) - Cast a mutable primitive array to a mutable primitive vector.

Since: 0.5.0

fromPrimitiveVector :: Vector e -> Array P Ix1 e Source #

O(1) - Cast a primitive vector to a primitive array.

Since: 0.5.0

fromPrimitiveMVector :: MVector s e -> MArray s P Ix1 e Source #

O(1) - Cast a mutable primitive vector to a mutable primitive array.

Since: 0.5.0

Storable

data S Source #

Representation for Storable elements

Constructors

S 

Instances

Instances details
Show S Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

showsPrec :: Int -> S -> ShowS #

show :: S -> String #

showList :: [S] -> ShowS #

Size S Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

unsafeResize :: (Index ix, Index ix') => Sz ix' -> Array S ix e -> Array S ix' e Source #

Strategy S Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

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

Storable e => Manifest S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeLinearIndexM :: Index ix => Array S ix e -> Int -> e Source #

sizeOfMArray :: Index ix => MArray s S ix e -> Sz ix Source #

unsafeResizeMArray :: (Index ix', Index ix) => Sz ix' -> MArray s S ix e -> MArray s S ix' e Source #

unsafeLinearSliceMArray :: Index ix => Ix1 -> Sz1 -> MArray s S ix e -> MVector s S e Source #

unsafeThaw :: (Index ix, PrimMonad m) => Array S ix e -> m (MArray (PrimState m) S ix e) Source #

unsafeFreeze :: (Index ix, PrimMonad m) => Comp -> MArray (PrimState m) S ix e -> m (Array S ix e) Source #

unsafeNew :: (Index ix, PrimMonad m) => Sz ix -> m (MArray (PrimState m) S ix e) Source #

unsafeLinearRead :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Int -> m e Source #

unsafeLinearWrite :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Int -> e -> m () Source #

initialize :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> m () Source #

initializeNew :: (Index ix, PrimMonad m) => Maybe e -> Sz ix -> m (MArray (PrimState m) S ix e) Source #

newMArray :: (Index ix, PrimMonad m) => Sz ix -> e -> m (MArray (PrimState m) S ix e) Source #

unsafeLinearSet :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Ix1 -> Sz1 -> e -> m () Source #

unsafeLinearCopy :: (Index ix', Index ix, PrimMonad m) => MArray (PrimState m) S ix' e -> Ix1 -> MArray (PrimState m) S ix e -> Ix1 -> Sz1 -> m () Source #

unsafeArrayLinearCopy :: (Index ix', Index ix, PrimMonad m) => Array S ix' e -> Ix1 -> MArray (PrimState m) S ix e -> Ix1 -> Sz1 -> m () Source #

unsafeLinearShrink :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Sz ix -> m (MArray (PrimState m) S ix e) Source #

unsafeLinearGrow :: (Index ix, PrimMonad m) => MArray (PrimState m) S ix e -> Sz ix -> m (MArray (PrimState m) S ix e) Source #

Storable e => Source S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

unsafeIndex :: Index ix => Array S ix e -> ix -> e Source #

unsafeLinearIndex :: Index ix => Array S ix e -> Int -> e Source #

unsafeOuterSlice :: (Index ix, Index (Lower ix)) => Array S ix e -> Sz (Lower ix) -> Int -> Array S (Lower ix) e Source #

unsafeLinearSlice :: Index ix => Ix1 -> Sz1 -> Array S ix e -> Array S Ix1 e Source #

Index ix => Shape S ix Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

(Storable e, Floating e) => NumericFloat S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

scalarDivide :: Index ix => e -> Array S ix e -> Array S ix e Source #

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

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

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

(Storable e, Num e) => Numeric S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

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

scalarMinus :: Index ix => e -> Array S ix e -> Array S ix e Source #

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

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

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

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

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

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

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

unsafeLiftArray2 :: Index ix => (e -> e -> e) -> Array S ix e -> Array S ix e -> Array S ix e Source #

(Storable e, Num e) => FoldNumeric S e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

sumArray :: Index ix => Array S ix e -> e Source #

productArray :: Index ix => Array S ix e -> e Source #

powerSumArray :: Index ix => Array S ix e -> Int -> e Source #

unsafeDotProduct :: Index ix => Array S ix e -> Array S ix e -> e Source #

foldArray :: Index ix => (e -> e -> e) -> e -> Array S ix e -> e Source #

(Index ix, Storable e) => StrideLoad S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

iterArrayLinearWithStrideST_ :: Scheduler s () -> Stride ix -> Sz ix -> Array S ix e -> (Int -> e -> ST s ()) -> ST s () Source #

(Index ix, Storable e) => Load S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

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

replicate :: Comp -> Sz ix -> e -> Array S ix e Source #

iterArrayLinearST_ :: Scheduler s () -> Array S ix e -> (Int -> e -> ST s ()) -> ST s () Source #

iterArrayLinearWithSetST_ :: Scheduler s () -> Array S ix e -> (Ix1 -> e -> ST s ()) -> (Ix1 -> Sz1 -> e -> ST s ()) -> ST s () Source #

unsafeLoadIntoST :: Manifest r' e => MVector s r' e -> Array S ix e -> ST s (MArray s r' ix e) Source #

unsafeLoadIntoIO :: Manifest r' e => MVector RealWorld r' e -> Array S ix e -> IO (MArray RealWorld r' ix e) Source #

(Index ix, Storable e) => Stream S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

toStreamIx :: Array S ix e -> Steps Id (ix, e) Source #

(Storable e, IsList (Array L ix e), Ragged L ix e) => IsList (Array S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Associated Types

type Item (Array S ix e) #

Methods

fromList :: [Item (Array S ix e)] -> Array S ix e #

fromListN :: Int -> [Item (Array S ix e)] -> Array S ix e #

toList :: Array S ix e -> [Item (Array S ix e)] #

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

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

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

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

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

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

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

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

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

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

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

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

Defined in Data.Massiv.Array.Manifest.Storable

Methods

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

show :: Array S ix e -> String #

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

NFData ix => NFData (Array S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

rnf :: Array S ix e -> () #

NFData ix => NFData (MArray s S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

Methods

rnf :: MArray s S ix e -> () #

data Array S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

data Array S ix e = SArray {}
data MArray s S ix e Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

data MArray s S ix e = MSArray !(Sz ix) !(ForeignPtr e)
type Item (Array S ix e) Source # 
Instance details

Defined in Data.Massiv.Array.Manifest.Storable

type Item (Array S ix e) = Item (Array L ix e)

class Storable a #

The member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types.

Memory addresses are represented as values of type Ptr a, for some a which is an instance of class Storable. The type argument to Ptr helps provide some valuable type safety in FFI code (you can't mix pointers of different types without an explicit cast), while helping the Haskell type system figure out which marshalling method is needed for a given pointer.

All marshalling between Haskell and a foreign language ultimately boils down to translating Haskell data structures into the binary representation of a corresponding data structure of the foreign language and vice versa. To code this marshalling in Haskell, it is necessary to manipulate primitive data types stored in unstructured memory blocks. The class Storable facilitates this manipulation on all types for which it is instantiated, which are the standard basic types of Haskell, the fixed size Int types (Int8, Int16, Int32, Int64), the fixed size Word types (Word8, Word16, Word32, Word64), StablePtr, all types from Foreign.C.Types, as well as Ptr.

Minimal complete definition

sizeOf, alignment, (peek | peekElemOff | peekByteOff), (poke | pokeElemOff | pokeByteOff)

Instances

Instances details
Storable Bool

Since: base-2.1