Prev Next

ADFun Sequence Properties

Syntax
n = f.Domain()
m = f.Range()
p = f.Parameter(i)
u = f.use_VecAD()
v = f.size_var()

Purpose
The operations above return properties of the AD of Base operation sequence stored in the ADFun object f. (If there is no operation sequence stored in f, size_var returns zero.)

f
The object f has prototype
     const ADFun<
Basef
(see ADFun<Base> constructor ).

Domain
The result n has prototype
     size_t 
n
and is the dimension of the domain space corresponding to f. This is equal to the size of the vector x in the call
     Independent(
x)
that starting recording the operation sequence currently stored in f (see FunConstruct and Dependent ).

Range
The result m has prototype
     size_t 
m
and is the dimension of the range space corresponding to f. This is equal to the size of the vector y in syntax
     ADFun<
Base>f(x,y) or
     
f.Dependent(y)
depending on which stored the operation sequence currently in f (see FunConstruct and Dependent ).

Parameter
The argument i has prototype
     size_t 
i
and  0 \leq i < m . The result p has prototype
     bool 
p
It is true if the i-th component of range space for  F corresponds to a parameter in the operation sequence. In this case, the i-th component of  F is constant and  \[
     \D{F_i}{x_j} (x) = 0
\] 
for  j = 0 , \ldots , n-1 and all  x \in B^n .

use_VecAD
The result u has prototype
     bool 
u
If it is true, the AD of Base operation sequence stored in f contains VecAD operands. Otherwise u is false.

size_var
The result v has prototype
     size_t 
v
and is the number of variables in the operation sequence plus the following: one for a phantom variable with tape address zero, one for each component of the domain that is a parameter. The amount of work and memory necessary for computing function values and derivatives using f is roughly proportional to v.

If there is no operation sequence stored in f, size_var returns zero (see default constructor ).

Example
The file SeqProperty.cpp contains an example and test of these operations. It returns true if it succeeds and false otherwise.
Input File: omh/seq_property.omh