2 # ifndef CPPAD_LOCAL_SUBGRAPH_INIT_REV_HPP
3 # define CPPAD_LOCAL_SUBGRAPH_INIT_REV_HPP
19 namespace CppAD {
namespace local {
namespace subgraph {
64 template <
typename Base,
typename BoolVector>
67 const BoolVector& select_domain )
80 for(
size_t j = 0; j <
n_ind_; ++j)
85 for(
size_t i = 0; i <
n_dep_; ++i)
98 size_t count_independent = 0;
100 bool begin_atomic_call =
false;
101 for(
size_t i_op = 0; i_op <
n_op_; ++i_op)
116 if( select_domain[j] )
127 begin_atomic_call = not begin_atomic_call;
128 if( begin_atomic_call )
130 for(
size_t j = 0; j < argument_variable.
size(); ++j)
131 {
size_t j_var = argument_variable[j];
132 size_t j_op = play->
var2op(j_var);
150 for(
size_t j = 0; j < argument_variable.
size(); ++j)
151 {
size_t j_var = argument_variable[j];
152 size_t j_op = play->
var2op(j_var);
163 count_independent ==
size_t(select_domain.size())
size_t n_op_
number of operatros in operation sequence
void resize(size_t n)
resize the vector (existing elements preserved when n <= capacity_).
subgraph information attached to a operation sequence
CPPAD_TAPE_ADDR_TYPE addr_t
Class used to store and play back an operation sequence recording.
size_t NumRes(OpCode op)
Number of variables resulting from the specified operation.
size_t n_dep_
number of dependent variables for this function
void get_argument_variable(const player< Base > *play, size_t i_op, pod_vector< size_t > &variable, pod_vector< bool > &work)
Determine the set of arguments, for an operator, that are variables.
pod_vector< bool > process_range_
flags which dependent variables have been processed since the previous init_rev
void init_rev(const player< Base > *play, const BoolVector &select_domain)
Initialize in_subgraph corresponding to a single dependent variable (and a selected set of independen...
OpCode
Type used to distinguish different AD< Base > atomic operations.
pod_vector< addr_t > in_subgraph_
flags which operatiors are in subgraph (size zero or n_op_).
pod_vector< addr_t > map_user_op_
Mapping atomic call operators to UserOp that begins call sequence, other operators are not changed by...
size_t size(void) const
current number of elements in this vector.
#define CPPAD_ASSERT_UNKNOWN(exp)
Check that exp is true, if not terminate execution.
size_t num_op_rec(void) const
Fetch number of operators in the recording.
size_t n_ind_
number of independent variables for this function
size_t var2op(size_t var_index) const
fetch the operator corresponding to a primary variable
OpCode GetOp(size_t i) const
fetch an operator from the recording.
pod_vector< bool > select_domain_
flags which dependent variables are selected