You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ADREPORT( Eigen::SparseMatrix M ) causes compile error #407
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<classType>
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
Activity