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.

  1. iterArrayLinearWithStrideM_ :: forall r ix e m s . (StrideLoad r ix e, MonadPrimBase s m) => Scheduler s () -> Stride ix -> Sz ix -> Array r ix e -> (Int -> e -> m ()) -> m ()

    massiv Data.Massiv.Array

    No documentation available.

  2. zoomWithGrid :: forall r ix e . (Index ix, Source r e) => e -> Stride ix -> Array r ix e -> Array DL ix e

    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 ]
    ]
    

  3. fromStrideLoad :: StrideLoad r ix e => Stride ix -> Array r ix e -> Array DL ix e

    massiv Data.Massiv.Array.Delayed

    Convert an array that can be loaded with stride into DL representation.

  4. fromFunctionMidpoint :: (Index ix, Fractional a) => Comp -> ((Int -> a) -> ix -> e) -> a -> a -> Sz ix -> Int -> Array D ix e

    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 ]
    ]
    

  5. midpointRule :: (Fractional e, StrideLoad DW ix e, Manifest r e) => Comp -> r -> ((Int -> e) -> ix -> e) -> e -> e -> Sz ix -> Int -> Array D ix e

    massiv Data.Massiv.Array.Numeric.Integral

    Use midpoint rule to approximate an integral.

  6. midpointStencil :: (Fractional e, Index ix) => e -> Dim -> Int -> Stencil ix e e

    massiv Data.Massiv.Array.Numeric.Integral

    Midpoint Rule <math>

  7. trapezoidRule :: (Fractional e, StrideLoad DW ix e, Manifest r e) => Comp -> r -> ((Int -> e) -> ix -> e) -> e -> e -> Sz ix -> Int -> Array D ix e

    massiv Data.Massiv.Array.Numeric.Integral

    Use trapezoid rule to approximate an integral.

  8. trapezoidStencil :: (Fractional e, Index ix) => e -> Dim -> Int -> Stencil ix e e

    massiv Data.Massiv.Array.Numeric.Integral

    Trapezoid Rule <math>

  9. SafeStride :: ix -> Stride ix

    massiv Data.Massiv.Array.Unsafe

    No documentation available.

  10. newtype Stride ix

    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:

    • Default and minimal stride of Stride (pureIndex 1) will have no affect and all elements will kept.
    • 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).

Page 868 of many | Previous | Next