Safe Haskell | Safe-Infered |
---|

- foldS :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r (sh :. Int) a -> Array U sh a
- foldP :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r (sh :. Int) a -> Array U sh a
- foldAllS :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r sh a -> a
- foldAllP :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r sh a -> a
- sumS :: (Shape sh, Num a, Elt a, Unbox a, Repr r a) => Array r (sh :. Int) a -> Array U sh a
- sumP :: (Shape sh, Num a, Elt a, Unbox a, Repr r a) => Array r (sh :. Int) a -> Array U sh a
- sumAllS :: (Shape sh, Elt a, Unbox a, Num a, Repr r a) => Array r sh a -> a
- sumAllP :: (Shape sh, Elt a, Unbox a, Num a, Repr r a) => Array r sh a -> a

# Documentation

foldS :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r (sh :. Int) a -> Array U sh aSource

Sequential reduction of the innermost dimension of an arbitrary rank array.

Combine this with `transpose`

to fold any other dimension.

foldP :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r (sh :. Int) a -> Array U sh aSource

Parallel reduction of the innermost dimension of an arbitray rank array.

The first argument needs to be an associative sequential operator.
The starting element must be neutral with respect to the operator, for
example `0`

is neutral with respect to `(+)`

as `0 + a = a`

.
These restrictions are required to support parallel evaluation, as the
starting element may be used multiple times depending on the number of threads.

foldAllS :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r sh a -> aSource

Sequential reduction of an array of arbitrary rank to a single scalar value.

foldAllP :: (Shape sh, Elt a, Unbox a, Repr r a) => (a -> a -> a) -> a -> Array r sh a -> aSource

Parallel reduction of an array of arbitrary rank to a single scalar value.

The first argument needs to be an associative sequential operator.
The starting element must be neutral with respect to the operator,
for example `0`

is neutral with respect to `(+)`

as `0 + a = a`

.
These restrictions are required to support parallel evaluation, as the
starting element may be used multiple times depending on the number of threads.

sumS :: (Shape sh, Num a, Elt a, Unbox a, Repr r a) => Array r (sh :. Int) a -> Array U sh aSource

Sequential sum the innermost dimension of an array.

sumP :: (Shape sh, Num a, Elt a, Unbox a, Repr r a) => Array r (sh :. Int) a -> Array U sh aSource

Sequential sum the innermost dimension of an array.