Registered Member
|
I get a compilation error with Eigen3.3-beta1 (the release (version in debian testing) and the master branch of the repository) when using the SparseLU solver. It's seems to come from a type problem ( a reference is missing) but I don't know enough about Eigen internals to be sure.
This is how I use the solver : https://bitbucket.org/specmicp/specmicp ... ew-default The compilation error is included below. What changes were made between 2.8 and 3.3 ? What changes do I need to make in my code ?
|
Moderator
|
You should replace typename MatrixT::Index by typename MatrixT::StorageIndex, see http://eigen.tuxfamily.org/index.php?ti ... ex_typedef
|
Registered Member
|
Indeed ! Thanks a lot, I did not make the link at all.
Does a clever method exist to be compatible with both versions of Eigen or do we need to play with #ifdef ? |
Moderator
|
You can use StorageIndex in both version.
|
Registered Member
|
Unfortunately, my compiler disagrees with that. This is the compilation error I get with Eigen 3.2.8 when using StorageIndex :
|
Moderator
|
sorry, my "eigen3.2" folder was temporally pointing to the devel branch when I checked. I guess we should add this typedef to ease the transition. In the meantime you can still do something like:
#if EIGEN_VERSION_AT_LEAST(3.2.90) #define STORAGE_INDEX_TYPE(TYPE) TYPE::StorageIndex #else #define STORAGE_INDEX_TYPE(TYPE) TYPE::Index #endif |
Moderator
|
|
Registered Member
|
ahah that's better than what I did, I was using CMake to get the Eigen version...
Thanks a lot for all you work and help ! |
Registered Member
|
I had to change
Eigen::SparseLU<Eigen::SparseMatrix<double, Eigen::ColMajor>, Eigen::COLAMDOrdering<Eigen::Index> > solver; to Eigen::SparseLU<Eigen::SparseMatrix<double, Eigen::ColMajor>, Eigen::COLAMDOrdering<int> > solver; The compiler translated Eigen::Index to long int and threw the error described above. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]