Commit 51f5ef49 authored by David Bommes's avatar David Bommes
Browse files

added support for eigen 3.1.x

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@155 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 6cf90b5b
......@@ -15,9 +15,8 @@
//== INCLUDES =================================================================
#include <CoMISo/Config/CoMISoDefines.hh>
#include <Eigen/Eigen>
#include "EigenArpackMatrixT.hh"
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#include <Eigen/Sparse>
#if COMISO_ARPACK_AVAILABLE
#include <arpack++/arssym.h>
......
......@@ -13,9 +13,14 @@
#include <iostream>
#include <Eigen/Eigen>
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#if EIGEN_VERSION_AT_LEAST(3,1,0)
#include <Eigen/CholmodSupport>
#else
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#include <unsupported/Eigen/CholmodSupport>
#endif
#include <Eigen/Sparse>
#include <unsupported/Eigen/CholmodSupport>
//== FORWARDDECLARATIONS ======================================================
......@@ -50,7 +55,12 @@ public:
if(_use_inverse)
{
sllt_.compute(mat_);
#if EIGEN_VERSION_AT_LEAST(3,1,0)
if ( !sllt_.info() != Eigen::Success )
#else
if ( !sllt_.succeeded() )
#endif
std::cout << "[ERROR] EigenArpackMatrix(): Could not compute llt factorization." << std::endl;
}
}
......@@ -88,7 +98,11 @@ private:
Matrix mat_;
#if EIGEN_VERSION_AT_LEAST(3,1,0)
Eigen::CholmodSupernodalLLT<Eigen::SparseMatrix<Real> > sllt_;
#else
Eigen::SparseLLT<Eigen::SparseMatrix<Real>, Eigen::Cholmod> sllt_;
#endif
};
......
......@@ -38,7 +38,11 @@
int main(void)
{
// matrix types
#if EIGEN_VERSION_AT_LEAST(3,1,0)
typedef Eigen::SparseMatrix<double,Eigen::ColMajor> SMatrix;
#else
typedef Eigen::DynamicSparseMatrix<double,Eigen::ColMajor> SMatrix;
#endif
typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> Matrix;
std::cout << "---------- 1) Setting up matrix..." << std::endl;
......
......@@ -11,7 +11,10 @@
//== INCLUDES =================================================================
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#include <Eigen/Eigen>
#if !(EIGEN_VERSION_AT_LEAST(3,1,0))
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#endif
#include <Eigen/Sparse>
#include <CoMISo/Config/CoMISoDefines.hh>
......@@ -37,8 +40,12 @@ class COMISODLLEXPORT NProblemInterface
public:
// Sparse Matrix Type
#if EIGEN_VERSION_AT_LEAST(3,1,0)
typedef Eigen::SparseMatrix<double,Eigen::ColMajor> SMatrixNP;
#else
typedef Eigen::DynamicSparseMatrix<double,Eigen::ColMajor> SMatrixNP;
#endif
/// Default constructor
NProblemInterface();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment