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

Data.Maclaurin

Contents

Description

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

Synopsis

Documentation

data a :> b Source #

Tower of derivatives.

Constructors

D b (a :-* (a :> b)) infixr 9

Instances

Instances details
( VectorSpace s, HasBasis s, HasTrie ( Basis s), HasNormal ( Two s :> Three s)) => HasNormal ( Three ( Two s :> s)) Source #
Instance details

Defined in Data.Cross

( VectorSpace s, HasBasis s, HasTrie ( Basis s), Basis s ~ ()) => HasNormal ( Two ( One s :> s)) Source #
Instance details

Defined in Data.Cross

Eq (a :> b) Source #
Instance details

Defined in Data.Maclaurin

( HasBasis a, s ~ Scalar a, HasTrie ( Basis a), Floating s, VectorSpace s, Scalar s ~ s) => Floating (a :> s) Source #
Instance details

Defined in Data.Maclaurin

( HasBasis a, s ~ Scalar a, HasTrie ( Basis a), Fractional s, VectorSpace s, Scalar s ~ s) => Fractional (a :> s) Source #
Instance details

Defined in Data.Maclaurin

( HasBasis a, s ~ Scalar a, HasTrie ( Basis a), Num s, VectorSpace s, Scalar s ~ s) => Num (a :> s) Source #
Instance details

Defined in Data.Maclaurin

( AdditiveGroup b, HasBasis a, HasTrie ( Basis a), OrdB b, IfB b, Ord b) => Ord (a :> b) Source #
Instance details

Defined in Data.Maclaurin

Show b => Show (a :> b) Source #
Instance details

Defined in Data.Maclaurin

( AdditiveGroup v, HasBasis u, HasTrie ( Basis u), IfB v) => IfB (u :> v) Source #
Instance details

Defined in Data.Maclaurin

Methods

ifB :: bool ~ BooleanOf (u :> v) => bool -> (u :> v) -> (u :> v) -> u :> v Source #

OrdB v => OrdB (u :> v) Source #
Instance details

Defined in Data.Maclaurin

Methods

(<*) :: bool ~ BooleanOf (u :> v) => (u :> v) -> (u :> v) -> bool Source #

(<=*) :: bool ~ BooleanOf (u :> v) => (u :> v) -> (u :> v) -> bool Source #

(>*) :: bool ~ BooleanOf (u :> v) => (u :> v) -> (u :> v) -> bool Source #

(>=*) :: bool ~ BooleanOf (u :> v) => (u :> v) -> (u :> v) -> bool Source #

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

Defined in Data.Maclaurin

( InnerSpace u, s ~ Scalar u, AdditiveGroup s, HasBasis a, HasTrie ( Basis a)) => InnerSpace (a :> u) Source #
Instance details

Defined in Data.Maclaurin

Methods

(<.>) :: (a :> u) -> (a :> u) -> Scalar (a :> u) Source #

( HasBasis a, HasTrie ( Basis a), VectorSpace u) => VectorSpace (a :> u) Source #
Instance details

Defined in Data.Maclaurin

Associated Types

type Scalar (a :> u) Source #

Methods

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

( HasBasis a, HasTrie ( Basis a), VectorSpace v, HasCross3 v) => HasCross3 (a :> v) Source #
Instance details

Defined in Data.Cross

Methods

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

( HasTrie ( Basis a), HasCross2 v) => HasCross2 (a :> v) Source #
Instance details

Defined in Data.Cross

Methods

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

( Num s, HasTrie ( Basis (s, s)), HasBasis s, Basis s ~ ()) => HasNormal ( Two s :> Three s) Source #
Instance details

Defined in Data.Cross

( HasBasis s, HasTrie ( Basis s), Basis s ~ ()) => HasNormal ( One s :> Two s) Source #
Instance details

Defined in Data.Cross

type BooleanOf (a :> b) Source #
Instance details

Defined in Data.Maclaurin

type Scalar (a :> u) Source #
Instance details

Defined in Data.Maclaurin

derivAtBasis :: ( HasTrie ( Basis a), HasBasis a, AdditiveGroup b) => (a :> b) -> Basis a -> a :> b Source #

Sample the derivative at a basis element. Optimized for partial application to save work for non-scalar derivatives.

type (:~>) a b = a -> a :> b Source #

Infinitely differentiable functions

pureD :: ( AdditiveGroup b, HasBasis a, HasTrie ( Basis a)) => b -> a :> b Source #

Constant derivative tower.

fmapD :: HasTrie ( Basis a) => (b -> c) -> (a :> b) -> a :> c Source #

Map a linear function over a derivative tower.

(<$>>) :: HasTrie ( Basis a) => (b -> c) -> (a :> b) -> a :> c infixl 4 Source #

Map a linear function over a derivative tower.

liftD2 :: ( HasBasis a, HasTrie ( Basis a), AdditiveGroup b, AdditiveGroup c) => (b -> c -> d) -> (a :> b) -> (a :> c) -> a :> d Source #

Apply a linear binary function over derivative towers.

liftD3 :: ( HasBasis a, HasTrie ( Basis a), AdditiveGroup b, AdditiveGroup c, AdditiveGroup d) => (b -> c -> d -> e) -> (a :> b) -> (a :> c) -> (a :> d) -> a :> e Source #

Apply a linear ternary function over derivative towers.

idD :: ( VectorSpace u, HasBasis u, HasTrie ( Basis u)) => u :~> u Source #

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

linearD :: ( HasBasis u, HasTrie ( Basis u), AdditiveGroup v) => (u -> v) -> u :~> v Source #

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

distrib :: forall a b c u. ( HasBasis a, HasTrie ( Basis a), AdditiveGroup u) => (b -> c -> u) -> (a :> b) -> (a :> c) -> a :> u Source #

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

(>-<) :: ( HasBasis a, HasTrie ( Basis a), VectorSpace u) => (u -> u) -> ((a :> u) -> a :> Scalar u) -> (a :> u) -> a :> u infix 0 Source #

Specialized chain rule. See also (\@.)

Misc

untripleD :: HasTrie ( Basis a) => (a :> (b, c, d)) -> (a :> b, a :> c, a :> d) Source #