ad_fun
ADFun class - function object storing recorded AD operations
ADFun class - function object storing recorded AD operations
ADFun
Key methods:
- Forward(p, x): p-th order forward mode Taylor coefficient
- Reverse(q, w): q-th order reverse mode derivative
- Jacobian(x): Full Jacobian matrix
- Hessian(x, w): Weighted Hessian matrix
- SparseJacobian/SparseHessian: Sparse derivative computation
Algorithm
Forward mode computes derivatives in the direction of inputs. Reverse mode computes derivatives from outputs backward. Forward: O(n) per direction, Reverse: O(m) per output. Use forward when n < m, reverse when n > m.
See Also
- AD
for the scalar type that records operations
Source
Header file: `include/cppad/core/ad_fun.hpp`