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.Mode

Contents

Description

 

Synopsis

AD modes

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

Minimal complete definition

auto

Associated Types

type Scalar t Source #

Methods

isKnownConstant :: t -> Bool Source #

allowed to return False for items with a zero derivative, but we'll give more NaNs than strictly necessary

isKnownZero :: t -> Bool Source #

allowed to return False for zero, but we give more NaN's than strictly necessary then

auto :: Scalar t -> t Source #

Embed a constant

(*^) :: Scalar t -> t -> t infixr 7 Source #

Scalar-vector multiplication

(^*) :: t -> Scalar t -> t infixl 7 Source #

Vector-scalar multiplication

(^/) :: Fractional (Scalar t) => t -> Scalar t -> t infixr 7 Source #

Scalar division

zero :: t Source #

zero = lift 0

Instances

Mode Double Source # 
Mode Float Source # 
Mode Int Source # 
Mode Int8 Source # 
Mode Int16 Source # 
Mode Int32 Source # 
Mode Int64 Source # 
Mode Integer Source # 
Mode Word Source # 
Mode Word8 Source # 
Mode Word16 Source # 
Mode Word32 Source # 
Mode Word64 Source # 
Mode Natural Source # 
Mode ForwardDouble Source # 
Integral a => Mode (Ratio a) Source # 

Associated Types

type Scalar (Ratio a) :: * Source #

RealFloat a => Mode (Complex a) Source # 
Num a => Mode (Id a) Source # 

Associated Types

type Scalar (Id a) :: * Source #

Methods

isKnownConstant :: Id a -> Bool Source #

isKnownZero :: Id a -> Bool Source #

auto :: Scalar (Id a) -> Id a Source #

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

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

(^/) :: Id a -> Scalar (Id a) -> Id a Source #

zero :: Id a Source #

Num a => Mode (Tower a) Source # 

Associated Types

type Scalar (Tower a) :: * Source #

Num a => Mode (Sparse a) Source # 

Associated Types

type Scalar (Sparse a) :: * Source #

(Mode t, Mode (Scalar t)) => Mode (On t) Source # 

Associated Types

type Scalar (On t) :: * Source #

Methods

isKnownConstant :: On t -> Bool Source #

isKnownZero :: On t -> Bool Source #

auto :: Scalar (On t) -> On t Source #

(*^) :: Scalar (On t) -> On t -> On t Source #

(^*) :: On t -> Scalar (On t) -> On t Source #

(^/) :: On t -> Scalar (On t) -> On t Source #

zero :: On t Source #

Num a => Mode (Kahn a) Source # 

Associated Types

type Scalar (Kahn a) :: * Source #

Methods

isKnownConstant :: Kahn a -> Bool Source #

isKnownZero :: Kahn a -> Bool Source #

auto :: Scalar (Kahn a) -> Kahn a Source #

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

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

(^/) :: Kahn a -> Scalar (Kahn a) -> Kahn a Source #

zero :: Kahn a Source #

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

Associated Types

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

Methods

isKnownConstant :: Dense f a -> Bool Source #

isKnownZero :: Dense f a -> Bool Source #

auto :: Scalar (Dense f a) -> Dense f a Source #

(*^) :: Scalar (Dense f a) -> Dense f a -> Dense f a Source #

(^*) :: Dense f a -> Scalar (Dense f a) -> Dense f a Source #

(^/) :: Dense f a -> Scalar (Dense f a) -> Dense f a Source #

zero :: Dense f a Source #

Mode a => Mode (AD s a) Source # 

Associated Types

type Scalar (AD s a) :: * Source #

Methods

isKnownConstant :: AD s a -> Bool Source #

isKnownZero :: AD s a -> Bool Source #

auto :: Scalar (AD s a) -> AD s a Source #

(*^) :: Scalar (AD s a) -> AD s a -> AD s a Source #

(^*) :: AD s a -> Scalar (AD s a) -> AD s a Source #

(^/) :: AD s a -> Scalar (AD s a) -> AD s a Source #

zero :: AD s a Source #

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

Associated Types

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

Methods

isKnownConstant :: Reverse s a -> Bool Source #

isKnownZero :: Reverse s a -> Bool Source #

auto :: Scalar (Reverse s a) -> Reverse s a Source #

(*^) :: Scalar (Reverse s a) -> Reverse s a -> Reverse s a Source #

(^*) :: Reverse s a -> Scalar (Reverse s a) -> Reverse s a Source #

(^/) :: Reverse s a -> Scalar (Reverse s a) -> Reverse s a Source #

zero :: Reverse s a Source #

(Mode a, Mode b, Chosen s, (~) * (Scalar a) (Scalar b)) => Mode (Or s a b) Source # 

Associated Types

type Scalar (Or s a b) :: * Source #

Methods

isKnownConstant :: Or s a b -> Bool Source #

isKnownZero :: Or s a b -> Bool Source #

auto :: Scalar (Or s a b) -> Or s a b Source #

(*^) :: Scalar (Or s a b) -> Or s a b -> Or s a b Source #

(^*) :: Or s a b -> Scalar (Or s a b) -> Or s a b Source #

(^/) :: Or s a b -> Scalar (Or s a b) -> Or s a b Source #

zero :: Or s a b Source #