dimensions-0.3.2.0: Safe type-level dimensionality for multidimensional data.

Copyright(c) Artem Chirkin
LicenseBSD3
Maintainerchirkin@arch.ethz.ch
Safe HaskellNone
LanguageHaskell2010

Numeric.Dimensions.Traverse

Description

Map a function over all dimensions provided dimension indices or offsets.

Synopsis

Documentation

overDim# Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> a -> State# s -> (#State# s, a#))

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> State# s 
-> (#State# s, a#) 

Traverse over all dimensions keeping track of index and offset

overDim_# Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> State# s -> State# s)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> State# s 
-> State# s 

Same as overDim#, but with no return value

overDimIdx# :: Dim (ds :: [Nat]) -> (Idx ds -> a -> State# s -> (#State# s, a#)) -> a -> State# s -> (#State# s, a#) Source #

Traverse over all dimensions keeping track of indices

overDimIdx_# :: Dim (ds :: [Nat]) -> (Idx ds -> State# s -> State# s) -> State# s -> State# s Source #

Traverse over all dimensions keeping track of indices, with no return value

overDimOff# Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Int# -> a -> State# s -> (#State# s, a#))

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> State# s 
-> (#State# s, a#) 

Traverse over all dimensions keeping track of total offset

overDimOff_# Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Int# -> State# s -> State# s)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> State# s 
-> State# s 

Traverse over all dimensions keeping track of total offset, with not return value

overDimPart# Source #

Arguments

:: forall (ds :: [Nat]). Dimensions ds 
=> Idx ds 
-> Idx ds 
-> (Idx ds -> Int# -> a -> State# s -> (#State# s, a#))

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> State# s 
-> (#State# s, a#) 

Traverse from the first index to the second index in each dimension. Indices must be within Dim range, which is not checked. You can combine positive and negative traversal directions along different dimensions.

foldDim Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> a -> a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> a 

Fold over all dimensions keeping track of index and offset

foldDimIdx :: Dim (ds :: [Nat]) -> (Idx ds -> a -> a) -> a -> a Source #

Fold all dimensions keeping track of indices

foldDimOff Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Int# -> a -> a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step

-> a 
-> a 

Fold over all dimensions keeping track of total offset

foldDimReverse Source #

Arguments

:: Dim (ds :: [Nat]) 
-> (Idx ds -> Int# -> a -> a)

function to map over each dimension

-> Int#

Initial offset

-> Int#

offset step (substracted from initial offset)

-> a 
-> a 

Fold over all dimensions in reverse order keeping track of index and offset

foldDimReverseIdx :: Dim (ds :: [Nat]) -> (Idx ds -> a -> a) -> a -> a Source #

Fold all dimensions in reverse order keeping track of indices