vector-space-0.13: Vector & affine spaces, linear maps, and derivatives

Copyright(c) Conal Elliott and Andy J Gill 2008
LicenseBSD3
Maintainerconal@conal.net, andygill@ku.edu
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell98

Data.AdditiveGroup

Description

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

Synopsis

Documentation

class AdditiveGroup v where Source #

Additive group v.

Methods

zeroV :: v Source #

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

zeroV :: (Generic v, AdditiveGroup (VRep v)) => v Source #

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

(^+^) :: v -> v -> v infixl 6 Source #

Add vectors

(^+^) :: (Generic v, AdditiveGroup (VRep v)) => v -> v -> v infixl 6 Source #

Add vectors

negateV :: v -> v Source #

Additive inverse

negateV :: (Generic v, AdditiveGroup (VRep v)) => v -> v Source #

Additive inverse

(^-^) :: v -> v -> v infixl 6 Source #

Group subtraction

Instances

AdditiveGroup Double Source # 
AdditiveGroup Float Source # 
AdditiveGroup Int Source # 
AdditiveGroup Integer Source # 
AdditiveGroup () Source # 

Methods

zeroV :: () Source #

(^+^) :: () -> () -> () Source #

negateV :: () -> () Source #

(^-^) :: () -> () -> () Source #

AdditiveGroup CSChar Source # 
AdditiveGroup CShort Source # 
AdditiveGroup CInt Source # 
AdditiveGroup CLong Source # 
AdditiveGroup CLLong Source # 
AdditiveGroup CFloat Source # 
AdditiveGroup CDouble Source # 
AdditiveGroup CIntMax Source # 
AdditiveGroup a => AdditiveGroup (Maybe a) Source # 

Methods

zeroV :: Maybe a Source #

(^+^) :: Maybe a -> Maybe a -> Maybe a Source #

negateV :: Maybe a -> Maybe a Source #

(^-^) :: Maybe a -> Maybe a -> Maybe a Source #

Integral a => AdditiveGroup (Ratio a) Source # 

Methods

zeroV :: Ratio a Source #

(^+^) :: Ratio a -> Ratio a -> Ratio a Source #

negateV :: Ratio a -> Ratio a Source #

(^-^) :: Ratio a -> Ratio a -> Ratio a Source #

(RealFloat v, AdditiveGroup v) => AdditiveGroup (Complex v) Source # 
AdditiveGroup a => AdditiveGroup (Sum a) Source # 

Methods

zeroV :: Sum a Source #

(^+^) :: Sum a -> Sum a -> Sum a Source #

negateV :: Sum a -> Sum a Source #

(^-^) :: Sum a -> Sum a -> Sum a Source #

AdditiveGroup v => AdditiveGroup (a -> v) Source # 

Methods

zeroV :: a -> v Source #

(^+^) :: (a -> v) -> (a -> v) -> a -> v Source #

negateV :: (a -> v) -> a -> v Source #

(^-^) :: (a -> v) -> (a -> v) -> a -> v Source #

(AdditiveGroup u, AdditiveGroup v) => AdditiveGroup (u, v) Source # 

Methods

zeroV :: (u, v) Source #

(^+^) :: (u, v) -> (u, v) -> (u, v) Source #

negateV :: (u, v) -> (u, v) Source #

(^-^) :: (u, v) -> (u, v) -> (u, v) Source #

(HasTrie u, AdditiveGroup v) => AdditiveGroup ((:->:) u v) Source # 

Methods

zeroV :: u :->: v Source #

(^+^) :: (u :->: v) -> (u :->: v) -> u :->: v Source #

negateV :: (u :->: v) -> u :->: v Source #

(^-^) :: (u :->: v) -> (u :->: v) -> u :->: v Source #

(HasTrie (Basis u), AdditiveGroup v) => AdditiveGroup ((:-*) u v) Source # 

Methods

zeroV :: u :-* v Source #

(^+^) :: (u :-* v) -> (u :-* v) -> u :-* v Source #

negateV :: (u :-* v) -> u :-* v Source #

(^-^) :: (u :-* v) -> (u :-* v) -> u :-* v Source #

(HasBasis a, HasTrie (Basis a), AdditiveGroup u) => AdditiveGroup ((:>) a u) Source # 

Methods

zeroV :: a :> u Source #

(^+^) :: (a :> u) -> (a :> u) -> a :> u Source #

negateV :: (a :> u) -> a :> u Source #

(^-^) :: (a :> u) -> (a :> u) -> a :> u Source #

AdditiveGroup a => AdditiveGroup (Rec0 * a s) Source # 

Methods

zeroV :: Rec0 * a s Source #

(^+^) :: Rec0 * a s -> Rec0 * a s -> Rec0 * a s Source #

negateV :: Rec0 * a s -> Rec0 * a s Source #

(^-^) :: Rec0 * a s -> Rec0 * a s -> Rec0 * a s Source #

(AdditiveGroup u, AdditiveGroup v, AdditiveGroup w) => AdditiveGroup (u, v, w) Source # 

Methods

zeroV :: (u, v, w) Source #

(^+^) :: (u, v, w) -> (u, v, w) -> (u, v, w) Source #

negateV :: (u, v, w) -> (u, v, w) Source #

(^-^) :: (u, v, w) -> (u, v, w) -> (u, v, w) Source #

(AdditiveGroup (f p), AdditiveGroup (g p)) => AdditiveGroup ((:*:) * f g p) Source # 

Methods

zeroV :: (* :*: f) g p Source #

(^+^) :: (* :*: f) g p -> (* :*: f) g p -> (* :*: f) g p Source #

negateV :: (* :*: f) g p -> (* :*: f) g p Source #

(^-^) :: (* :*: f) g p -> (* :*: f) g p -> (* :*: f) g p Source #

(AdditiveGroup u, AdditiveGroup v, AdditiveGroup w, AdditiveGroup x) => AdditiveGroup (u, v, w, x) Source # 

Methods

zeroV :: (u, v, w, x) Source #

(^+^) :: (u, v, w, x) -> (u, v, w, x) -> (u, v, w, x) Source #

negateV :: (u, v, w, x) -> (u, v, w, x) Source #

(^-^) :: (u, v, w, x) -> (u, v, w, x) -> (u, v, w, x) Source #

AdditiveGroup (f p) => AdditiveGroup (M1 * i c f p) Source # 

Methods

zeroV :: M1 * i c f p Source #

(^+^) :: M1 * i c f p -> M1 * i c f p -> M1 * i c f p Source #

negateV :: M1 * i c f p -> M1 * i c f p Source #

(^-^) :: M1 * i c f p -> M1 * i c f p -> M1 * i c f p Source #

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

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 

Fields

Instances

Functor Sum Source # 

Methods

fmap :: (a -> b) -> Sum a -> Sum b #

(<$) :: a -> Sum b -> Sum a #

Applicative Sum Source # 

Methods

pure :: a -> Sum a #

(<*>) :: Sum (a -> b) -> Sum a -> Sum b #

liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c #

(*>) :: Sum a -> Sum b -> Sum b #

(<*) :: Sum a -> Sum b -> Sum a #

Bounded a => Bounded (Sum a) Source # 

Methods

minBound :: Sum a #

maxBound :: Sum a #

Eq a => Eq (Sum a) Source # 

Methods

(==) :: Sum a -> Sum a -> Bool #

(/=) :: Sum a -> Sum a -> Bool #

Ord a => Ord (Sum a) Source # 

Methods

compare :: Sum a -> Sum a -> Ordering #

(<) :: Sum a -> Sum a -> Bool #

(<=) :: Sum a -> Sum a -> Bool #

(>) :: Sum a -> Sum a -> Bool #

(>=) :: Sum a -> Sum a -> Bool #

max :: Sum a -> Sum a -> Sum a #

min :: Sum a -> Sum a -> Sum a #

Read a => Read (Sum a) Source # 
Show a => Show (Sum a) Source # 

Methods

showsPrec :: Int -> Sum a -> ShowS #

show :: Sum a -> String #

showList :: [Sum a] -> ShowS #

AdditiveGroup a => Semigroup (Sum a) Source # 

Methods

(<>) :: Sum a -> Sum a -> Sum a #

sconcat :: NonEmpty (Sum a) -> Sum a #

stimes :: Integral b => b -> Sum a -> Sum a #

AdditiveGroup a => Monoid (Sum a) Source # 

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

AdditiveGroup a => AdditiveGroup (Sum a) Source # 

Methods

zeroV :: Sum a Source #

(^+^) :: Sum a -> Sum a -> Sum a Source #

negateV :: Sum a -> Sum a Source #

(^-^) :: Sum a -> Sum a -> Sum a Source #

inSum :: (a -> b) -> Sum a -> Sum b Source #

Application a unary function inside a Sum

inSum2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c Source #

Application a binary function inside a Sum