| Copyright | 2014 Edward Kmett Charles Durham 2015 Trevor L. McDonell |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell98 |
Data.Array.Accelerate.Linear.Vector
Description
Operations on free vector spaces
- class Additive f => Additive f where
- type IsAdditive f a = (Additive f, Box f a)
- newtype E t = E {}
- negated :: forall f a. (Functor f, Num a, Box f a) => Exp (f a) -> Exp (f a)
- (*^) :: forall f a. (Functor f, Num a, Box f a) => Exp a -> Exp (f a) -> Exp (f a)
- (^*) :: forall f a. (Functor f, Num a, Box f a) => Exp (f a) -> Exp a -> Exp (f a)
- (^/) :: forall f a. (Functor f, Fractional a, Box f a) => Exp (f a) -> Exp a -> Exp (f a)
- (/^) :: forall f a. (Functor f, Fractional a, Box f a) => Exp a -> Exp (f a) -> Exp (f a)
- (+^) :: forall f a. (Functor f, Num a, Box f a) => Exp a -> Exp (f a) -> Exp (f a)
- (^+) :: forall f a. (Functor f, Num a, Box f a) => Exp (f a) -> Exp a -> Exp (f a)
- (-^) :: forall f a. (Functor f, Num a, Box f a) => Exp a -> Exp (f a) -> Exp (f a)
- (^-) :: forall f a. (Functor f, Num a, Box f a) => Exp (f a) -> Exp a -> Exp (f a)
Documentation
class Additive f => Additive f where Source #
Methods
zero :: (Elt (f a), Num a) => Exp (f a) Source #
The zero vector
(^+^) :: forall a. (Num a, Box f a) => Exp (f a) -> Exp (f a) -> Exp (f a) infixl 6 Source #
Compute the sum of two vectors
>>>V2 1 2 ^+^ V2 3 4V2 4 6
(^-^) :: forall a. (Num a, Box f a) => Exp (f a) -> Exp (f a) -> Exp (f a) infixl 6 Source #
Compute the difference between two vectors
>>>V2 4 5 - V2 3 1V2 1 4
lerp :: forall a. (Num a, Box f a) => Exp a -> Exp (f a) -> Exp (f a) -> Exp (f a) Source #
Linearly interpolate between two vectors
type IsAdditive f a = (Additive f, Box f a) Source #
Basis element
negated :: forall f a. (Functor f, Num a, Box f a) => Exp (f a) -> Exp (f a) Source #
Compute the negation of a vector
>>>negated (V2 2 4)V2 (-2) (-4)
(*^) :: forall f a. (Functor f, Num a, Box f a) => Exp a -> Exp (f a) -> Exp (f a) infixl 7 Source #
Compute the left scalar product
>>>2 *^ V2 3 4V2 6 8
(^*) :: forall f a. (Functor f, Num a, Box f a) => Exp (f a) -> Exp a -> Exp (f a) infixl 7 Source #
Compute the right scalar product
>>>V2 3 4 ^* 2V2 6 8
(^/) :: forall f a. (Functor f, Fractional a, Box f a) => Exp (f a) -> Exp a -> Exp (f a) infixl 7 Source #
Compute division by a scalar on the right
V2 4 6 ^/ 2 V2 2 3
(/^) :: forall f a. (Functor f, Fractional a, Box f a) => Exp a -> Exp (f a) -> Exp (f a) infixl 7 Source #
Compute division of a scalar on the left
>>>4 /^ V2 2 4V2 2 1
(+^) :: forall f a. (Functor f, Num a, Box f a) => Exp a -> Exp (f a) -> Exp (f a) infixl 6 Source #
Addition with a scalar on the left
>>>2 +^ V2 3 4V2 5 4
(^+) :: forall f a. (Functor f, Num a, Box f a) => Exp (f a) -> Exp a -> Exp (f a) infixl 6 Source #
Addition with a scalar on the right
>>>V2 1 2 ^+ 3V2 4 3