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

Contents

Description

 
Synopsis

AD modes

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

Minimal complete definition

Nothing

Associated Types

type Scalar t Source #

type Scalar t = t

Methods

isKnownConstant :: t -> Bool Source #

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

asKnownConstant :: t -> Maybe (Scalar t) Source #

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

default auto :: Scalar t ~ t => Scalar t -> t Source #

(*^) :: 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

Instances details
Mode ForwardDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Forward.Double

Associated Types

type Scalar ForwardDouble Source #

Mode KahnDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Kahn.Double

Associated Types

type Scalar KahnDouble Source #

Mode KahnFloat Source # 
Instance details

Defined in Numeric.AD.Internal.Kahn.Float

Associated Types

type Scalar KahnFloat Source #

Mode SparseDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Sparse.Double

Associated Types

type Scalar SparseDouble Source #

Mode TowerDouble Source # 
Instance details

Defined in Numeric.AD.Internal.Tower.Double

Associated Types

type Scalar TowerDouble Source #

Mode Int16 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int16 Source #

Mode Int32 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int32 Source #

Mode Int64 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int64 Source #

Mode Int8 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int8 Source #

Mode Word16 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word16 Source #

Mode Word32 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word32 Source #

Mode Word64 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word64 Source #

Mode Word8 Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word8 Source #

Mode Integer Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Integer Source #

Mode Natural Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Natural Source #

Mode Double Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Double Source #

Mode Float Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Float Source #

Mode Int Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Int Source #

Mode Word Source # 
Instance details

Defined in Numeric.AD.Mode

Associated Types

type Scalar Word Source #

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

Defined in Numeric.AD.Internal.Forward

Associated Types

type Scalar (Forward a) Source #

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

Defined in Numeric.AD.Internal.Identity

Associated Types

type Scalar (Id a) Source #

Methods

isKnownConstant :: Id a -> Bool Source #

asKnownConstant :: Id a -> Maybe (Scalar (Id a)) 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 (Kahn a) Source # 
Instance details

Defined in Numeric.AD.Internal.Kahn

Associated Types

type Scalar (Kahn a) Source #

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

Defined in Numeric.AD.Internal.On

Associated Types

type Scalar (On t) Source #

Methods

isKnownConstant :: On t -> Bool Source #

asKnownConstant :: On t -> Maybe (Scalar (On t)) 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 #

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

Defined in Numeric.AD.Internal.Reverse.Double

Associated Types

type Scalar (ReverseDouble s) Source #

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

Defined in Numeric.AD.Internal.Sparse

Associated Types

type Scalar (Sparse a) Source #

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

Defined in Numeric.AD.Internal.Tower

Associated Types

type Scalar (Tower a) Source #

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

Defined in Numeric.AD.Mode

Associated Types

type Scalar (Complex a) Source #

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

Defined in Numeric.AD.Mode

Associated Types

type Scalar (Ratio 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) Source #

Methods

isKnownConstant :: Dense f a -> Bool Source #

asKnownConstant :: Dense f a -> Maybe (Scalar (Dense f a)) 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 #

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

Defined in Numeric.AD.Internal.Dense.Representable

Associated Types

type Scalar (Repr f a) Source #

Methods

isKnownConstant :: Repr f a -> Bool Source #

asKnownConstant :: Repr f a -> Maybe (Scalar (Repr f a)) Source #

isKnownZero :: Repr f a -> Bool Source #

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

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

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

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

zero :: Repr f 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) Source #

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

Defined in Numeric.AD.Internal.Type

Associated Types

type Scalar (AD s a) Source #

Methods

isKnownConstant :: AD s a -> Bool Source #

asKnownConstant :: AD s a -> Maybe (Scalar (AD s a)) 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 #

(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) Source #

Methods

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

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

pattern KnownZero :: Mode s => s Source #

pattern Auto :: Mode s => Scalar s -> s Source #