Safe Haskell | None |
---|---|

Language | Haskell98 |

Functions without sanity or bounds checks.

- unsafeBackpermute :: forall r sh1 sh2 e. (Shape sh1, Source r e) => sh2 -> (sh2 -> sh1) -> Array r sh1 e -> Array D sh2 e
- unsafeBackpermuteDft :: forall r1 r2 sh1 sh2 e. (Shape sh1, Shape sh2, Source r1 e, Source r2 e) => Array r2 sh2 e -> (sh2 -> Maybe sh1) -> Array r1 sh1 e -> Array D sh2 e
- unsafeSlice :: (Slice sl, Shape (FullShape sl), Source r e) => Array r (FullShape sl) e -> sl -> Array D (SliceShape sl) e
- unsafeExtend :: (Slice sl, Shape (SliceShape sl), Source r e) => sl -> Array r (SliceShape sl) e -> Array D (FullShape sl) e
- unsafeTraverse :: forall r sh sh' a b. (Source r a, Shape sh) => Array r sh a -> (sh -> sh') -> ((sh -> a) -> sh' -> b) -> Array D sh' b
- unsafeTraverse2 :: forall r1 r2 sh sh' sh'' a b c. (Source r1 a, Source r2 b, Shape sh, Shape sh') => 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. (Source r1 a, Source r2 b, Source r3 c, Shape sh1, Shape sh2, Shape sh3) => 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. (Source r1 a, Source r2 b, Source r3 c, Source r4 d, Shape sh1, Shape sh2, Shape sh3, Shape sh4) => 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

:: (Shape sh1, Source 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.

:: (Shape sh1, Shape sh2, Source r1 e, Source r2 e) | |

=> Array r2 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), Source r e) => Array r (FullShape sl) e -> sl -> Array D (SliceShape sl) e Source #

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 (SliceShape sl), Source r e) => sl -> Array r (SliceShape sl) e -> Array D (FullShape sl) e Source #

Extend an array, according to a given slice specification.

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

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

:: (Source r a, Shape sh) | |

=> 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.

:: (Source r1 a, Source r2 b, Shape sh, Shape sh') | |

=> 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. (Source r1 a, Source r2 b, Source r3 c, Shape sh1, Shape sh2, Shape sh3) => 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 Source #

Unstructured traversal over three arrays at once.

unsafeTraverse4 :: forall r1 r2 r3 r4 sh1 sh2 sh3 sh4 sh5 a b c d e. (Source r1 a, Source r2 b, Source r3 c, Source r4 d, Shape sh1, Shape sh2, Shape sh3, Shape sh4) => 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 Source #

Unstructured traversal over four arrays at once.