-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
I'm sure it's a low priority, but it appears that including the code below results in a compile error:
Eigen::SparseMatrix<Type> M;
ADREPORT( M );I have worked around this by defining the function:
template<class Type>
vector<Type> get_nonzero_elements( Eigen::SparseMatrix<Type> M ) {
std::vector<Type> values;
for (int k = 0; k < M.outerSize(); ++k) {
for (typename Eigen::SparseMatrix<Type>::InnerIterator it(M, k); it; ++it) {
values.push_back(it.value());
}
}
return values; // Return vector of nonzero values if needed
}and then combining the vector of non-zero values with the triplet form in the R side. However, it might be worth adding an ADREPORT option for Eigen::SparseMatrix
Metadata
Metadata
Assignees
Labels
No labels