Copyright | (c) Alexey Kuleshevich 2018 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- unsafeMakeArray :: Construct r ix e => Comp -> ix -> (ix -> e) -> Array r ix e
- unsafeGenerateArray :: Mutable r ix e => ix -> (ix -> e) -> Array r ix e
- unsafeGenerateArrayP :: Mutable r ix e => [Int] -> ix -> (ix -> e) -> Array r ix e
- unsafeGenerateM :: (Ragged r ix e, Monad m) => Comp -> ix -> (ix -> m e) -> m (Array r ix e)
- unsafeIndex :: Source r ix e => Array r ix e -> ix -> e
- unsafeLinearIndex :: Source r ix e => Array r ix e -> Int -> e
- unsafeLinearIndexM :: Manifest r ix e => Array r ix e -> Int -> e
- unsafeBackpermute :: (Source r' ix' e, Index ix) => ix -> (ix -> ix') -> Array r' ix' e -> Array D ix e
- unsafeTraverse :: (Source r1 ix1 e1, Index ix) => ix -> ((ix1 -> e1) -> ix -> e) -> Array r1 ix1 e1 -> Array D ix e
- unsafeTraverse2 :: (Source r1 ix1 e1, Source r2 ix2 e2, Index ix) => ix -> ((ix1 -> e1) -> (ix2 -> e2) -> ix -> e) -> Array r1 ix1 e1 -> Array r2 ix2 e2 -> Array D ix e
- unsafeResize :: (Size r ix e, Index ix') => ix' -> Array r ix e -> Array r ix' e
- unsafeExtract :: Size r ix e => ix -> ix -> Array r ix e -> Array (EltRepr r ix) ix e
- unsafeSlice :: Slice r ix e => Array r ix e -> ix -> ix -> Dim -> Maybe (Elt r ix e)
- unsafeOuterSlice :: OuterSlice r ix e => Array r ix e -> Int -> Elt r ix e
- unsafeInnerSlice :: InnerSlice r ix e => Array r ix e -> (Lower ix, Int) -> Int -> Elt r ix e
- unsafeThaw :: (Mutable r ix e, PrimMonad m) => Array r ix e -> m (MArray (PrimState m) r ix e)
- unsafeFreeze :: (Mutable r ix e, PrimMonad m) => Comp -> MArray (PrimState m) r ix e -> m (Array r ix e)
- unsafeNew :: (Mutable r ix e, PrimMonad m) => ix -> m (MArray (PrimState m) r ix e)
- unsafeNewZero :: (Mutable r ix e, PrimMonad m) => ix -> m (MArray (PrimState m) r ix e)
- unsafeRead :: (Mutable r ix e, PrimMonad m) => MArray (PrimState m) r ix e -> ix -> m e
- unsafeLinearRead :: (Mutable r ix e, PrimMonad m) => MArray (PrimState m) r ix e -> Int -> m e
- unsafeWrite :: (Mutable r ix e, PrimMonad m) => MArray (PrimState m) r ix e -> ix -> e -> m ()
- unsafeLinearWrite :: (Mutable r ix e, PrimMonad m) => MArray (PrimState m) r ix e -> Int -> e -> m ()
Creation
unsafeMakeArray :: Construct r ix e => Comp -> ix -> (ix -> e) -> Array r ix e Source #
Construct an array. No size validation is performed.
unsafeGenerateArray :: Mutable r ix e => ix -> (ix -> e) -> Array r ix e Source #
Create an array sequentially using mutable interface
unsafeGenerateArrayP :: Mutable r ix e => [Int] -> ix -> (ix -> e) -> Array r ix e Source #
Create an array in parallel using mutable interface
Since: massiv-0.1.5
unsafeGenerateM :: (Ragged r ix e, Monad m) => Comp -> ix -> (ix -> m e) -> m (Array r ix e) Source #
Indexing
unsafeIndex :: Source r ix e => Array r ix e -> ix -> e Source #
Lookup element in the array. No bounds check is performed and access of arbitrary memory is possible when invalid index is supplied.
unsafeLinearIndex :: Source r ix e => Array r ix e -> Int -> e Source #
Lookup element in the array using flat index in a row-major fasion. No bounds check is performed
Manipulations
unsafeBackpermute :: (Source r' ix' e, Index ix) => ix -> (ix -> ix') -> Array r' ix' e -> Array D ix e Source #
unsafeTraverse :: (Source r1 ix1 e1, Index ix) => ix -> ((ix1 -> e1) -> ix -> e) -> Array r1 ix1 e1 -> Array D ix e Source #
unsafeTraverse2 :: (Source r1 ix1 e1, Source r2 ix2 e2, Index ix) => ix -> ((ix1 -> e1) -> (ix2 -> e2) -> ix -> e) -> Array r1 ix1 e1 -> Array r2 ix2 e2 -> Array D ix e Source #
unsafeResize :: (Size r ix e, Index ix') => ix' -> Array r ix e -> Array r ix' e Source #
O(1) - Change the size of an array. New size is not validated.
unsafeExtract :: Size r ix e => ix -> ix -> Array r ix e -> Array (EltRepr r ix) ix e Source #
O(1) - Extract a portion of an array. Staring index and new size are not validated.
Slicing
unsafeOuterSlice :: OuterSlice r ix e => Array r ix e -> Int -> Elt r ix e Source #
O(1) - Take a slice out of an array from the outside
unsafeInnerSlice :: InnerSlice r ix e => Array r ix e -> (Lower ix, Int) -> Int -> Elt r ix e Source #
Mutable interface
unsafeThaw :: (Mutable r ix e, PrimMonad m) => Array r ix e -> m (MArray (PrimState m) r ix e) Source #
unsafeFreeze :: (Mutable r ix e, PrimMonad m) => Comp -> MArray (PrimState m) r ix e -> m (Array r ix e) Source #
unsafeNew :: (Mutable r ix e, PrimMonad m) => ix -> m (MArray (PrimState m) r ix e) Source #
Create new mutable array, leaving it's elements uninitialized. Size isn't validated either.
unsafeNewZero :: (Mutable r ix e, PrimMonad m) => ix -> m (MArray (PrimState m) r ix e) Source #
Create new mutable array, leaving it's elements uninitialized. Size isn't validated either.
unsafeRead :: (Mutable r ix e, PrimMonad m) => MArray (PrimState m) r ix e -> ix -> m e Source #
Read an array element
unsafeLinearRead :: (Mutable r ix e, PrimMonad m) => MArray (PrimState m) r ix e -> Int -> m e Source #