The OpenD Programming Language

getDerivative

Evaluates partial derivative for user-defined compiletime set of variables. First, it checks if the expression has .getDerivative methods and uses it, otherwise iterates over members with Derivative UDA and tries to find a member that holds the required partial derivative.

template getDerivative(string[] variables, bool strict = true)
ref
static if(variables.length == 0 || variables.pairwise!"a <= b".all)
getDerivative
(
T
)
(
auto ref T value
)

Parameters

variables

array that denotes partial derivative

strict

The parameter is used when the expression can't evaluate the derivative. If true, prints error at compile-time; otherwise, getDerivative returns NaN.

Meta