You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling clad::differentiate(f, N) for 0 <= N <= M and T f(T x0, ..., T xM) currently would produce M+1 derivative functions f_dargN that are very similar. In fact, they only differ in how the initial derivatives of function parameters are initialized:
T f_dargN(T x0, ..., T xM) {
...
T _d_xN = 1;
T _d_xI = 0; // for all I != N
...
// common code part here
}
We can perhaps utilize it and create only one function, where initial derivatives are specified by a caller:
T f_darg(T x0, T _d_x0, ..., T xM, T _d_xM)
This would allow the caller to specify the independent variable by passing the required _d_xI equal to 1.
This is also potentially useful for deriving functions with vector inputs as each vector input has its derivative specified by a user and we no longer have to allocate it.
The text was updated successfully, but these errors were encountered:
Calling
clad::differentiate(f, N)
for0 <= N <= M
andT f(T x0, ..., T xM)
currently would produce M+1 derivative functionsf_dargN
that are very similar. In fact, they only differ in how the initial derivatives of function parameters are initialized:We can perhaps utilize it and create only one function, where initial derivatives are specified by a caller:
This would allow the caller to specify the independent variable by passing the required
_d_xI
equal to 1.This is also potentially useful for deriving functions with vector inputs as each vector input has its derivative specified by a user and we no longer have to allocate it.
The text was updated successfully, but these errors were encountered: