vector-space-0.7.6: Vector & affine spaces, linear maps, and derivatives (requires ghc 6.9 or better)

Stability experimental conal@conal.net, andygill@ku.edu

Data.AdditiveGroup

Description

Groups: zero, addition, and negation (additive inverse)

Synopsis

# Documentation

class AdditiveGroup v whereSource

Additive group `v`.

Methods

zeroV :: vSource

The zero element: identity for '(^+^)'

(^+^) :: v -> v -> vSource

Add vectors

negateV :: v -> vSource

Additive inverse

Instances

 AdditiveGroup Double AdditiveGroup Float AdditiveGroup Int AdditiveGroup Integer AdditiveGroup () (RealFloat v, AdditiveGroup v) => AdditiveGroup (Complex v) AdditiveGroup a => AdditiveGroup (Maybe a) AdditiveGroup a => AdditiveGroup (Sum a) AdditiveGroup v => AdditiveGroup (a -> v) (AdditiveGroup u, AdditiveGroup v) => AdditiveGroup (u, v) (HasTrie u, AdditiveGroup v) => AdditiveGroup (:->: u v) (HasTrie (Basis u), AdditiveGroup v) => AdditiveGroup (:-* u v) (HasBasis a, HasTrie (Basis a), AdditiveGroup u) => AdditiveGroup (:> a u) (AdditiveGroup u, AdditiveGroup v, AdditiveGroup w) => AdditiveGroup (u, v, w) (AdditiveGroup u, AdditiveGroup v, AdditiveGroup w, AdditiveGroup x) => AdditiveGroup (u, v, w, x)

(^-^) :: AdditiveGroup v => v -> v -> vSource

Group subtraction

sumV :: (Foldable f, AdditiveGroup v) => f v -> vSource

Sum over several vectors

newtype Sum a Source

Monoid under group addition. Alternative to the `Sum` in Data.Monoid, which uses `Num` instead of `AdditiveGroup`.

Constructors

 Sum FieldsgetSum :: a

Instances

 Functor Sum Applicative Sum Bounded a => Bounded (Sum a) Eq a => Eq (Sum a) Ord a => Ord (Sum a) Read a => Read (Sum a) Show a => Show (Sum a) AdditiveGroup a => Monoid (Sum a) AdditiveGroup a => AdditiveGroup (Sum a)

inSum :: (a -> b) -> Sum a -> Sum bSource

Application a unary function inside a `Sum`

inSum2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum cSource

Application a binary function inside a `Sum`