Is an AD Object a Parameter or Variable
Keywords: is ad object parameter variable syntax purpose x b operation sequence example

| Prev | Next |  |  |  |  |  |  |

Is an AD Object a Parameter or Variable
Syntax
`b = Parameter(x)` `
` `b = Variable(x)`
Purpose
Determine if `x` is a parameter or variable .
x
The argument `x` has prototype `
const AD<Base> &x
const VecAD<Base> &x
`
b
The return value `b` has prototype `
bool b
` 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 .
Example
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/local/par_var.hpp