ad-4.3.2.1: Automatic Differentiation

Copyright(c) Edward Kmett 2010-2015
LicenseBSD3
Maintainerekmett@gmail.com
Stabilityexperimental
PortabilityGHC only
Safe HaskellNone
LanguageHaskell2010

Numeric.AD.Jacobian

Description

 

Synopsis

Documentation

class (Mode t, Mode (D t), Num (D t)) => Jacobian t where Source #

Jacobian is useful for defining new AD primitives in a fairly generic way.

Minimal complete definition

unary, lift1, lift1_, binary, lift2, lift2_

Associated Types

type D t :: * Source #

Methods

unary :: (Scalar t -> Scalar t) -> D t -> t -> t Source #

lift1 :: (Scalar t -> Scalar t) -> (D t -> D t) -> t -> t Source #

lift1_ :: (Scalar t -> Scalar t) -> (D t -> D t -> D t) -> t -> t Source #

binary :: (Scalar t -> Scalar t -> Scalar t) -> D t -> D t -> t -> t -> t Source #

lift2 :: (Scalar t -> Scalar t -> Scalar t) -> (D t -> D t -> (D t, D t)) -> t -> t -> t Source #

lift2_ :: (Scalar t -> Scalar t -> Scalar t) -> (D t -> D t -> D t -> (D t, D t)) -> t -> t -> t Source #

Instances

Jacobian ForwardDouble Source # 
Num a => Jacobian (Tower a) Source # 

Associated Types

type D (Tower a) :: * Source #

Methods

unary :: (Scalar (Tower a) -> Scalar (Tower a)) -> D (Tower a) -> Tower a -> Tower a Source #

lift1 :: (Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a)) -> Tower a -> Tower a Source #

lift1_ :: (Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a) -> D (Tower a)) -> Tower a -> Tower a Source #

binary :: (Scalar (Tower a) -> Scalar (Tower a) -> Scalar (Tower a)) -> D (Tower a) -> D (Tower a) -> Tower a -> Tower a -> Tower a Source #

lift2 :: (Scalar (Tower a) -> Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a) -> (D (Tower a), D (Tower a))) -> Tower a -> Tower a -> Tower a Source #

lift2_ :: (Scalar (Tower a) -> Scalar (Tower a) -> Scalar (Tower a)) -> (D (Tower a) -> D (Tower a) -> D (Tower a) -> (D (Tower a), D (Tower a))) -> Tower a -> Tower a -> Tower a Source #

Num a => Jacobian (Sparse a) Source # 

Associated Types

type D (Sparse a) :: * Source #

Methods

unary :: (Scalar (Sparse a) -> Scalar (Sparse a)) -> D (Sparse a) -> Sparse a -> Sparse a Source #

lift1 :: (Scalar (Sparse a) -> Scalar (Sparse a)) -> (D (Sparse a) -> D (Sparse a)) -> Sparse a -> Sparse a Source #

lift1_ :: (Scalar (Sparse a) -> Scalar (Sparse a)) -> (D (Sparse a) -> D (Sparse a) -> D (Sparse a)) -> Sparse a -> Sparse a Source #

binary :: (Scalar (Sparse a) -> Scalar (Sparse a) -> Scalar (Sparse a)) -> D (Sparse a) -> D (Sparse a) -> Sparse a -> Sparse a -> Sparse a Source #

lift2 :: (Scalar (Sparse a) -> Scalar (Sparse a) -> Scalar (Sparse a)) -> (D (Sparse a) -> D (Sparse a) -> (D (Sparse a), D (Sparse a))) -> Sparse a -> Sparse a -> Sparse a Source #

lift2_ :: (Scalar (Sparse a) -> Scalar (Sparse a) -> Scalar (Sparse a)) -> (D (Sparse a) -> D (Sparse a) -> D (Sparse a) -> (D (Sparse a), D (Sparse a))) -> Sparse a -> Sparse a -> Sparse a Source #

Num a => Jacobian (Kahn a) Source # 

Associated Types

type D (Kahn a) :: * Source #

Methods

unary :: (Scalar (Kahn a) -> Scalar (Kahn a)) -> D (Kahn a) -> Kahn a -> Kahn a Source #

lift1 :: (Scalar (Kahn a) -> Scalar (Kahn a)) -> (D (Kahn a) -> D (Kahn a)) -> Kahn a -> Kahn a Source #

lift1_ :: (Scalar (Kahn a) -> Scalar (Kahn a)) -> (D (Kahn a) -> D (Kahn a) -> D (Kahn a)) -> Kahn a -> Kahn a Source #

binary :: (Scalar (Kahn a) -> Scalar (Kahn a) -> Scalar (Kahn a)) -> D (Kahn a) -> D (Kahn a) -> Kahn a -> Kahn a -> Kahn a Source #

lift2 :: (Scalar (Kahn a) -> Scalar (Kahn a) -> Scalar (Kahn a)) -> (D (Kahn a) -> D (Kahn a) -> (D (Kahn a), D (Kahn a))) -> Kahn a -> Kahn a -> Kahn a Source #

lift2_ :: (Scalar (Kahn a) -> Scalar (Kahn a) -> Scalar (Kahn a)) -> (D (Kahn a) -> D (Kahn a) -> D (Kahn a) -> (D (Kahn a), D (Kahn a))) -> Kahn a -> Kahn a -> Kahn a Source #

Num a => Jacobian (Forward a) Source # 

Associated Types

type D (Forward a) :: * Source #

Methods

unary :: (Scalar (Forward a) -> Scalar (Forward a)) -> D (Forward a) -> Forward a -> Forward a Source #

lift1 :: (Scalar (Forward a) -> Scalar (Forward a)) -> (D (Forward a) -> D (Forward a)) -> Forward a -> Forward a Source #

lift1_ :: (Scalar (Forward a) -> Scalar (Forward a)) -> (D (Forward a) -> D (Forward a) -> D (Forward a)) -> Forward a -> Forward a Source #

binary :: (Scalar (Forward a) -> Scalar (Forward a) -> Scalar (Forward a)) -> D (Forward a) -> D (Forward a) -> Forward a -> Forward a -> Forward a Source #

lift2 :: (Scalar (Forward a) -> Scalar (Forward a) -> Scalar (Forward a)) -> (D (Forward a) -> D (Forward a) -> (D (Forward a), D (Forward a))) -> Forward a -> Forward a -> Forward a Source #

lift2_ :: (Scalar (Forward a) -> Scalar (Forward a) -> Scalar (Forward a)) -> (D (Forward a) -> D (Forward a) -> D (Forward a) -> (D (Forward a), D (Forward a))) -> Forward a -> Forward a -> Forward a Source #

(Traversable f, Num a) => Jacobian (Dense f a) Source # 

Associated Types

type D (Dense f a) :: * Source #

Methods

unary :: (Scalar (Dense f a) -> Scalar (Dense f a)) -> D (Dense f a) -> Dense f a -> Dense f a Source #

lift1 :: (Scalar (Dense f a) -> Scalar (Dense f a)) -> (D (Dense f a) -> D (Dense f a)) -> Dense f a -> Dense f a Source #

lift1_ :: (Scalar (Dense f a) -> Scalar (Dense f a)) -> (D (Dense f a) -> D (Dense f a) -> D (Dense f a)) -> Dense f a -> Dense f a Source #

binary :: (Scalar (Dense f a) -> Scalar (Dense f a) -> Scalar (Dense f a)) -> D (Dense f a) -> D (Dense f a) -> Dense f a -> Dense f a -> Dense f a Source #

lift2 :: (Scalar (Dense f a) -> Scalar (Dense f a) -> Scalar (Dense f a)) -> (D (Dense f a) -> D (Dense f a) -> (D (Dense f a), D (Dense f a))) -> Dense f a -> Dense f a -> Dense f a Source #

lift2_ :: (Scalar (Dense f a) -> Scalar (Dense f a) -> Scalar (Dense f a)) -> (D (Dense f a) -> D (Dense f a) -> D (Dense f a) -> (D (Dense f a), D (Dense f a))) -> Dense f a -> Dense f a -> Dense f a Source #

(Reifies * s Tape, Num a) => Jacobian (Reverse s a) Source # 

Associated Types

type D (Reverse s a) :: * Source #

Methods

unary :: (Scalar (Reverse s a) -> Scalar (Reverse s a)) -> D (Reverse s a) -> Reverse s a -> Reverse s a Source #

lift1 :: (Scalar (Reverse s a) -> Scalar (Reverse s a)) -> (D (Reverse s a) -> D (Reverse s a)) -> Reverse s a -> Reverse s a Source #

lift1_ :: (Scalar (Reverse s a) -> Scalar (Reverse s a)) -> (D (Reverse s a) -> D (Reverse s a) -> D (Reverse s a)) -> Reverse s a -> Reverse s a Source #

binary :: (Scalar (Reverse s a) -> Scalar (Reverse s a) -> Scalar (Reverse s a)) -> D (Reverse s a) -> D (Reverse s a) -> Reverse s a -> Reverse s a -> Reverse s a Source #

lift2 :: (Scalar (Reverse s a) -> Scalar (Reverse s a) -> Scalar (Reverse s a)) -> (D (Reverse s a) -> D (Reverse s a) -> (D (Reverse s a), D (Reverse s a))) -> Reverse s a -> Reverse s a -> Reverse s a Source #

lift2_ :: (Scalar (Reverse s a) -> Scalar (Reverse s a) -> Scalar (Reverse s a)) -> (D (Reverse s a) -> D (Reverse s a) -> D (Reverse s a) -> (D (Reverse s a), D (Reverse s a))) -> Reverse s a -> Reverse s a -> Reverse s a Source #