Prev Next

@(@\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }@)@
Is an AD Object a Parameter or Variable

b = Parameter(x)
b = Variable(x)

Determine if x is a parameter or variable .

The argument x has prototype
     const AD<
Base>    &x
     const VecAD<
Base> &x

The return value b has prototype
The return value for Parameter (Variable) is true if and only if x is a parameter (variable). Note that a VecAD<Base> object is a variable if any element of the vector depends on the independent variables.

Operation Sequence
The result of this operation is not an AD of Base object. Thus it will not be recorded as part of an AD of Base operation sequence .

The file par_var.cpp contains an example and test of these functions. It returns true if it succeeds and false otherwise.
Input File: cppad/core/par_var.hpp