struct DifferentialPair<T>

Conforms to: IDifferentiable

Description

DifferentialPair<T> is a built-in type that carries both the original and derivative value of a term. It is defined as follows:

struct DifferentialPair<T : IDifferentiable> : IDifferentiable
{
    typealias Differential = DifferentialPair<T.Differential>;
    property T p {get;}
    property T.Differential d {get;}
    static Differential dzero();
    static Differential dadd(Differential a, Differential b);
}

Differential pairs can be created via constructor or through the diffPair() operation

DifferentialPair<float> dpa = DifferentialPair<float>(1.0f, 2.0f);
DifferentialPair<float> dpa = diffPair(1.0f, 2.0f);

Note that derivative pairs are used to pass derivatives into and out of auto-diff functions. See documentation on fwd_diff and bwd_diff operators for more information.

Generic Parameters

T: IDifferentiable

Properties

d

p

v

Methods