Create a two vector sparsity representation from a vector of maps.
- Parameters:
-
sparse | Is a vector of maps representation of sparsity as well as the index in the two vector representation. To be specific;
for(i = 0; i < sparse.size(); i++)
{ for(itr = sparse[i].begin(); itr != sparse[i].end(); itr++)
{ j = itr->first;
// (i, j) is a possibly non-zero entry in sparsity pattern
// k == itr->second, is corresponding index in i_row and j_col
k++;
}
}
|
n_nz | is the total number of possibly non-zero entries. |
i_row | The input size and element values for i_row do not matter. On output, it has size n_nz and i_row[k] contains the row index corresponding to the k-th possibly non-zero entry. |
j_col | The input size and element values for j_col do not matter. On output, it has size n_nz and j_col[k] contains the column index corresponding to the k-th possibly non-zero entry. |
Definition at line 54 of file sparse_map2vec.cpp.
Referenced by cppad_ipopt_nlp::cppad_ipopt_nlp().