Clean up top-level Eigen headers

libeigen/eigen!2252

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
Rasmus Munk Larsen
2026-03-29 16:28:09 -07:00
parent 409296d91d
commit c8633ceeea
20 changed files with 47 additions and 53 deletions

View File

@@ -14,8 +14,6 @@
#include "src/Core/util/DisableStupidWarnings.h"
/** \defgroup Cholesky_Module Cholesky module
*
*
*
* This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices.
* Those decompositions are also accessible via the following methods:

View File

@@ -26,7 +26,7 @@
* For the sake of completeness, this module also propose the two following classes:
* - class CholmodSimplicialLLT
* - class CholmodSimplicialLDLT
* Note that these classes does not bring any particular advantage compared to the built-in
* Note that these classes do not bring any particular advantage compared to the built-in
* SimplicialLLT and SimplicialLDLT factorization classes.
*
* \code

View File

@@ -36,12 +36,6 @@
#include <new>
#endif
// Disable the ipa-cp-clone optimization flag with MinGW 6.x or older (enabled by default with -O3)
// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details.
#if EIGEN_COMP_MINGW && EIGEN_GNUC_STRICT_LESS_THAN(6, 0, 0)
#pragma GCC optimize("-fno-ipa-cp-clone")
#endif
// Prevent ICC from specializing std::complex operators that silently fail
// on device. This allows us to use our own device-compatible specializations
// instead.
@@ -53,7 +47,7 @@
// this include file manages BLAS and MKL related macros
// and inclusion of their respective header files
#include "src/Core/util/MKL_support.h"
#include "src/Core/util/AOCL_Support.h" // ← ADD THIS
#include "src/Core/util/AOCL_Support.h"
#if defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16)
@@ -73,8 +67,7 @@
#include <omp.h>
#endif
// MSVC for windows mobile does not have the errno.h file
#if !(EIGEN_COMP_MSVC && EIGEN_OS_WINCE) && !EIGEN_COMP_ARM
#if !EIGEN_COMP_ARM
#define EIGEN_HAS_ERRNO
#endif
@@ -125,7 +118,7 @@
// required for __cpuid, needs to be included after cmath
// also required for _BitScanReverse on Windows on ARM
#if EIGEN_COMP_MSVC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM64) && !EIGEN_OS_WINCE
#if EIGEN_COMP_MSVC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM64)
#include <intrin.h>
#endif
@@ -155,19 +148,9 @@
#endif
#endif
#if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS || defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API || \
defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS || defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API || \
defined EIGEN2_SUPPORT
// This will generate an error message:
#error Eigen2-support is only available up to version 3.2. Please go to "http://eigen.tuxfamily.org/index.php?title=Eigen2" for further information
#endif
namespace Eigen {
// we use size_t frequently and we'll never remember to prepend it with std:: every time just to
// ensure QNX/QCC support
using std::size_t;
// gcc 4.6.0 wants std:: for ptrdiff_t
using std::ptrdiff_t;
} // namespace Eigen
@@ -373,8 +356,6 @@ using std::ptrdiff_t;
#include "src/Core/DenseStorage.h"
#include "src/Core/NestByValue.h"
// #include "src/Core/ForceAlignedAccess.h"
#include "src/Core/ReturnByValue.h"
#include "src/Core/NoAlias.h"
#include "src/Core/PlainObjectBase.h"

View File

@@ -1,3 +1,13 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_DENSE_MODULE_H
#define EIGEN_DENSE_MODULE_H
#include "Core"
#include "LU"
#include "Cholesky"
@@ -5,3 +15,5 @@
#include "SVD"
#include "Geometry"
#include "Eigenvalues"
#endif // EIGEN_DENSE_MODULE_H

View File

@@ -1,2 +1,14 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_EIGEN_MODULE_H
#define EIGEN_EIGEN_MODULE_H
#include "Dense"
#include "Sparse"
#endif // EIGEN_EIGEN_MODULE_H

View File

@@ -11,8 +11,6 @@
#include "Core"
#include "Cholesky"
#include "Jacobi"
#include "Householder"
#include "LU"
#include "Geometry"
#include "Sparse" // Needed by ComplexQZ.
@@ -20,8 +18,6 @@
#include "src/Core/util/DisableStupidWarnings.h"
/** \defgroup Eigenvalues_Module Eigenvalues module
*
*
*
* This module mainly provides various eigenvalue solvers.
* This module also provides some MatrixBase methods, including:

View File

@@ -12,7 +12,6 @@
#include "SVD"
#include "LU"
#include <limits>
#include "src/Core/util/DisableStupidWarnings.h"

View File

@@ -29,7 +29,7 @@ extern "C" {
* \endcode
*
* In order to use this module, the klu and btf headers must be accessible from the include paths, and your binary must
* be linked to the klu library and its dependencies. The dependencies depend on how umfpack has been compiled. For a
* be linked to the klu library and its dependencies. The dependencies depend on how KLU has been compiled. For a
* cmake based project, you can use our FindKLU.cmake module to help you in this task.
*
*/

View File

@@ -23,11 +23,10 @@
* \endcode
*/
// IWYU pragma: begin_exports
#include "src/misc/Kernel.h"
#include "src/misc/Image.h"
#include "src/misc/RankRevealingBase.h"
// IWYU pragma: begin_exports
#include "src/LU/FullPivLU.h"
#include "src/LU/PartialPivLU.h"
#ifdef EIGEN_USE_LAPACKE

View File

@@ -36,7 +36,7 @@ extern "C" {
* \endcode
*
* In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be
* linked to the PaSTiX library and its dependencies. This wrapper resuires PaStiX version 5.x compiled without MPI
* linked to the PaSTiX library and its dependencies. This wrapper requires PaStiX version 5.x compiled without MPI
* support. The dependencies depend on how PaSTiX has been compiled. For a cmake based project, you can use our
* FindPaSTiX.cmake module to help you in this task.
*

View File

@@ -11,14 +11,11 @@
#include "Core"
#include "Cholesky"
#include "Jacobi"
#include "Householder"
#include "src/Core/util/DisableStupidWarnings.h"
/** \defgroup QR_Module QR module
*
*
*
* This module provides various QR decompositions
* This module also provides some MatrixBase methods, including:

View File

@@ -14,11 +14,11 @@
#include "src/Core/util/DisableStupidWarnings.h"
void *qMalloc(std::size_t size) { return Eigen::internal::aligned_malloc(size); }
inline void *qMalloc(std::size_t size) { return Eigen::internal::aligned_malloc(size); }
void qFree(void *ptr) { Eigen::internal::aligned_free(ptr); }
inline void qFree(void *ptr) { Eigen::internal::aligned_free(ptr); }
void *qRealloc(void *ptr, std::size_t size) {
inline void *qRealloc(void *ptr, std::size_t size) {
void *newPtr = Eigen::internal::aligned_malloc(size);
std::memcpy(newPtr, ptr, size);
Eigen::internal::aligned_free(ptr);

View File

@@ -38,4 +38,4 @@
#include "src/Core/util/ReenableStupidWarnings.h"
#endif
#endif // EIGEN_SPQRSUPPORT_MODULE_H

View File

@@ -9,14 +9,10 @@
#define EIGEN_SVD_MODULE_H
#include "QR"
#include "Householder"
#include "Jacobi"
#include "src/Core/util/DisableStupidWarnings.h"
/** \defgroup SVD_Module SVD module
*
*
*
* This module provides SVD decomposition for matrices (both real and complex).
* Two decomposition algorithms are provided:

View File

@@ -12,11 +12,7 @@
#include "src/Core/util/DisableStupidWarnings.h"
#include <vector>
#include <map>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
/**

View File

@@ -35,4 +35,4 @@
#include "src/Core/util/ReenableStupidWarnings.h"
#endif
#endif // EIGEN_SPARSEQR_MODULE_H

View File

@@ -16,6 +16,7 @@
#define EIGEN_EMPTY_WAS_ALREADY_DEFINED
#endif
// Required by SuperLU headers, which expect int_t to be defined as a global typedef.
typedef int int_t;
#include <slu_Cnames.h>
#include <supermatrix.h>

View File

@@ -27,7 +27,7 @@
#include <cstddef>
#include <cstring>
#include <time.h>
#include <ctime>
#include <vector>
#include <atomic>
@@ -77,4 +77,4 @@
#include "src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_CXX11_THREADPOOL_MODULE_H
#endif // EIGEN_THREADPOOL_MODULE_H

View File

@@ -35,7 +35,7 @@ extern "C" {
// IWYU pragma: begin_exports
#include "src/UmfPackSupport/UmfPackSupport.h"
// IWYU pragma: endexports
// IWYU pragma: end_exports
#include "src/Core/util/ReenableStupidWarnings.h"

View File

@@ -1,3 +1,10 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_VERSION_H
#define EIGEN_VERSION_H