Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- 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.
Instances
Value Exp | |
(Transcendental a, Real a, RationalConstant a) => Floating (Exp a) | |
(PseudoRing a, Real a, IntegerConstant a) => Num (Exp a) | |
(Field a, Real a, RationalConstant a) => Fractional (Exp a) | |
Compose (Exp a) | |
(Real a, PseudoRing a, IntegerConstant a) => C (Exp a) | |
Additive a => C (Exp a) | We do not require a numeric prelude superclass, thus also LLVM only types like vectors are instances. |
(Transcendental a, RationalConstant a) => C (Exp a) | |
(Field a, RationalConstant a) => C (Exp a) | |
(PseudoRing a, IntegerConstant a) => C (Exp a) | |
(Transcendental a, RationalConstant a) => C (Exp a) | |
Aggregate (Exp a) (T a) | |
Defined in LLVM.DSL.Expression type MultiValuesOf (Exp a) # type ExpressionsOf (T a) # | |
(a ~ Scalar v, PseudoModule v, IntegerConstant a) => C (Exp a) (Exp v) | |
type Composed (Exp a) | |
Defined in LLVM.DSL.Expression | |
type MultiValuesOf (Exp a) | |
Defined in LLVM.DSL.Expression |
gather :: (C array, C sh0, Index sh0 ~ ix0, C sh1, Index sh1 ~ ix1, C a) => array sh1 ix0 -> array sh0 a -> array sh1 a Source #
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 Source #
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 Source #
mapWithIndex :: (C array, C sh, Index sh ~ ix) => (Exp ix -> Exp a -> Exp b) -> array sh a -> array sh b Source #
zipWith :: (C array, C sh) => (Exp a -> Exp b -> Exp c) -> array sh a -> array sh b -> array sh c Source #
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 Source #
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 Source #
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 a Source #
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
.