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

Stability experimental conal@conal.net

Data.Maclaurin

Description

Infinite derivative towers via linear maps, using the Maclaurin representation. See blog posts http://conal.net/blog/tag/derivatives/.

Synopsis

# Documentation

data a :> b Source

Tower of derivatives.

Instances

 (Num s, VectorSpace s s, HasBasis s s, HasTrie (Basis s), HasNormal (:> (Two s) (Three s))) => HasNormal (Three (:> (Two s) s)) (Basis s ~ (), Num s, VectorSpace s s, HasBasis s s, HasTrie (Basis s)) => HasNormal (Two (:> (One s) s)) Eq b => Eq (:> a b) (HasBasis a s, HasTrie (Basis a), Floating s, VectorSpace s s) => Floating (:> a s) (HasBasis a s, HasTrie (Basis a), Fractional s, VectorSpace s s) => Fractional (:> a s) (HasBasis a s, HasTrie (Basis a), Num s, VectorSpace s s) => Num (:> a s) Ord b => Ord (:> a b) Show b => Show (:> a b) (HasBasis a s, HasTrie (Basis a), VectorSpace u s) => AdditiveGroup (:> a u) (HasBasis a s, HasTrie (Basis a), VectorSpace v s, HasCross3 v) => HasCross3 (:> a v) (HasBasis a s, HasTrie (Basis a), VectorSpace v s, HasCross2 v) => HasCross2 (:> a v) (Basis s ~ (), Num s, HasTrie (Basis (s, s)), HasBasis s s) => HasNormal (:> (Two s) (Three s)) (Basis s ~ (), HasBasis s s, HasTrie (Basis s)) => HasNormal (:> (One s) (Two s)) (InnerSpace u s, InnerSpace s s', VectorSpace s s, HasBasis a s, HasTrie (Basis a)) => InnerSpace (:> a u) (:> a s) (HasBasis a s, HasTrie (Basis a), VectorSpace u s, VectorSpace s s) => VectorSpace (:> a u) (:> a s)

powVal :: :> a b -> bSource

derivative :: :> a b -> a :-* (a :> b)Source

type :~> a b = a -> a :> bSource

Infinitely differentiable functions

dZero :: (AdditiveGroup b, HasBasis a s, HasTrie (Basis a)) => a :> bSource

Derivative tower full of `zeroV`.

pureD :: (AdditiveGroup b, HasBasis a s, HasTrie (Basis a)) => b -> a :> bSource

Constant derivative tower.

fmapD :: (HasTrie (Basis a), VectorSpace b s) => (b -> c) -> (a :> b) -> a :> cSource

(<\$>>) :: (HasTrie (Basis a), VectorSpace b s) => (b -> c) -> (a :> b) -> a :> cSource

Map a linear function over a derivative tower.

liftD2 :: (HasTrie (Basis a), VectorSpace b s, VectorSpace c s, VectorSpace d s) => (b -> c -> d) -> (a :> b) -> (a :> c) -> a :> dSource

Apply a linear binary function over derivative towers.

liftD3 :: (HasTrie (Basis a), VectorSpace b s, VectorSpace c s, VectorSpace d s, VectorSpace e s) => (b -> c -> d -> e) -> (a :> b) -> (a :> c) -> (a :> d) -> a :> eSource

Apply a linear ternary function over derivative towers.

idD :: (VectorSpace u s, VectorSpace (u :> u) (u :> s), VectorSpace s s, HasBasis u s, HasTrie (Basis u)) => u :~> uSource

Differentiable identity function. Sometimes called the derivation variable or similar, but it's not really a variable.

linearD :: (HasBasis u s, HasTrie (Basis u), VectorSpace v s, VectorSpace s s) => (u -> v) -> u :~> vSource

Every linear function has a constant derivative equal to the function itself (as a linear map).

distrib :: (HasBasis a s, HasTrie (Basis a), VectorSpace b s, VectorSpace c s, VectorSpace u s) => (b -> c -> u) -> (a :> b) -> (a :> c) -> a :> uSource

Derivative tower for applying a binary function that distributes over addition, such as multiplication. A bit weaker assumption than bilinearity.

(>-<) :: (HasBasis a s, HasTrie (Basis a), VectorSpace s s, VectorSpace u s) => (u -> u) -> ((a :> u) -> a :> s) -> (a :> u) -> a :> uSource

(**^) :: (HasBasis a s, HasTrie (Basis a), VectorSpace c s, VectorSpace s s) => (a :> s) -> (a :> c) -> a :> cSource

(<*.>) :: (HasBasis a s, HasTrie (Basis a), InnerSpace b s, VectorSpace s s) => (a :> b) -> (a :> b) -> a :> sSource