SuperLUSupport 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H
  8. #define EIGEN_SUPERLUSUPPORT_MODULE_H
  9. #include "SparseCore"
  10. #include "src/Core/util/DisableStupidWarnings.h"
  11. #ifdef EMPTY
  12. #define EIGEN_EMPTY_WAS_ALREADY_DEFINED
  13. #endif
  14. typedef int int_t;
  15. #include <slu_Cnames.h>
  16. #include <supermatrix.h>
  17. #include <slu_util.h>
  18. // slu_util.h defines a preprocessor token named EMPTY which is really polluting,
  19. // so we remove it in favor of a SUPERLU_EMPTY token.
  20. // If EMPTY was already defined then we don't undef it.
  21. #if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED)
  22. # undef EIGEN_EMPTY_WAS_ALREADY_DEFINED
  23. #elif defined(EMPTY)
  24. # undef EMPTY
  25. #endif
  26. #define SUPERLU_EMPTY (-1)
  27. namespace Eigen { struct SluMatrix; }
  28. /** \ingroup Support_modules
  29. * \defgroup SuperLUSupport_Module SuperLUSupport module
  30. *
  31. * This module provides an interface to the <a href="http://crd-legacy.lbl.gov/~xiaoye/SuperLU/">SuperLU</a> library.
  32. * It provides the following factorization class:
  33. * - class SuperLU: a supernodal sequential LU factorization.
  34. * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods).
  35. *
  36. * \warning This wrapper requires at least versions 4.0 of SuperLU. The 3.x versions are not supported.
  37. *
  38. * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting.
  39. *
  40. * \code
  41. * #include <Eigen/SuperLUSupport>
  42. * \endcode
  43. *
  44. * 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.
  45. * The dependencies depend on how superlu has been compiled.
  46. * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task.
  47. *
  48. */
  49. #include "src/SuperLUSupport/SuperLUSupport.h"
  50. #include "src/Core/util/ReenableStupidWarnings.h"
  51. #endif // EIGEN_SUPERLUSUPPORT_MODULE_H