lines 14-102 of file: lib/cplusplus/fun.cpp {xrst_begin cpp_independent} {xrst_spell nd nx } Declare Independent Variables and Start Recording ################################################# Syntax ****** | *ax* = ``cppad_py::independent`` ( *x* ) | *a_both* = ``cppad_py::independent`` ( *x* , *dynamic* ) Purpose ******* This starts recording :ref:`a_double-name` operations. This recording is terminated, and the information is stored, by calling the :ref:`d_fun_constructor`. It can be terminated, and the information is lost, by calling :ref:`abort_recording`. x * This argument has prototype | |tab| ``const vec_double&`` *x* Its specifies the number of independent variables and their values during the recording. We use the notation *nx* = *x*\ ``.size`` () to denote the number of independent variables. dynamic ******* This argument has prototype | |tab| ``const vec_double&`` *dynamic* Its specifies the number of independent dynamic parameters and their values during the recording. We use the notation *nd* = *dynamic*\ ``.size`` () to denote the number of independent variables. ax ** This result has prototype | |tab| ``vec_a_double&`` *ax* and is the vector of independent variables. It has size *nx* and for *i* = 0 to *n* -1 | |tab| *ax* [ *i* ] == *x* [ *i* ] a_both ****** this result has prototype | |tab| ``vec_a_double&`` *a_both* and is the vector of both the independent variables and independent dynamic parameters. It has size *nx* + *nd* . For *i* = 0 to *nx* -1 | |tab| *a_both* [ *i* ] == *x* [ *i* ] is the *i*-th independent variable. For *i* = 0 to *nd* -1 | |tab| *a_both* [ *nx* + *i* ] == *dynamic* [ *i* ] is the *i*-th independent dynamic parameter. {xrst_toc_hidden example/cplusplus/fun_dynamic_xam.cpp } Example ******* Most of the c++ ``d_fun`` examples use the *ax* return syntax. The :ref:`fun_dynamic_xam.cpp-name` example uses the *a_both* return syntax. {xrst_end cpp_independent}