This forum has been archived. All content is frozen. Please use KDE Discuss instead.

IterativeLinearSolvers with EIGEN_MPL2_ONLY

Tags: None
(comma "," separated)
mmueller
Registered Member
Posts
1
Karma
0
Hello everyone,
I'm trying to use the IterativeLinearSolvers with EIGEN_MPL2_ONLY defined. However, the following code does not compile on gcc and clang but compiles with Visual Studio 2013:
Code: Select all
#define EIGEN_MPL2_ONLY
#include <Eigen/SparseCore>
#include <Eigen/IterativeLinearSolvers>
int main() {
}

Code: Select all
In file included from /usr/include/eigen3/Eigen/IterativeLinearSolvers:36:0,
                 from main.cpp:6:
/usr/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h: In member function ‘void Eigen::IncompleteLUT<_Scalar>::analyzePattern(const _MatrixType&)’:
/usr/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h:233:3: error: ‘minimum_degree_ordering’ is not a member of ‘Eigen::internal’
   internal::minimum_degree_ordering<Scalar, Index>(AtA, m_P);  // Then compute the AMD ordering...
   ^
/usr/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h:233:43: error: expected primary-expression before ‘,’ token
   internal::minimum_degree_ordering<Scalar, Index>(AtA, m_P);  // Then compute the AMD ordering...
                                           ^
/usr/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h:233:50: error: expected primary-expression before ‘>’ token
   internal::minimum_degree_ordering<Scalar, Index>(AtA, m_P);  // Then compute the AMD ordering...

The internal::minimum_degree_ordering method is only defined in Ordering/Amd.h which is not included with EIGEN_MPL2_ONLY.
Is IterativeLinearSolvers requiring non MPL2 code or is this just a problem with template instantiation that differs between compilers?

I can solve it by creating a dummy implementation before including the header, but I'm not sure if this breaks something else:
Code: Select all
namespace Eigen {
namespace internal {
   template<typename Scalar, typename Index>
   void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>&, PermutationMatrix<Dynamic,Dynamic,Index>&) {}
}
}
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar