vector-space-0.15: 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 # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup Float Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup Int Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup Integer Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup () Source # 
Instance details

Defined in Data.AdditiveGroup

Methods

zeroV :: () Source #

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

negateV :: () -> () Source #

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

AdditiveGroup CSChar Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup CShort Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup CInt Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup CLong Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup CLLong Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup CFloat Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup CDouble Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup CIntMax Source # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup a => AdditiveGroup (Maybe a) Source # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

AdditiveGroup a => AdditiveGroup (Sum a) Source # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.LinearMap

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 # 
Instance details

Defined in Data.Maclaurin

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

Methods

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

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

Applicative Sum Source # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

Methods

minBound :: Sum a #

maxBound :: Sum a #

Eq a => Eq (Sum a) Source # 
Instance details

Defined in Data.AdditiveGroup

Methods

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

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

Ord a => Ord (Sum a) Source # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

Show a => Show (Sum a) Source # 
Instance details

Defined in Data.AdditiveGroup

Methods

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

show :: Sum a -> String #

showList :: [Sum a] -> ShowS #

AdditiveGroup a => Semigroup (Sum a) Source # 
Instance details

Defined in Data.AdditiveGroup

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 # 
Instance details

Defined in Data.AdditiveGroup

Methods

mempty :: Sum a #

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

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

AdditiveGroup a => AdditiveGroup (Sum a) Source # 
Instance details

Defined in Data.AdditiveGroup

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