Safe Haskell | None |
---|
- data Array sh a
- class C array where
- data Exp a
- fix :: Id (Array sh a)
- shape :: Array sh a -> Exp sh
- (!) :: (C sh, Index sh ~ ix) => Array sh a -> Exp ix -> Exp a
- the :: Scalar sh => Array sh a -> Exp a
- fromScalar :: Scalar sh => Exp a -> Array sh a
- fill :: Exp sh -> Exp a -> Array sh a
- gather :: (C array, C sh0, Index sh0 ~ ix0, C sh1, Index sh1 ~ ix1, C a) => array sh1 ix0 -> array sh0 a -> array sh1 a
- backpermute :: (C sh0, Index sh0 ~ ix0, C sh1, Index sh1 ~ ix1, C a) => Exp sh1 -> (Exp ix1 -> Exp ix0) -> Array sh0 a -> Array sh1 a
- backpermute2 :: (C array, C sh0, Index sh0 ~ ix0, C sh1, Index sh1 ~ ix1, C sh, Index sh ~ ix) => Exp sh -> (Exp ix -> Exp ix0) -> (Exp ix -> Exp ix1) -> (Exp a -> Exp b -> Exp c) -> array sh0 a -> array sh1 b -> array sh c
- id :: (C array, C sh, Index sh ~ ix) => Exp sh -> array sh ix
- map :: (C array, C sh) => (Exp a -> Exp b) -> array sh a -> array sh b
- mapWithIndex :: (C array, C sh, Index sh ~ ix) => (Exp ix -> Exp a -> Exp b) -> array sh a -> array sh b
- zipWith :: (C array, C sh) => (Exp a -> Exp b -> Exp c) -> array sh a -> array sh b -> array sh c
- zipWith3 :: (C array, C sh) => (Exp a -> Exp b -> Exp c -> Exp d) -> array sh a -> array sh b -> array sh c -> array sh d
- zipWith4 :: (C array, C sh) => (Exp a -> Exp b -> Exp c -> Exp d -> Exp e) -> array sh a -> array sh b -> array sh c -> array sh d -> array sh e
- zip :: (C array, C sh) => array sh a -> array sh b -> array sh (a, b)
- zip3 :: (C array, C sh) => array sh a -> array sh b -> array sh c -> array sh (a, b, c)
- zip4 :: (C array, C sh) => array sh a -> array sh b -> array sh c -> array sh d -> array sh (a, b, c, d)
- fold1 :: (C array, C sh0, C sh1, C a) => (Exp a -> Exp a -> Exp a) -> array (sh0, sh1) a -> array sh0 a
- fold1All :: (C sh, C a) => (Exp a -> Exp a -> Exp a) -> Array sh a -> Exp a
- findAll :: (C sh, C a) => (Exp a -> Exp Bool) -> Array sh a -> Exp (Maybe a)
Documentation
This class allows to implement functions without parameters for both simple and parameterized arrays.
Value Exp | |
(Field a, Real a, RationalConstant a) => Fractional (Exp a) | |
(PseudoRing a, Real a, IntegerConstant a) => Num (Exp a) | |
Compose (Exp a) | |
(C a, Storable a) => Argument (Exp a) | |
(C a, Storable a) => C (Exp a) |
fromScalar :: Scalar sh => Exp a -> Array sh aSource
gather :: (C array, C sh0, Index sh0 ~ ix0, C sh1, Index sh1 ~ ix1, C a) => array sh1 ix0 -> array sh0 a -> array sh1 aSource
backpermute :: (C sh0, Index sh0 ~ ix0, C sh1, Index sh1 ~ ix1, C a) => Exp sh1 -> (Exp ix1 -> Exp ix0) -> Array sh0 a -> Array sh1 aSource
backpermute2 :: (C array, C sh0, Index sh0 ~ ix0, C sh1, Index sh1 ~ ix1, C sh, Index sh ~ ix) => Exp sh -> (Exp ix -> Exp ix0) -> (Exp ix -> Exp ix1) -> (Exp a -> Exp b -> Exp c) -> array sh0 a -> array sh1 b -> array sh cSource
mapWithIndex :: (C array, C sh, Index sh ~ ix) => (Exp ix -> Exp a -> Exp b) -> array sh a -> array sh bSource
zipWith :: (C array, C sh) => (Exp a -> Exp b -> Exp c) -> array sh a -> array sh b -> array sh cSource
zipWith3 :: (C array, C sh) => (Exp a -> Exp b -> Exp c -> Exp d) -> array sh a -> array sh b -> array sh c -> array sh dSource
zipWith4 :: (C array, C sh) => (Exp a -> Exp b -> Exp c -> Exp d -> Exp e) -> array sh a -> array sh b -> array sh c -> array sh d -> array sh eSource
zip4 :: (C array, C sh) => array sh a -> array sh b -> array sh c -> array sh d -> array sh (a, b, c, d)Source
fold1 :: (C array, C sh0, C sh1, C a) => (Exp a -> Exp a -> Exp a) -> array (sh0, sh1) a -> array sh0 aSource
findAll :: (C sh, C a) => (Exp a -> Exp Bool) -> Array sh a -> Exp (Maybe a)Source
In principle this can be implemented using fold1All
but it has a short-cut semantics.
All
means that it scans all dimensions
but it does not mean that it finds all occurrences.
If you want to get the index of the found element,
please decorate the array elements with their indices before calling findAll
.