1 # ifndef CPPAD_LOCAL_SUBGRAPH_INFO_HPP
2 # define CPPAD_LOCAL_SUBGRAPH_INFO_HPP
18 namespace CppAD {
namespace local {
namespace subgraph {
125 template <
typename Base>
131 while( i_op <
n_op_ )
136 op = play->
GetOp(++i_op);
142 op = play->
GetOp(++i_op);
206 n_op <=
size_t( std::numeric_limits<addr_t>::max() )
223 {
for(
size_t i_op = 0; i_op <
n_op; ++i_op)
226 else if( old_size < n_op )
227 {
for(
size_t i_op = old_size; i_op <
n_op; ++i_op)
263 template <
typename Base>
274 for(
size_t i_op = 0; i_op <
n_op_; ++i_op)
287 op = play->
GetOp(++i_op);
294 op = play->
GetOp(++i_op);
304 template <
typename Base,
typename BoolVector>
311 template <
typename Base>
void operator=(const subgraph_info &info)
assignment operator
size_t n_op_
number of operatros in operation sequence
void resize(size_t n)
resize the vector (existing elements preserved when n <= capacity_).
CPPAD_TAPE_ADDR_TYPE addr_t
const pod_vector< addr_t > & map_user_op(void) const
map user atomic function calls to first operator in the call
pod_vector< addr_t > entire_graph_
the entire operation sequence as a subgraph (size n_op_).
size_t n_var_
number of variables in operation sequence
Class used to store and play back an operation sequence recording.
initialize for a reverse mode subgraph calculation
File used to define pod_vector class.
void set_map_user_op(const player< Base > *play)
set the value of map_user_op for this operation sequence
void 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)...
size_t n_dep_
number of dependent variables for this function
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...
const pod_vector< bool > & process_range(void) const
dependent variables that have been processed since previous init_rev
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_).
size_t n_dep(void) const
number of dependent variables
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.
Determine arguments that are variables.
pod_vector< addr_t > & in_subgraph(void)
flag which operators that are in the subgraph
subgraph_info(void)
default constructor (all sizes are zero)
#define CPPAD_ASSERT_UNKNOWN(exp)
Check that exp is true, if not terminate execution.
const pod_vector< bool > & select_domain(void) const
previous select_domain argument to init_rev
size_t n_op(void) const
number of operators
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
void resize(size_t n_ind, size_t n_dep, size_t n_op, size_t n_var)
set sizes for this object (the default sizes are zero)
size_t n_ind(void) const
number of independent variables
size_t memory(void) const
amount of memory corresonding to this object
size_t capacity(void) const
current capacity (amount of allocated storage) for this vector.
OpCode GetOp(size_t i) const
fetch an operator from the recording.
Get subgraph corresponding to a dependent variable.
const pod_vector< addr_t > & entire_graph(void) const
entire graph represented as a sorted subgraph
class for maintaining subgraph information attached to on ADFun object.
pod_vector< bool > select_domain_
flags which dependent variables are selected
size_t num_var_rec(void) const
Fetch number of variables in the recording.
bool check_map_user_op(const player< Base > *play) const
check that the value of map_user_op is OK for this operation sequence