vector-space-0.16: Vector & affine spaces, linear maps, and derivatives
Copyright (c) Conal Elliott 2008-2016
License BSD3
Maintainer conal@conal.net
Stability experimental
Safe Haskell None
Language Haskell98

Data.LinearMap

Description

Linear maps

Synopsis

Documentation

data u :-* v infixr 1 Source #

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

Instances

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

Defined in Data.LinearMap

( HasTrie ( Basis u), VectorSpace v) => VectorSpace (u :-* v) Source #
Instance details

Defined in Data.LinearMap

Associated Types

type Scalar (u :-* v) Source #

Methods

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

type Scalar (u :-* v) Source #
Instance details

Defined in Data.LinearMap

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

Function (assumed linear) as linear map.

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

Apply a linear map to a vector.

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

Evaluate a linear map on a basis element.

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

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 Source #

Compose linear maps

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

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

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

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

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

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

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

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) Source #

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) Source #

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