Add KLU support to spbenchsolver

This commit is contained in:
Mark Eberlein
2020-01-24 16:28:09 -08:00
committed by Rasmus Munk Larsen
parent 5fdc179241
commit ba9d18b938
2 changed files with 26 additions and 0 deletions

View File

@@ -37,6 +37,10 @@
#include <Eigen/UmfPackSupport>
#endif
#ifdef EIGEN_KLU_SUPPORT
#include <Eigen/KLUSupport>
#endif
#ifdef EIGEN_PARDISO_SUPPORT
#include <Eigen/PardisoSupport>
#endif
@@ -51,6 +55,7 @@
// CONSTANTS
#define EIGEN_UMFPACK 10
#define EIGEN_KLU 11
#define EIGEN_SUPERLU 20
#define EIGEN_PASTIX 30
#define EIGEN_PARDISO 40
@@ -109,6 +114,12 @@ void printStatheader(std::ofstream& out)
out << " <PACKAGE> UMFPACK </PACKAGE> \n";
out << " </SOLVER> \n";
#endif
#ifdef EIGEN_KLU_SUPPORT
out <<" <SOLVER ID='" << EIGEN_KLU << "'>\n";
out << " <TYPE> LU </TYPE> \n";
out << " <PACKAGE> KLU </PACKAGE> \n";
out << " </SOLVER> \n";
#endif
#ifdef EIGEN_SUPERLU_SUPPORT
out <<" <SOLVER ID='" << EIGEN_SUPERLU << "'>\n";
out << " <TYPE> LU </TYPE> \n";
@@ -315,6 +326,14 @@ void SelectSolvers(const SparseMatrix<Scalar>&A, unsigned int sym, Matrix<Scalar
UmfPackLU<SpMat> solver;
call_directsolver(solver, EIGEN_UMFPACK, A, b, refX,statFile);
}
#endif
//KLU
#ifdef EIGEN_KLU_SUPPORT
{
cout << "Solving with KLU LU ... \n";
KLU<SpMat> solver;
call_directsolver(solver, EIGEN_KLU, A, b, refX,statFile);
}
#endif
//SuperLU
#ifdef EIGEN_SUPERLU_SUPPORT