From a5469a6f0f7d7ca65e37f6801552fb28eb8da984 Mon Sep 17 00:00:00 2001 From: Alexander Richardson Date: Fri, 29 Jul 2022 18:02:51 +0000 Subject: [PATCH] Avoid including with EIGEN_NO_IO (cherry picked from commit b7668c0371054a3a938eeab32a5c10d24c1ea4fc) --- Eigen/Core | 2 +- Eigen/src/Core/arch/Default/Half.h | 2 -- Eigen/src/SparseCore/SparseMatrix.h | 2 ++ Eigen/src/SparseCore/SparseMatrixBase.h | 3 ++- Eigen/src/SparseCore/SparseVector.h | 2 ++ Eigen/src/SparseLU/SparseLU.h | 7 +++++-- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Eigen/Core b/Eigen/Core index 3c03519fe..1e53ba49b 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -83,8 +83,8 @@ #include #include #include -#include #ifndef EIGEN_NO_IO + #include #include #endif #include diff --git a/Eigen/src/Core/arch/Default/Half.h b/Eigen/src/Core/arch/Default/Half.h index 2eb4bdba5..e4a17cbfa 100644 --- a/Eigen/src/Core/arch/Default/Half.h +++ b/Eigen/src/Core/arch/Default/Half.h @@ -36,8 +36,6 @@ #ifndef EIGEN_HALF_H #define EIGEN_HALF_H -#include - #if defined(EIGEN_HAS_GPU_FP16) || defined(EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC) // When compiling with GPU support, the "__half_raw" base class as well as // some other routines are defined in the GPU compiler header files diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 616b4a0c2..9fc06b5e7 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -793,6 +793,7 @@ class SparseMatrix template EIGEN_DONT_INLINE SparseMatrix& operator=(const SparseMatrixBase& other); +#ifndef EIGEN_NO_IO friend std::ostream & operator << (std::ostream & s, const SparseMatrix& m) { EIGEN_DBG_SPARSE( @@ -837,6 +838,7 @@ class SparseMatrix s << static_cast&>(m); return s; } +#endif /** Destructor */ inline ~SparseMatrix() diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h index c8151ed09..417a2365e 100644 --- a/Eigen/src/SparseCore/SparseMatrixBase.h +++ b/Eigen/src/SparseCore/SparseMatrixBase.h @@ -214,7 +214,7 @@ template class SparseMatrixBase inline void assignGeneric(const OtherDerived& other); public: - +#ifndef EIGEN_NO_IO friend std::ostream & operator << (std::ostream & s, const SparseMatrixBase& m) { typedef typename Derived::Nested Nested; @@ -263,6 +263,7 @@ template class SparseMatrixBase } return s; } +#endif template Derived& operator+=(const SparseMatrixBase& other); diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h index 05779be68..106925be4 100644 --- a/Eigen/src/SparseCore/SparseVector.h +++ b/Eigen/src/SparseCore/SparseVector.h @@ -329,6 +329,7 @@ class SparseVector } #endif +#ifndef EIGEN_NO_IO friend std::ostream & operator << (std::ostream & s, const SparseVector& m) { for (Index i=0; i::factorize(const MatrixType& matrix) info = Base::pivotL(jj, m_diagpivotthresh, m_perm_r.indices(), iperm_c.indices(), pivrow, m_glu); if ( info ) { - m_lastError = "THE MATRIX IS STRUCTURALLY SINGULAR ... ZERO COLUMN AT "; + m_lastError = "THE MATRIX IS STRUCTURALLY SINGULAR"; +#ifndef EIGEN_NO_IO std::ostringstream returnInfo; - returnInfo << info; + returnInfo << " ... ZERO COLUMN AT "; + returnInfo << info; m_lastError += returnInfo.str(); +#endif m_info = NumericalIssue; m_factorizationIsOk = false; return;