CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
template<typename Base , typename BoolVector >
void CppAD::local::subgraph::subgraph_sparsity ( const player< Base > *  play,
subgraph_info &  sub_info,
const vector< size_t > &  dep_taddr,
const BoolVector &  select_domain,
const BoolVector &  select_range,
pod_vector< size_t > &  row_out,
pod_vector< size_t > &  col_out 
)

Compute dependency sparsity pattern for an ADFun<Base> function.

Template Parameters
Basethe operation sequence was recorded using AD<Base>.
BoolVectora simple vector class with elements of type bool.
Parameters
playis the operation sequence corresponding to the ADFun<Base> function.
sub_infois the subgraph information for this ADFun object.
dep_taddrmapping from user dependent variable index to variable index in play (must have size sub_info.n_dep()).
select_domainonly the selected independent variables will be included in the sparsity pattern (must have size sub_info.n_ind()).
select_rangeonly the selected dependent variables will be included in the sparsity pattern (must have size sub_info.n_dep()).
row_outThe input size and elements of row_out do not matter. We use number of non-zeros (nnz) to denote the number of elements in row_out. For k = 0 , ... , nnz-1, row_out[k] is the row index of the k-th no-zero element of the dependency sparsitiy pattern for the function corresponding to the recording.
0 <= row_out[k] < dep_taddr.size()
select_range[ row_out[k] ] == true
col_outThe input size and elements of col_out do not matter. Upon return is has the same size as row_out; i.e., nnz. For k = 0 , ... , nnz-1, col_out[k] is the column index of the k-th no-zero element of the dependency sparsitiy pattern for the function corresponding to the recording.
0 <= col_out[k] < sub_info.n_ind()
select_domain[ col_out[k] ] == true
UserOp
All of the inputs and outputs for an atomic function call are considered to be connected. 2DO: It would be good to use the sparsity patters for atomic function calls to to make the sparsity pattern more efficient.

Definition at line 83 of file sparsity.hpp.

Referenced by CppAD::ADFun< Base >::subgraph_sparsity().