Safe Haskell | Safe-Infered |
---|

Functions without sanity or bounds checks.

- unsafeBackpermute :: forall r sh1 sh2 e. (Shape sh1, Shape sh2, Repr r e) => sh2 -> (sh2 -> sh1) -> Array r sh1 e -> Array D sh2 e
- unsafeBackpermuteDft :: forall r0 r1 sh1 sh2 e. (Shape sh1, Shape sh2, Repr r0 e, Repr r1 e) => Array r0 sh2 e -> (sh2 -> Maybe sh1) -> Array r1 sh1 e -> Array D sh2 e
- unsafeSlice :: (Slice sl, Shape (FullShape sl), Shape (SliceShape sl), Repr r e) => Array r (FullShape sl) e -> sl -> Array D (SliceShape sl) e
- unsafeExtend :: (Slice sl, Shape (FullShape sl), Shape (SliceShape sl), Repr r e) => sl -> Array r (SliceShape sl) e -> Array D (FullShape sl) e
- unsafeTraverse :: forall r sh sh' a b. (Shape sh, Shape sh', Repr r a) => Array r sh a -> (sh -> sh') -> ((sh -> a) -> sh' -> b) -> Array D sh' b
- unsafeTraverse2 :: forall r1 r2 sh sh' sh'' a b c. (Shape sh, Shape sh', Shape sh'', Repr r1 a, Repr r2 b) => Array r1 sh a -> Array r2 sh' b -> (sh -> sh' -> sh'') -> ((sh -> a) -> (sh' -> b) -> sh'' -> c) -> Array D sh'' c
- unsafeTraverse3 :: forall r1 r2 r3 sh1 sh2 sh3 sh4 a b c d. (Shape sh1, Shape sh2, Shape sh3, Shape sh4, Repr r1 a, Repr r2 b, Repr r3 c) => Array r1 sh1 a -> Array r2 sh2 b -> Array r3 sh3 c -> (sh1 -> sh2 -> sh3 -> sh4) -> ((sh1 -> a) -> (sh2 -> b) -> (sh3 -> c) -> sh4 -> d) -> Array D sh4 d
- unsafeTraverse4 :: forall r1 r2 r3 r4 sh1 sh2 sh3 sh4 sh5 a b c d e. (Shape sh1, Shape sh2, Shape sh3, Shape sh4, Shape sh5, Repr r1 a, Repr r2 b, Repr r3 c, Repr r4 d) => Array r1 sh1 a -> Array r2 sh2 b -> Array r3 sh3 c -> Array r4 sh4 d -> (sh1 -> sh2 -> sh3 -> sh4 -> sh5) -> ((sh1 -> a) -> (sh2 -> b) -> (sh3 -> c) -> (sh4 -> d) -> sh5 -> e) -> Array D sh5 e

# Documentation

:: forall r sh1 sh2 e . (Shape sh1, Shape sh2, Repr r e) | |

=> sh2 | Extent of result array. |

-> (sh2 -> sh1) | Function mapping each index in the result array to an index of the source array. |

-> Array r sh1 e | Source array. |

-> Array D sh2 e |

Backwards permutation of an array's elements. The result array has the same extent as the original.

:: forall r0 r1 sh1 sh2 e . (Shape sh1, Shape sh2, Repr r0 e, Repr r1 e) | |

=> Array r0 sh2 e | Default values ( |

-> (sh2 -> Maybe sh1) | Function mapping each index in the result array to an index in the source array. |

-> Array r1 sh1 e | Source array. |

-> Array D sh2 e |

Default backwards permutation of an array's elements.
If the function returns `Nothing`

then the value at that index is taken
from the default array (`arrDft`

)

unsafeSlice :: (Slice sl, Shape (FullShape sl), Shape (SliceShape sl), Repr r e) => Array r (FullShape sl) e -> sl -> Array D (SliceShape sl) eSource

Take a slice from an array, according to a given specification.

For example, to take a row from a matrix use the following:

slice arr (Any :. (5::Int) :. All)

To take a column use:

slice arr (Any :. (5::Int))

unsafeExtend :: (Slice sl, Shape (FullShape sl), Shape (SliceShape sl), Repr r e) => sl -> Array r (SliceShape sl) e -> Array D (FullShape sl) eSource

Extend an array, according to a given slice specification.

For example, to replicate the rows of an array use the following:

extend arr (Any :. (5::Int) :. All)

:: forall r sh sh' a b . (Shape sh, Shape sh', Repr r a) | |

=> Array r sh a | Source array. |

-> (sh -> sh') | Function to produce the extent of the result. |

-> ((sh -> a) -> sh' -> b) | Function to produce elements of the result. It is passed a lookup function to get elements of the source. |

-> Array D sh' b |

Unstructured traversal.

:: forall r1 r2 sh sh' sh'' a b c . (Shape sh, Shape sh', Shape sh'', Repr r1 a, Repr r2 b) | |

=> Array r1 sh a | First source array. |

-> Array r2 sh' b | Second source array. |

-> (sh -> sh' -> sh'') | Function to produce the extent of the result. |

-> ((sh -> a) -> (sh' -> b) -> sh'' -> c) | Function to produce elements of the result. It is passed lookup functions to get elements of the source arrays. |

-> Array D sh'' c |

Unstructured traversal over two arrays at once.

unsafeTraverse3 :: forall r1 r2 r3 sh1 sh2 sh3 sh4 a b c d. (Shape sh1, Shape sh2, Shape sh3, Shape sh4, Repr r1 a, Repr r2 b, Repr r3 c) => Array r1 sh1 a -> Array r2 sh2 b -> Array r3 sh3 c -> (sh1 -> sh2 -> sh3 -> sh4) -> ((sh1 -> a) -> (sh2 -> b) -> (sh3 -> c) -> sh4 -> d) -> Array D sh4 dSource

Unstructured traversal over three arrays at once.

unsafeTraverse4 :: forall r1 r2 r3 r4 sh1 sh2 sh3 sh4 sh5 a b c d e. (Shape sh1, Shape sh2, Shape sh3, Shape sh4, Shape sh5, Repr r1 a, Repr r2 b, Repr r3 c, Repr r4 d) => Array r1 sh1 a -> Array r2 sh2 b -> Array r3 sh3 c -> Array r4 sh4 d -> (sh1 -> sh2 -> sh3 -> sh4 -> sh5) -> ((sh1 -> a) -> (sh2 -> b) -> (sh3 -> c) -> (sh4 -> d) -> sh5 -> e) -> Array D sh5 eSource

Unstructured traversal over four arrays at once.