\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
cpp_independent#
View page sourceDeclare Independent Variables and Start Recording#
Syntax#
cppad_py::independent ( x )cppad_py::independent ( x , dynamic )Purpose#
This starts recording a_double operations. This recording is terminated, and the information is stored, by calling the d_fun_constructor. It can be terminated, and the information is lost, by calling abort_recording.
x#
This argument has prototype
const vec_double& xIts 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
const vec_double& dynamicIts 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
vec_a_double& axand is the vector of independent variables. It has size nx and for i = 0 to n -1
a_both#
this result has prototype
vec_a_double& a_bothand is the vector of both the independent variables and independent dynamic parameters. It has size nx + nd . For i = 0 to nx -1
is the i-th independent variable. For i = 0 to nd -1
is the i-th independent dynamic parameter.
Example#
Most of the c++ d_fun examples use the ax
return syntax.
The fun_dynamic_xam.cpp example uses the a_both
return syntax.