Registered Member
|
As part of an application that uses CppAD for automatic differentiation, I am trying to fill a sparse matrix using setFrom Triplets. The example below compiles and runs fine when the first line (#define EIGEN_MATRIX_PLUGIN ...) is removed. But when it's in, I get
.../Eigen/src/SparseCore/SparseMatrix.h:957:11: error: call to member function 'reserve' is ambiguous trMat.reserve(wi); CppAD is not needed for this MWE, but it is for the real application. The thing is that I don't know if this is an Eigen issue or a CppAD issue. So I'm posting to the CppAD mailing list as well. Any idea of what's going on? Thanks.
|
Moderator
|
You can probably fix it on your side by adding a plugin for SparseMatrix too:
#define EIGEN_SPARSEMATRIX_PLUGIN eigen_sparse_plugin.h with eigen_sparse_plugin.h as:
(not tested so be careful with possible typos) |
Registered Member
|
Thanks. There was indeed a typo in that code (too many template arguments). I added the following to eigen_sparse_plugin.h, and everything appears to work.
Any way this could be added to the file in the next release?
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]