lines 8-60 of file: cpp/xam/gradient/check_grad_ode.hpp {xrst_begin check_grad_ode.hpp} C++ Check Gradient of an_ode ############################ Syntax ****** | |tab| ``# include "check_grad_ode.hpp"`` | |tab| *ok* = check_grad_ode( *grad_ode* ) Prototype ********* {xrst_literal // BEGIN PROTOTYPE // END PROTOTYPE } grad_ode ******** Is a :ref:`cpp_fun_obj-name` object that computes the gradient for the ref:`cpp_an_ode-name` algorithm. ok ** is true (false) if the gradient passes (fails) the test. Gradient ******** We use :math:`r` to denote the range space component of the an_ode algorithm that we are computing the gradient for. .. math:: y_r (t) = \frac{ t^{r+1} }{ (r+1)! } \prod{j=0}^r x_j .. math:: \frac{ \partial y_r (t) }{ \partial x_j } = \begin{cases} y_r (t) / x_j & \text{if} \; j \leq r \\ 0 & \text{otherwise} \end{cases} Source Code *********** {xrst_literal // BEGIN C++ // END C++ } {xrst_end check_grad_ode.hpp}