Hoogle Search
Within LTS Haskell 24.65 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
massiv Data.Massiv.Array No documentation available.
-
massiv Data.Massiv.Array Replicate each element of the array by a factor in stride along each dimension and surround each such group with a box of supplied grid value. It will essentially zoom up an array and create a grid around each element from the original array. Very useful for zooming up images to inspect individual pixels.
Example
>>> import Data.Massiv.Array as A >>> arr = resize' (Sz2 3 2) (Ix1 1 ... 6) >>> arr Array D Seq (Sz (3 :. 2)) [ [ 1, 2 ] , [ 3, 4 ] , [ 5, 6 ] ] >>> zoomWithGrid 0 (Stride (2 :. 3)) arr Array DL Seq (Sz (10 :. 9)) [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ] , [ 0, 1, 1, 1, 0, 2, 2, 2, 0 ] , [ 0, 1, 1, 1, 0, 2, 2, 2, 0 ] , [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ] , [ 0, 3, 3, 3, 0, 4, 4, 4, 0 ] , [ 0, 3, 3, 3, 0, 4, 4, 4, 0 ] , [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ] , [ 0, 5, 5, 5, 0, 6, 6, 6, 0 ] , [ 0, 5, 5, 5, 0, 6, 6, 6, 0 ] , [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ]
fromStrideLoad :: StrideLoad r ix e => Stride ix -> Array r ix e -> Array DL ix emassiv Data.Massiv.Array.Delayed Convert an array that can be loaded with stride into DL representation.
-
massiv Data.Massiv.Array.Numeric.Integral Similar to fromFunction, but will create an array from a function with sample points in the middle of cells.
>>> fromFunctionMidpoint Seq (\ scale (i :. j) -> scale i + scale j :: Double) (-2) 1 (Sz 4) 2 Array D Seq (Sz (8 :. 8)) [ [ -3.5, -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0 ] , [ -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5 ] , [ -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0 ] , [ -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5 ] , [ -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0 ] , [ -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5 ] , [ -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0 ] , [ 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 ] ]
-
massiv Data.Massiv.Array.Numeric.Integral Use midpoint rule to approximate an integral.
midpointStencil :: (Fractional e, Index ix) => e -> Dim -> Int -> Stencil ix e emassiv Data.Massiv.Array.Numeric.Integral Midpoint Rule <math>
-
massiv Data.Massiv.Array.Numeric.Integral Use trapezoid rule to approximate an integral.
trapezoidStencil :: (Fractional e, Index ix) => e -> Dim -> Int -> Stencil ix e emassiv Data.Massiv.Array.Numeric.Integral Trapezoid Rule <math>
-
massiv Data.Massiv.Array.Unsafe No documentation available.
-
massiv Data.Massiv.Array.Unsafe Stride provides a way to ignore elements of an array if an index is divisible by a corresponding value in a stride. So, for a Stride (i :. j) only elements with indices will be kept around:
( 0 :. 0) ( 0 :. j) ( 0 :. 2j) ( 0 :. 3j) ... ( i :. 0) ( i :. j) ( i :. 2j) ( i :. 3j) ... (2i :. 0) (2i :. j) (2i :. 2j) (2i :. 3j) ... ...
Only positive strides make sense, so Stride pattern synonym constructor will prevent a user from creating a stride with negative or zero values, thus promoting safety of the library.Examples:
- If stride is Stride 2, then every 2nd element (i.e. with index 1, 3, 5, ..) will be skipped and only elemnts with indices divisible by 2 will be kept around.
- In case of two dimensions, if what you want is to keep all rows divisible by 5, but keep every column intact then you'd use Stride (5 :. 1).