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