CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<typename Base >
void CppAD::local::subgraph::subgraph_info::get_rev ( const player< Base > *  play,
const vector< size_t > &  dep_taddr,
addr_t  i_dep,
pod_vector< addr_t > &  subgraph 

Get the subgraph corresponding to a dependent variables (and a selected set of independent variables).

Template Parameters
Basethis operation sequence was recording using AD<Base>.
playis the operation sequence corresponding to the ADFun<Base> function.
dep_taddris the vector mapping user dependent variable indices to the correpsonding variable in the recording.
i_depis the user index for his dependent variable; that i_dep < n_dep_.
subgraphthe input size and contents of this vector do not matter. Repeated calls with the same subgraph vector should reduce the amount of memory allocation. Upon return it contains the operator indices for the subgraph corresponding to the dependent and the selected independent variables. Only selected independent variable operators InvOp are included in the subgraph. Furthermore the operator indices in subgraph are unique; i.e., if i_op != j_op then subgraph[i_op] != subgraph[j_op].
This vector must be set.
has size equal to the number of operators in play. If in_subgraph[i_op] <= n_dep_, the result for this operator depends on the selected independent variables. In addition, upon input, there is no i_op such that in_subgraph[i_op] == i_dep. Note that for user function call operators i_op, except for the first UserOp in the atomic function call sequence. For the first UserOp, if any result for the user function call depends on the selected independent variables. Except for UserOP, only operators with NumRes(op) > 0 are included in the dependency; e.g., comparision operators are not included. Upon return, some of the i_op for which in_subgraph[i_op] <= n_dep_, will be changed to in_subgraph[i_op] = i_dep.
The value process_range_[i_dep] is checked to make sure it is false. It is then set to have value true.

Definition at line 84 of file get_rev.hpp.

Referenced by CppAD::local::subgraph::subgraph_sparsity().