Copyright | (c) Alexey Kuleshevich 2018 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data family Array r ix e :: *
- type family Elt r ix e :: * where ...
- type family EltRepr r ix :: *
- class (Typeable r, Index ix) => Construct r ix e
- class Size r ix e => Source r ix e
- class Size r ix e => Load r ix e where
- class Construct r ix e => Size r ix e
- class Size r ix e => Slice r ix e
- class OuterSlice r ix e where
- class Size r ix e => InnerSlice r ix e
- class Source r ix e => Manifest r ix e
- class Manifest r ix e => Mutable r ix e
- class Construct r ix e => Ragged r ix e where
- class Nested r ix e where
- type family NestedStruct r ix e :: *
- data L = L
- data LN
- type family ListItem ix e :: * where ...
- data Comp where
- pattern Par :: Comp
- module Data.Massiv.Core.Index
- elemsCount :: Size r ix e => Array r ix e -> Int
- isEmpty :: Size r ix e => Array r ix e -> Bool
Documentation
data family Array r ix e :: * Source #
The array family. Representations r
describes how data is arranged or computed. All arrays
have a common property that each index ix
always maps to the same unique element, even if that
element does not exist in memory and has to be computed upon lookup. Data is always arranged in a
nested fasion, depth of which is controlled by
.Rank
ix
Instances
Functor (Array D ix) # | |
Functor (Array DW ix) # | |
Functor (Array DI ix) # | |
Index ix => Applicative (Array D ix) # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
Index ix => Foldable (Array D ix) # | Row-major sequential folding over a Delayed array. |
Defined in Data.Massiv.Array.Delayed.Internal fold :: Monoid m => Array D ix m -> m # foldMap :: Monoid m => (a -> m) -> Array D ix a -> m # foldr :: (a -> b -> b) -> b -> Array D ix a -> b # foldr' :: (a -> b -> b) -> b -> Array D ix a -> b # foldl :: (b -> a -> b) -> b -> Array D ix a -> b # foldl' :: (b -> a -> b) -> b -> Array D ix a -> b # foldr1 :: (a -> a -> a) -> Array D ix a -> a # foldl1 :: (a -> a -> a) -> Array D ix a -> a # toList :: Array D ix a -> [a] # null :: Array D ix a -> Bool # length :: Array D ix a -> Int # elem :: Eq a => a -> Array D ix a -> Bool # maximum :: Ord a => Array D ix a -> a # minimum :: Ord a => Array D ix a -> a # | |
Index ix => Foldable (Array M ix) # | Row-major sequential folding over a Manifest array. |
Defined in Data.Massiv.Array.Manifest.Internal fold :: Monoid m => Array M ix m -> m # foldMap :: Monoid m => (a -> m) -> Array M ix a -> m # foldr :: (a -> b -> b) -> b -> Array M ix a -> b # foldr' :: (a -> b -> b) -> b -> Array M ix a -> b # foldl :: (b -> a -> b) -> b -> Array M ix a -> b # foldl' :: (b -> a -> b) -> b -> Array M ix a -> b # foldr1 :: (a -> a -> a) -> Array M ix a -> a # foldl1 :: (a -> a -> a) -> Array M ix a -> a # toList :: Array M ix a -> [a] # null :: Array M ix a -> Bool # length :: Array M ix a -> Int # elem :: Eq a => a -> Array M ix a -> Bool # maximum :: Ord a => Array M ix a -> a # minimum :: Ord a => Array M ix a -> a # | |
Index ix => Foldable (Array B ix) # | Row-major sequential folding over a Boxed array. |
Defined in Data.Massiv.Array.Manifest.BoxedStrict fold :: Monoid m => Array B ix m -> 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 # | |
Nested LN ix e => IsList (Array L ix e) # | |
Nested LN ix e => IsList (Array LN ix e) # | |
(Unbox e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array U ix e) # | |
(Storable e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array S ix e) # | |
(Prim e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array P ix e) # | |
(NFData e, IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array N ix e) # | |
(IsList (Array L ix e), Nested LN ix e, Nested L ix e, Ragged L ix e) => IsList (Array B ix e) # | |
(Eq e, Index ix) => Eq (Array D ix e) # | |
(Unbox e, Eq e, Index ix) => Eq (Array U ix e) # | |
(Storable e, Eq e, Index ix) => Eq (Array S ix e) # | |
(Prim e, Eq e, Index ix) => Eq (Array P ix e) # | |
(Index ix, NFData e, Eq e) => Eq (Array N ix e) # | |
(Index ix, Eq e) => Eq (Array B ix e) # | |
(Index ix, Floating e) => Floating (Array D ix e) # | |
Defined in Data.Massiv.Array.Delayed.Internal exp :: Array D ix e -> Array D ix e # log :: Array D ix e -> Array D ix e # sqrt :: Array D ix e -> Array D ix e # (**) :: Array D ix e -> Array D ix e -> Array D ix e # logBase :: Array D ix e -> Array D ix e -> Array D ix e # sin :: Array D ix e -> Array D ix e # cos :: Array D ix e -> Array D ix e # tan :: Array D ix e -> Array D ix e # asin :: Array D ix e -> Array D ix e # acos :: Array D ix e -> Array D ix e # atan :: Array D ix e -> Array D ix e # sinh :: Array D ix e -> Array D ix e # cosh :: Array D ix e -> Array D ix e # tanh :: Array D ix e -> Array D ix e # asinh :: Array D ix e -> Array D ix e # acosh :: Array D ix e -> Array D ix e # atanh :: Array D ix e -> Array D ix e # log1p :: Array D ix e -> Array D ix e # expm1 :: Array D ix e -> Array D ix e # | |
(Index ix, Fractional e) => Fractional (Array D ix e) # | |
(Index ix, Num e) => Num (Array D ix e) # | |
Defined in Data.Massiv.Array.Delayed.Internal (+) :: Array D ix e -> Array D ix e -> Array D ix e # (-) :: Array D ix e -> Array D ix e -> Array D ix e # (*) :: Array D ix e -> Array D ix e -> Array D ix e # negate :: Array D ix e -> Array D ix e # abs :: Array D ix e -> Array D ix e # signum :: Array D ix e -> Array D ix e # fromInteger :: Integer -> Array D ix e # | |
(Ord e, Index ix) => Ord (Array D ix e) # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
(Unbox e, Ord e, Index ix) => Ord (Array U ix e) # | |
Defined in Data.Massiv.Array.Manifest.Unboxed | |
(Storable e, Ord e, Index ix) => Ord (Array S ix e) # | |
Defined in Data.Massiv.Array.Manifest.Storable | |
(Prim e, Ord e, Index ix) => Ord (Array P ix e) # | |
Defined in Data.Massiv.Array.Manifest.Primitive | |
(Index ix, NFData e, Ord e) => Ord (Array N ix e) # | |
Defined in Data.Massiv.Array.Manifest.BoxedNF | |
(Index ix, Ord e) => Ord (Array B ix e) # | |
Defined in Data.Massiv.Array.Manifest.BoxedStrict | |
(Ragged L ix e, Construct L ix e, Source r ix e, Show e) => Show (Array r ix e) # | |
(Ragged L ix e, Show e) => Show (Array L ix e) # | |
(Ragged L ix e, Nested LN ix e, Show e) => Show (Array LN ix e) # | |
(Show e, Ragged L ix e, Load DW ix e) => Show (Array DW ix e) # | |
(Index ix, NFData e) => NFData (Array U ix e) # | |
Defined in Data.Massiv.Array.Manifest.Unboxed | |
(Index ix, NFData e) => NFData (Array S ix e) # | |
Defined in Data.Massiv.Array.Manifest.Storable | |
(Index ix, NFData e) => NFData (Array P ix e) # | |
Defined in Data.Massiv.Array.Manifest.Primitive | |
(Index ix, NFData e) => NFData (Array N ix e) # | |
Defined in Data.Massiv.Array.Manifest.BoxedNF | |
(Index ix, NFData e) => NFData (Array B ix e) # | |
Defined in Data.Massiv.Array.Manifest.BoxedStrict | |
data Array L ix e Source # | |
data Array LN ix e Source # | |
data Array D ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
data Array M ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Internal | |
data Array U ix e Source # | |
data Array S ix e Source # | |
data Array P ix e Source # | |
data Array N ix e Source # | |
data Array B ix e Source # | |
data Array DW ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Windowed data Array DW ix e = DWArray {
| |
data Array DI ix e Source # | |
type Item (Array L ix e) # | |
Defined in Data.Massiv.Core.List | |
type Item (Array LN ix e) # | |
Defined in Data.Massiv.Core.List | |
type Item (Array U ix e) # | |
type Item (Array S ix e) # | |
type Item (Array P ix e) # | |
type Item (Array N ix e) # | |
type Item (Array B ix e) # | |
type family EltRepr r ix :: * Source #
Instances
type EltRepr L ix Source # | |
Defined in Data.Massiv.Core.List | |
type EltRepr LN ix Source # | |
Defined in Data.Massiv.Core.List | |
type EltRepr D ix Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
type EltRepr M ix Source # | |
Defined in Data.Massiv.Array.Manifest.Internal | |
type EltRepr U ix Source # | |
Defined in Data.Massiv.Array.Manifest.Unboxed | |
type EltRepr S ix Source # | |
Defined in Data.Massiv.Array.Manifest.Storable | |
type EltRepr P ix Source # | |
Defined in Data.Massiv.Array.Manifest.Primitive | |
type EltRepr N ix Source # | |
Defined in Data.Massiv.Array.Manifest.BoxedNF | |
type EltRepr B ix Source # | |
Defined in Data.Massiv.Array.Manifest.BoxedStrict | |
type EltRepr DW ix Source # | |
Defined in Data.Massiv.Array.Delayed.Windowed | |
type EltRepr DI ix Source # | |
Defined in Data.Massiv.Array.Delayed.Interleaved |
class (Typeable r, Index ix) => Construct r ix e Source #
Array types that can be constructed.
Instances
(Index ix, Ragged L ix e, Ragged L (Lower ix) e, Elt L ix e ~ Array L (Lower ix) e) => Construct L ix e Source # | |
Construct L Ix1 e Source # | |
Index ix => Construct D ix e Source # | |
Index ix => Construct M ix e Source # | |
(Unbox e, Index ix) => Construct U ix e Source # | |
(Storable e, Index ix) => Construct S ix e Source # | |
(Prim e, Index ix) => Construct P ix e Source # | |
(Index ix, NFData e) => Construct N ix e Source # | |
Index ix => Construct B ix e Source # | |
Index ix => Construct DW ix e Source # | |
Index ix => Construct DI ix e Source # | |
class Size r ix e => Source r ix e Source #
Arrays that can be used as source to practically any manipulation function.
Instances
Index ix => Source D ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
Index ix => Source M ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Internal | |
(Unbox e, Index ix) => Source U ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Unboxed | |
(Storable e, Index ix) => Source S ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Storable | |
(Prim e, Index ix) => Source P ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Primitive | |
(Index ix, NFData e) => Source N ix e Source # | |
Defined in Data.Massiv.Array.Manifest.BoxedNF | |
Index ix => Source B ix e Source # | |
Defined in Data.Massiv.Array.Manifest.BoxedStrict |
class Size r ix e => Load r ix e where Source #
Any array that can be computed
:: Monad m | |
=> Array r ix e | Array that is being loaded |
-> (Int -> m e) | Function that reads an element from target array |
-> (Int -> e -> m ()) | Function that writes an element into target array |
-> m () |
Load an array into memory sequentially
:: [Int] | List of capabilities to run workers on, as described in
|
-> Array r ix e | Array that is being loaded |
-> (Int -> IO e) | Function that reads an element from target array |
-> (Int -> e -> IO ()) | Function that writes an element into target array |
-> IO () |
Load an array into memory in parallel
class Construct r ix e => Size r ix e Source #
An array that contains size information. They can be resized and new arrays extracted from it in constant time.
Instances
Index ix => Size D ix e Source # | |
Index ix => Size M ix e Source # | |
(Unbox e, Index ix) => Size U ix e Source # | |
(Storable e, Index ix) => Size S ix e Source # | |
(Prim e, Index ix) => Size P ix e Source # | |
(Index ix, NFData e) => Size N ix e Source # | |
Index ix => Size B ix e Source # | |
Index ix => Size DW ix e Source # | Any resize or extract on Windowed Array will hurt the performance. |
Index ix => Size DI ix e Source # | |
class Size r ix e => Slice r ix e Source #
Instances
(Index ix, Index (Lower ix), Elt D ix e ~ Array D (Lower ix) e) => Slice D ix e Source # | |
Defined in Data.Massiv.Array.Delayed.Internal | |
(Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e) => Slice M ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Internal | |
Slice M Ix1 e Source # | |
(Unbox e, Index ix, Index (Lower ix), Elt U ix e ~ Elt M ix e, Elt M ix e ~ Array M (Lower ix) e) => Slice U ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Unboxed | |
Unbox e => Slice U Ix1 e Source # | |
(Prim e, Index ix, Index (Lower ix), Elt P ix e ~ Elt M ix e, Elt M ix e ~ Array M (Lower ix) e) => Slice P ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Primitive | |
Prim e => Slice P Ix1 e Source # | |
class OuterSlice r ix e where Source #
outerLength :: Array r ix e -> Int Source #
Instances
class Size r ix e => InnerSlice r ix e Source #
Instances
(Elt D ix e ~ Array D (Lower ix) e, Index ix) => InnerSlice D ix e Source # | |
(Elt M ix e ~ Array M (Lower ix) e, Index ix, Index (Lower ix)) => InnerSlice M ix e Source # | |
InnerSlice M Ix1 e Source # | |
(Unbox e, Index ix, Index (Lower ix), Elt U ix e ~ Elt M ix e, Elt M ix e ~ Array M (Lower ix) e) => InnerSlice U ix e Source # | |
Unbox e => InnerSlice U Ix1 e Source # | |
(Storable e, Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e, Elt S ix e ~ Array M (Lower ix) e) => InnerSlice S ix e Source # | |
(Prim e, Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e, Elt P ix e ~ Array M (Lower ix) e) => InnerSlice P ix e Source # | |
Prim e => InnerSlice P Ix1 e Source # | |
(NFData e, Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e, Elt N ix e ~ Array M (Lower ix) e) => InnerSlice N ix e Source # | |
(NFData e, Index ix, Index (Lower ix), Elt M ix e ~ Array M (Lower ix) e, Elt B ix e ~ Array M (Lower ix) e) => InnerSlice B ix e Source # | |
class Source r ix e => Manifest r ix e Source #
Manifest arrays are backed by actual memory and values are looked up versus
computed as it is with delayed arrays. Because of this fact indexing functions
(
, !
)(
, etc. are constrained to manifest arrays only.!?
)
Instances
Index ix => Manifest M ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Internal | |
(Unbox e, Index ix) => Manifest U ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Unboxed | |
(Index ix, Storable e) => Manifest S ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Storable | |
(Index ix, Prim e) => Manifest P ix e Source # | |
Defined in Data.Massiv.Array.Manifest.Primitive | |
(Index ix, NFData e) => Manifest N ix e Source # | |
Defined in Data.Massiv.Array.Manifest.BoxedNF | |
Index ix => Manifest B ix e Source # | |
Defined in Data.Massiv.Array.Manifest.BoxedStrict |
class Manifest r ix e => Mutable r ix e Source #
Instances
class Construct r ix e => Ragged r ix e where Source #
empty :: Comp -> Array r ix e Source #
isNull :: Array r ix e -> Bool Source #
cons :: Elt r ix e -> Array r ix e -> Array r ix e Source #
uncons :: Array r ix e -> Maybe (Elt r ix e, Array r ix e) Source #
edgeSize :: Array r ix e -> ix Source #
flatten :: Array r ix e -> Array r Ix1 e Source #
loadRagged :: (IO () -> IO ()) -> (Int -> e -> IO a) -> Int -> Int -> Lower ix -> Array r ix e -> IO () Source #
raggedFormat :: (e -> String) -> String -> Array r ix e -> String Source #
Instances
class Nested r ix e where Source #
fromNested :: NestedStruct r ix e -> Array r ix e Source #
toNested :: Array r ix e -> NestedStruct r ix e Source #
Instances
Nested L ix e Source # | |
Defined in Data.Massiv.Core.List fromNested :: NestedStruct L ix e -> Array L ix e Source # | |
(Elt LN ix e ~ Array LN (Lower ix) e, ListItem ix e ~ [ListItem (Lower ix) e], Coercible (Elt LN ix e) (ListItem ix e)) => Nested LN ix e Source # | |
Defined in Data.Massiv.Core.List fromNested :: NestedStruct LN ix e -> Array LN ix e Source # | |
Nested LN Ix1 e Source # | |
Defined in Data.Massiv.Core.List |
type family NestedStruct r ix e :: * Source #
Instances
type NestedStruct L ix e Source # | |
Defined in Data.Massiv.Core.List | |
type NestedStruct LN ix e Source # | |
Defined in Data.Massiv.Core.List |
Instances
Instances
(Elt LN ix e ~ Array LN (Lower ix) e, ListItem ix e ~ [ListItem (Lower ix) e], Coercible (Elt LN ix e) (ListItem ix e)) => Nested LN ix e Source # | |
Defined in Data.Massiv.Core.List fromNested :: NestedStruct LN ix e -> Array LN ix e Source # | |
Nested LN Ix1 e Source # | |
Defined in Data.Massiv.Core.List | |
Nested LN ix e => IsList (Array LN ix e) Source # | |
(Ragged L ix e, Nested LN ix e, Show e) => Show (Array LN ix e) Source # | |
data Array LN ix e Source # | |
type EltRepr LN ix Source # | |
Defined in Data.Massiv.Core.List | |
type NestedStruct LN ix e Source # | |
Defined in Data.Massiv.Core.List | |
type Item (Array LN ix e) Source # | |
Defined in Data.Massiv.Core.List |
Computation type to use.
Seq | Sequential computation |
ParOn [Int] | Use Parallel computation with a list of capabilities to run computation
on. Specifying an empty list ( |
module Data.Massiv.Core.Index