Prev Next

@(@\newcommand{\B}[1]{ {\bf #1} } \newcommand{\R}[1]{ {\rm #1} }@)@
Declare Independent Variables and Start Recording

Syntax
ax = cppad_py.independent(x)
(axadynamic) = cppad_py.independent(x)

x
This argument is a numpy vector with float elements. It specifies the number of independent variables and their values during the recording. We use nx = x.size to denote the number of independent variables.

dynamic
This argument is a numpy vector with float elements. It specifies the number of independent dynamic parameters and their values during the recording. We use nd = dynamic.size to denote the number of independent dynamic parameters.

ax
This result is a numpy vector with a_double elements. This is the vector of independent variables. It has size nx and for i = 0 to n-1
     
ax[i].value() == x[i]

adynamic
This result is a numpy vector with a_double elements. This is the vector of independent dynamic parameters. It has size nd and for i = 0 to n-1
     
adynamic[i].value() == dynamic[i]

Purpose
This starts a recording of the a_double operations. This recording is terminated, and the information is stored, by calling the d_fun constructor . It is terminated, and the information is lost, by calling abort_recording .

Example
Most of the python d_fun examples use this function. The fun_dynamic_xam.py uses the syntax that includes dynamic parameters.
Input File: lib/python/independent.py