ad-4.4.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

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 # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Double :: Type Source #

Mode Float Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Float :: Type Source #

Mode Int Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int :: Type Source #

Mode Int8 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int8 :: Type Source #

Mode Int16 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int16 :: Type Source #

Mode Int32 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int32 :: Type Source #

Mode Int64 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int64 :: Type Source #

Mode Integer Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Integer :: Type Source #

Mode Natural Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Natural :: Type Source #

Mode Word Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word :: Type Source #

Mode Word8 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word8 :: Type Source #

Mode Word16 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word16 :: Type Source #

Mode Word32 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word32 :: Type Source #

Mode Word64 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word64 :: Type Source #

Mode ForwardDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Forward.Double

Associated Types

type Scalar ForwardDouble :: Type Source #

Integral a => Mode (Ratio a) Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar (Ratio a) :: Type Source #

RealFloat a => Mode (Complex a) Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar (Complex a) :: Type Source #

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

Defined in Numeric.AD.Internal.On

Associated Types

type Scalar (On t) :: Type 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 (Id a) Source # 
Instance details

Defined in Numeric.AD.Internal.Identity

Associated Types

type Scalar (Id a) :: Type 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 # 
Instance details

Defined in Numeric.AD.Internal.Tower

Associated Types

type Scalar (Tower a) :: Type Source #

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

Defined in Numeric.AD.Internal.Sparse

Associated Types

type Scalar (Sparse a) :: Type Source #

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

Defined in Numeric.AD.Internal.Reverse.Double

Associated Types

type Scalar (ReverseDouble s) :: Type Source #

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

Defined in Numeric.AD.Internal.Kahn

Associated Types

type Scalar (Kahn a) :: Type 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 # 
Instance details

Defined in Numeric.AD.Internal.Forward

Associated Types

type Scalar (Forward a) :: Type Source #

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

Defined in Numeric.AD.Internal.Type

Associated Types

type Scalar (AD s a) :: Type 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 # 
Instance details

Defined in Numeric.AD.Internal.Reverse

Associated Types

type Scalar (Reverse s a) :: Type 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 #

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

Defined in Numeric.AD.Internal.Dense

Associated Types

type Scalar (Dense f a) :: Type 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 b, Chosen s, Scalar a ~ Scalar b) => Mode (Or s a b) Source # 
Instance details

Defined in Numeric.AD.Internal.Or

Associated Types

type Scalar (Or s a b) :: Type 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 #