Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
unsafeArrayToForeignPtr :: Index ix => Array S ix e -> (ForeignPtr e, Int)massiv Data.Massiv.Array.Unsafe O(1) - Yield the underlying ForeignPtr together with its length.
unsafeMArrayFromForeignPtr :: Storable e => ForeignPtr e -> Int -> Sz1 -> MArray s S Ix1 emassiv Data.Massiv.Array.Unsafe O(1) - Wrap a ForeignPtr, an offset and it's size into a mutable storable array. It is still safe to modify the pointer, unless the array gets frozen prior to modification.
unsafeMArrayFromForeignPtr0 :: ForeignPtr e -> Sz1 -> MArray s S Ix1 emassiv Data.Massiv.Array.Unsafe O(1) - Wrap a ForeignPtr and it's size into a mutable storable array. It is still safe to modify the pointer, unless the array gets frozen prior to modification.
unsafeMArrayToForeignPtr :: Index ix => MArray s S ix e -> (ForeignPtr e, Int)massiv Data.Massiv.Array.Unsafe O(1) - Yield the underlying ForeignPtr together with its length.
-
massiv Data.Massiv.Array.Unsafe Same transform', except no bounds checking is performed, thus making it faster, but unsafe.
-
massiv Data.Massiv.Array.Unsafe Same transform2', except no bounds checking is performed, thus making it faster, but unsafe.
-
massiv Data.Massiv.Array.Unsafe Perform an arbitrary transformation of a stencil. This stencil modifier can be used for example to turn a vector stencil into a matrix stencil implement, or transpose a matrix stencil. It is really easy to get this wrong, so be extremely careful.
Examples
Convert a 1D stencil into a row or column 2D stencil:>>> import Data.Massiv.Array >>> import Data.Massiv.Array.Unsafe >>> let arr = compute $ iterateN 3 succ 0 :: Array P Ix2 Int >>> arr Array P Seq (Sz (3 :. 3)) [ [ 1, 2, 3 ] , [ 4, 5, 6 ] , [ 7, 8, 9 ] ] >>> let rowStencil = unsafeTransformStencil (\(Sz n) -> Sz (1 :. n)) (0 :.) $ \ f uget getVal (i :. j) -> f (uget . (i :.)) (getVal . (i :.)) j >>> applyStencil noPadding (rowStencil (sumStencil (Sz1 3))) arr Array DW Seq (Sz (3 :. 1)) [ [ 6 ] , [ 15 ] , [ 24 ] ] >>> let columnStencil = unsafeTransformStencil (\(Sz n) -> Sz (n :. 1)) (:. 0) $ \ f uget getVal (i :. j) -> f (uget . (:. j)) (getVal . (:. j)) i >>> applyStencil noPadding (columnStencil (sumStencil (Sz1 3))) arr Array DW Seq (Sz (1 :. 3)) [ [ 12, 15, 18 ] ]
-
massiv Data.Massiv.Vector Same as smapM, but with arguments flipped.
Examples
sforM_ :: (Stream r ix a, Monad m) => Array r ix a -> (a -> m b) -> m ()massiv Data.Massiv.Vector Same as smapM_, but with arguments flipped.
Examples
-
massiv Data.Massiv.Vector Same as simapM, but with arguments flipped.
Examples