Prev Next

@(@\newcommand{\B}[1]{{\bf #1}} \newcommand{\R}[1]{{\rm #1}}@)@
Create an Object With One Higher Level of AD

a_x = ad(x)

Creates an AD object a_x that records floating point operations. An adfun object can later use this recording to evaluate function values and derivatives. These later evaluations are done using the same type as x (except when x is an instance of int, the later evaluations are done using float operations).

The argument x can be an instance of an int (AD level 0), or an instance of float (AD level 0), or an a_float (AD level 1). The argument x may also be a numpy.array with one of the element types listed in the previous sentence.

If x is an instance of int or float, a_x is an a_float (AD level 1). If x is an a_float, a_x is an a2float (AD level 2). If x is an numpy.array, a_x is also an numpy.array with the same shape as x .

The file contains an example and test of this function.
Input File: pycppad/