Avoid including <sstream> with EIGEN_NO_IO

This commit is contained in:
Alexander Richardson 2022-07-29 18:02:51 +00:00 committed by Rasmus Munk Larsen
parent 7dd3dda3da
commit b7668c0371
6 changed files with 12 additions and 5 deletions

View File

@ -84,8 +84,8 @@
#include <cmath>
#include <cassert>
#include <functional>
#include <sstream>
#ifndef EIGEN_NO_IO
#include <sstream>
#include <iosfwd>
#endif
#include <cstring>

View File

@ -37,7 +37,6 @@
#define EIGEN_HALF_H
#include "../../InternalHeaderCheck.h"
#include <sstream>
#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

View File

@ -786,6 +786,7 @@ class SparseMatrix
template<typename OtherDerived>
EIGEN_DONT_INLINE SparseMatrix& operator=(const SparseMatrixBase<OtherDerived>& other);
#ifndef EIGEN_NO_IO
friend std::ostream & operator << (std::ostream & s, const SparseMatrix& m)
{
EIGEN_DBG_SPARSE(
@ -830,6 +831,7 @@ class SparseMatrix
s << static_cast<const SparseMatrixBase<SparseMatrix>&>(m);
return s;
}
#endif
/** Destructor */
inline ~SparseMatrix()

View File

@ -214,7 +214,7 @@ template<typename Derived> 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<typename Derived> class SparseMatrixBase
}
return s;
}
#endif
template<typename OtherDerived>
Derived& operator+=(const SparseMatrixBase<OtherDerived>& other);

View File

@ -353,6 +353,7 @@ class SparseVector
}
#endif
#ifndef EIGEN_NO_IO
friend std::ostream & operator << (std::ostream & s, const SparseVector& m)
{
for (Index i=0; i<m.nonZeros(); ++i)
@ -360,6 +361,7 @@ class SparseVector
s << std::endl;
return s;
}
#endif
/** Destructor */
inline ~SparseVector() {}

View File

@ -754,10 +754,13 @@ void SparseLU<MatrixType, OrderingType>::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;