ad-4.5.6: Automatic Differentiation
Copyright(c) Edward Kmett 2010-2021
LicenseBSD3
Maintainerekmett@gmail.com
Stabilityexperimental
PortabilityGHC only
Safe HaskellSafe-Inferred
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.

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

Instances details
Jacobian ForwardDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Forward.Double

Associated Types

type D ForwardDouble Source #

Jacobian KahnDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Kahn.Double

Associated Types

type D KahnDouble Source #

Jacobian KahnFloat Source # 
Instance details

Defined in Numeric.AD.Internal.Kahn.Float

Associated Types

type D KahnFloat Source #

Jacobian SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Associated Types

type D SparseDouble Source #

Jacobian TowerDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Tower.Double

Associated Types

type D TowerDouble Source #

Num a => Jacobian (Forward a) Source # 
Instance details

Defined in Numeric.AD.Internal.Forward

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 #

Num a => Jacobian (Kahn a) Source # 
Instance details

Defined in Numeric.AD.Internal.Kahn

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 #

Reifies s Tape => Jacobian (ReverseDouble s) Source # 
Instance details

Defined in Numeric.AD.Internal.Reverse.Double

Associated Types

type D (ReverseDouble s) Source #

Num a => Jacobian (Sparse a) Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse

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 (Tower a) Source # 
Instance details

Defined in Numeric.AD.Internal.Tower

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 #

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

Defined in Numeric.AD.Internal.Dense

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 #

(Representable f, Num a) => Jacobian (Repr f a) Source # 
Instance details

Defined in Numeric.AD.Internal.Dense.Representable

Associated Types

type D (Repr f a) Source #

Methods

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

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

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

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

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

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

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

Defined in Numeric.AD.Internal.Reverse

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 #