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

Data.LinearMap

Description

Linear maps

Synopsis

# Documentation

data u :-* v infixr 1 #

Linear map, represented as an optional memo-trie from basis to values, where Nothing means the zero map (an optimization).

Instances
 (HasTrie (Basis u), AdditiveGroup v) => AdditiveGroup (u :-* v) # Instance detailsDefined in Data.LinearMap MethodszeroV :: u :-* v #(^+^) :: (u :-* v) -> (u :-* v) -> u :-* v #negateV :: (u :-* v) -> u :-* v #(^-^) :: (u :-* v) -> (u :-* v) -> u :-* v # (HasTrie (Basis u), VectorSpace v) => VectorSpace (u :-* v) # Instance detailsDefined in Data.LinearMap Associated Typestype Scalar (u :-* v) :: Type # Methods(*^) :: Scalar (u :-* v) -> (u :-* v) -> u :-* v # type Scalar (u :-* v) # Instance detailsDefined in Data.LinearMap type Scalar (u :-* v) = Scalar v

linear :: (HasBasis u, HasTrie (Basis u)) => (u -> v) -> u :-* v #

Function (assumed linear) as linear map.

lapply :: (VectorSpace v, Scalar u ~ Scalar v, HasBasis u, HasTrie (Basis u)) => (u :-* v) -> u -> v #

Apply a linear map to a vector.

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

Evaluate a linear map on a basis element.

idL :: (HasBasis u, HasTrie (Basis u)) => u :-* u #

Identity linear map

(*.*) :: (HasTrie (Basis u), HasBasis v, HasTrie (Basis v), VectorSpace w, Scalar v ~ Scalar w) => (v :-* w) -> (u :-* v) -> u :-* w infixr 9 #

Compose linear maps

inLMap :: (LMap' r s -> LMap' t u) -> (r :-* s) -> t :-* u #

inLMap2 :: (LMap' r s -> LMap' t u -> LMap' v w) -> (r :-* s) -> (t :-* u) -> v :-* w #

inLMap3 :: (LMap' r s -> LMap' t u -> LMap' v w -> LMap' x y) -> (r :-* s) -> (t :-* u) -> (v :-* w) -> x :-* y #

liftMS :: (a -> b) -> MSum a -> MSum b #

liftMS2 :: (AdditiveGroup a, AdditiveGroup b) => (a -> b -> c) -> MSum a -> MSum b -> MSum c #

liftMS3 :: (AdditiveGroup a, AdditiveGroup b, AdditiveGroup c) => (a -> b -> c -> d) -> MSum a -> MSum b -> MSum c -> MSum d #

liftL :: Functor f => (a -> b) -> MSum (f a) -> MSum (f b) #

Apply a linear function to each element of a linear map. liftL f l == linear f *.* l, but works more efficiently.

liftL2 :: (Applicative f, AdditiveGroup (f a), AdditiveGroup (f b)) => (a -> b -> c) -> MSum (f a) -> MSum (f b) -> MSum (f c) #

Apply a linear binary function (not to be confused with a bilinear function) to each element of a linear map.

liftL3 :: (Applicative f, AdditiveGroup (f a), AdditiveGroup (f b), AdditiveGroup (f c)) => (a -> b -> c -> d) -> MSum (f a) -> MSum (f b) -> MSum (f c) -> MSum (f d) #

Apply a linear ternary function (not to be confused with a trilinear function) to each element of a linear map.

exlL :: (HasBasis a, HasTrie (Basis a), HasBasis b, HasTrie (Basis b), Scalar a ~ Scalar b) => (a, b) :-* a #

exrL :: (HasBasis a, HasTrie (Basis a), HasBasis b, HasTrie (Basis b), Scalar a ~ Scalar b) => (a, b) :-* b #

forkL :: (HasTrie (Basis a), HasBasis c, HasBasis d) => (a :-* c) -> (a :-* d) -> a :-* (c, d) #

firstL :: (HasBasis u, HasBasis u', HasBasis v, HasTrie (Basis u), HasTrie (Basis v), Scalar u ~ Scalar v, Scalar u ~ Scalar u') => (u :-* u') -> (u, v) :-* (u', v) #

secondL :: (HasBasis u, HasBasis v, HasBasis v', HasTrie (Basis u), HasTrie (Basis v), Scalar u ~ Scalar v, Scalar u ~ Scalar v') => (v :-* v') -> (u, v) :-* (u, v') #

inlL :: (HasBasis a, HasTrie (Basis a), HasBasis b) => a :-* (a, b) #

inrL :: (HasBasis a, HasBasis b, HasTrie (Basis b)) => b :-* (a, b) #

joinL :: (HasBasis a, HasTrie (Basis a), HasBasis b, HasTrie (Basis b), Scalar a ~ Scalar b, Scalar a ~ Scalar c, VectorSpace c) => (a :-* c) -> (b :-* c) -> (a, b) :-* c #