CppAD: A C++ Algorithmic Differentiation Package
20171217
|
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.
Base | the operation sequence was recorded using AD<Base>. |
BoolVector | a simple vector class with elements of type bool. |
play | is the operation sequence corresponding to the ADFun<Base> function. |
sub_info | is the subgraph information for this ADFun object. |
dep_taddr | mapping from user dependent variable index to variable index in play (must have size sub_info.n_dep()). |
select_domain | only the selected independent variables will be included in the sparsity pattern (must have size sub_info.n_ind()). |
select_range | only the selected dependent variables will be included in the sparsity pattern (must have size sub_info.n_dep()). |
row_out | The 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_out | The 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
|
Definition at line 83 of file sparsity.hpp.
Referenced by CppAD::ADFun< Base >::subgraph_sparsity().