API

API for TaylorDiff.

TaylorDiff.TaylorArrayType
TaylorArray{T, N, A, P}

Representation of Taylor polynomials in array mode.

Fields

  • value::A: zeroth order coefficient
  • partials::NTuple{P, A}: i-th element of this stores the i-th derivative
source
TaylorDiff.TaylorScalarType
TaylorScalar{T, P}

Representation of Taylor polynomials.

Fields

  • value::T: zeroth order coefficient
  • partials::NTuple{P, T}: i-th element of this stores the i-th derivative
source
TaylorDiff.TaylorScalarMethod
TaylorScalar{P}(value::T, seed::T)

Convenience function: construct a Taylor polynomial with zeroth and first order coefficient, acting as a seed.

source
TaylorDiff.TaylorScalarMethod
TaylorScalar{P}(value::T) where {T, P}

Convenience function: construct a Taylor polynomial with zeroth order coefficient.

source
TaylorDiff.can_taylorizeMethod
TaylorDiff.can_taylorize(V::Type)

Determines whether the type V is allowed as the scalar type in a Dual. By default, only <:Real types are allowed.

source
TaylorDiff.derivativeFunction
derivative(f, x, ::Val{P})
derivative(f, x, l, ::Val{P})
derivative(f!, y, x, l, ::Val{P})

Computes P-th directional derivative of f w.r.t. vector x in direction l. If x is a Number, the direction l can be omitted.

source
TaylorDiff.derivative!Function
derivative!(result, f, x, l, ::Val{P})
derivative!(result, f!, y, x, l, ::Val{P})

In-place derivative calculation APIs. result is expected to be pre-allocated and have the same shape as y.

source
TaylorDiff.derivativesFunction
derivatives(f, x, l, ::Val{P})
derivatives(f!, y, x, l, ::Val{P})

Computes all derivatives of f at x up to order P.

source
TaylorDiff.get_term_raiserMethod

Pick a strategy for raising the derivative of a function. If the derivative is like 1 over something, raise with the division rule; otherwise, raise with the multiplication rule.

source
TaylorDiff.@immutableMacro
immutable(def)

Transform a function definition to a @generated function.

  1. Allocations are removed by replacing the output with scalar variables;
  2. Loops are unrolled;
  3. Indices are modified to use 1-based indexing;
source