Copyright (c) Edward Kmett 2010-2015 BSD3 ekmett@gmail.com experimental GHC only None Haskell2010

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
 Source # Instance detailsDefined in Numeric.AD.Internal.Forward.Double Associated Types Methods Num a => Jacobian (Tower a) Source # Instance detailsDefined in Numeric.AD.Internal.Tower Associated Typestype D (Tower a) :: Type Source # Methodsunary :: (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 # Instance detailsDefined in Numeric.AD.Internal.Sparse Associated Typestype D (Sparse a) :: Type Source # Methodsunary :: (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 # Source # Instance detailsDefined in Numeric.AD.Internal.Reverse.Double Associated Typestype D (ReverseDouble s) :: Type Source # Methodsunary :: (Scalar (ReverseDouble s) -> Scalar (ReverseDouble s)) -> D (ReverseDouble s) -> ReverseDouble s -> ReverseDouble s Source #lift1 :: (Scalar (ReverseDouble s) -> Scalar (ReverseDouble s)) -> (D (ReverseDouble s) -> D (ReverseDouble s)) -> ReverseDouble s -> ReverseDouble s Source #lift1_ :: (Scalar (ReverseDouble s) -> Scalar (ReverseDouble s)) -> (D (ReverseDouble s) -> D (ReverseDouble s) -> D (ReverseDouble s)) -> ReverseDouble s -> ReverseDouble s Source #binary :: (Scalar (ReverseDouble s) -> Scalar (ReverseDouble s) -> Scalar (ReverseDouble s)) -> D (ReverseDouble s) -> D (ReverseDouble s) -> ReverseDouble s -> ReverseDouble s -> ReverseDouble s Source #lift2 :: (Scalar (ReverseDouble s) -> Scalar (ReverseDouble s) -> Scalar (ReverseDouble s)) -> (D (ReverseDouble s) -> D (ReverseDouble s) -> (D (ReverseDouble s), D (ReverseDouble s))) -> ReverseDouble s -> ReverseDouble s -> ReverseDouble s Source #lift2_ :: (Scalar (ReverseDouble s) -> Scalar (ReverseDouble s) -> Scalar (ReverseDouble s)) -> (D (ReverseDouble s) -> D (ReverseDouble s) -> D (ReverseDouble s) -> (D (ReverseDouble s), D (ReverseDouble s))) -> ReverseDouble s -> ReverseDouble s -> ReverseDouble s Source # Num a => Jacobian (Kahn a) Source # Instance detailsDefined in Numeric.AD.Internal.Kahn Associated Typestype D (Kahn a) :: Type Source # Methodsunary :: (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 # Instance detailsDefined in Numeric.AD.Internal.Forward Associated Typestype D (Forward a) :: Type Source # Methodsunary :: (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 # (Reifies s Tape, Num a) => Jacobian (Reverse s a) Source # Instance detailsDefined in Numeric.AD.Internal.Reverse Associated Typestype D (Reverse s a) :: Type Source # Methodsunary :: (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 # (Traversable f, Num a) => Jacobian (Dense f a) Source # Instance detailsDefined in Numeric.AD.Internal.Dense Associated Typestype D (Dense f a) :: Type Source # Methodsunary :: (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 #