1*bf2c3715SXin Li// This file is part of Eigen, a lightweight C++ template library 2*bf2c3715SXin Li// for linear algebra. 3*bf2c3715SXin Li// 4*bf2c3715SXin Li// This Source Code Form is subject to the terms of the Mozilla 5*bf2c3715SXin Li// Public License v. 2.0. If a copy of the MPL was not distributed 6*bf2c3715SXin Li// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 7*bf2c3715SXin Li 8*bf2c3715SXin Li#ifndef EIGEN_SUPERLUSUPPORT_MODULE_H 9*bf2c3715SXin Li#define EIGEN_SUPERLUSUPPORT_MODULE_H 10*bf2c3715SXin Li 11*bf2c3715SXin Li#include "SparseCore" 12*bf2c3715SXin Li 13*bf2c3715SXin Li#include "src/Core/util/DisableStupidWarnings.h" 14*bf2c3715SXin Li 15*bf2c3715SXin Li#ifdef EMPTY 16*bf2c3715SXin Li#define EIGEN_EMPTY_WAS_ALREADY_DEFINED 17*bf2c3715SXin Li#endif 18*bf2c3715SXin Li 19*bf2c3715SXin Litypedef int int_t; 20*bf2c3715SXin Li#include <slu_Cnames.h> 21*bf2c3715SXin Li#include <supermatrix.h> 22*bf2c3715SXin Li#include <slu_util.h> 23*bf2c3715SXin Li 24*bf2c3715SXin Li// slu_util.h defines a preprocessor token named EMPTY which is really polluting, 25*bf2c3715SXin Li// so we remove it in favor of a SUPERLU_EMPTY token. 26*bf2c3715SXin Li// If EMPTY was already defined then we don't undef it. 27*bf2c3715SXin Li 28*bf2c3715SXin Li#if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) 29*bf2c3715SXin Li# undef EIGEN_EMPTY_WAS_ALREADY_DEFINED 30*bf2c3715SXin Li#elif defined(EMPTY) 31*bf2c3715SXin Li# undef EMPTY 32*bf2c3715SXin Li#endif 33*bf2c3715SXin Li 34*bf2c3715SXin Li#define SUPERLU_EMPTY (-1) 35*bf2c3715SXin Li 36*bf2c3715SXin Linamespace Eigen { struct SluMatrix; } 37*bf2c3715SXin Li 38*bf2c3715SXin Li/** \ingroup Support_modules 39*bf2c3715SXin Li * \defgroup SuperLUSupport_Module SuperLUSupport module 40*bf2c3715SXin Li * 41*bf2c3715SXin Li * This module provides an interface to the <a href="http://crd-legacy.lbl.gov/~xiaoye/SuperLU/">SuperLU</a> library. 42*bf2c3715SXin Li * It provides the following factorization class: 43*bf2c3715SXin Li * - class SuperLU: a supernodal sequential LU factorization. 44*bf2c3715SXin Li * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). 45*bf2c3715SXin Li * 46*bf2c3715SXin Li * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported. 47*bf2c3715SXin Li * 48*bf2c3715SXin Li * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. 49*bf2c3715SXin Li * 50*bf2c3715SXin Li * \code 51*bf2c3715SXin Li * #include <Eigen/SuperLUSupport> 52*bf2c3715SXin Li * \endcode 53*bf2c3715SXin Li * 54*bf2c3715SXin Li * In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies. 55*bf2c3715SXin Li * The dependencies depend on how superlu has been compiled. 56*bf2c3715SXin Li * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. 57*bf2c3715SXin Li * 58*bf2c3715SXin Li */ 59*bf2c3715SXin Li 60*bf2c3715SXin Li#include "src/SuperLUSupport/SuperLUSupport.h" 61*bf2c3715SXin Li 62*bf2c3715SXin Li#include "src/Core/util/ReenableStupidWarnings.h" 63*bf2c3715SXin Li 64*bf2c3715SXin Li#endif // EIGEN_SUPERLUSUPPORT_MODULE_H 65