mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-13 16:41:50 +08:00
Avoid including <sstream> with EIGEN_NO_IO
(cherry picked from commit b7668c0371054a3a938eeab32a5c10d24c1ea4fc)
This commit is contained in:
parent
6aaa45db5f
commit
a5469a6f0f
@ -83,8 +83,8 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <sstream>
|
|
||||||
#ifndef EIGEN_NO_IO
|
#ifndef EIGEN_NO_IO
|
||||||
|
#include <sstream>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#endif
|
#endif
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -36,8 +36,6 @@
|
|||||||
#ifndef EIGEN_HALF_H
|
#ifndef EIGEN_HALF_H
|
||||||
#define EIGEN_HALF_H
|
#define EIGEN_HALF_H
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#if defined(EIGEN_HAS_GPU_FP16) || defined(EIGEN_HAS_ARM64_FP16_SCALAR_ARITHMETIC)
|
#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
|
// When compiling with GPU support, the "__half_raw" base class as well as
|
||||||
// some other routines are defined in the GPU compiler header files
|
// some other routines are defined in the GPU compiler header files
|
||||||
|
@ -793,6 +793,7 @@ class SparseMatrix
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
EIGEN_DONT_INLINE SparseMatrix& operator=(const SparseMatrixBase<OtherDerived>& other);
|
EIGEN_DONT_INLINE SparseMatrix& operator=(const SparseMatrixBase<OtherDerived>& other);
|
||||||
|
|
||||||
|
#ifndef EIGEN_NO_IO
|
||||||
friend std::ostream & operator << (std::ostream & s, const SparseMatrix& m)
|
friend std::ostream & operator << (std::ostream & s, const SparseMatrix& m)
|
||||||
{
|
{
|
||||||
EIGEN_DBG_SPARSE(
|
EIGEN_DBG_SPARSE(
|
||||||
@ -837,6 +838,7 @@ class SparseMatrix
|
|||||||
s << static_cast<const SparseMatrixBase<SparseMatrix>&>(m);
|
s << static_cast<const SparseMatrixBase<SparseMatrix>&>(m);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
inline ~SparseMatrix()
|
inline ~SparseMatrix()
|
||||||
|
@ -214,7 +214,7 @@ template<typename Derived> class SparseMatrixBase
|
|||||||
inline void assignGeneric(const OtherDerived& other);
|
inline void assignGeneric(const OtherDerived& other);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
#ifndef EIGEN_NO_IO
|
||||||
friend std::ostream & operator << (std::ostream & s, const SparseMatrixBase& m)
|
friend std::ostream & operator << (std::ostream & s, const SparseMatrixBase& m)
|
||||||
{
|
{
|
||||||
typedef typename Derived::Nested Nested;
|
typedef typename Derived::Nested Nested;
|
||||||
@ -263,6 +263,7 @@ template<typename Derived> class SparseMatrixBase
|
|||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
Derived& operator+=(const SparseMatrixBase<OtherDerived>& other);
|
Derived& operator+=(const SparseMatrixBase<OtherDerived>& other);
|
||||||
|
@ -329,6 +329,7 @@ class SparseVector
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef EIGEN_NO_IO
|
||||||
friend std::ostream & operator << (std::ostream & s, const SparseVector& m)
|
friend std::ostream & operator << (std::ostream & s, const SparseVector& m)
|
||||||
{
|
{
|
||||||
for (Index i=0; i<m.nonZeros(); ++i)
|
for (Index i=0; i<m.nonZeros(); ++i)
|
||||||
@ -336,6 +337,7 @@ class SparseVector
|
|||||||
s << std::endl;
|
s << std::endl;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
inline ~SparseVector() {}
|
inline ~SparseVector() {}
|
||||||
|
@ -752,10 +752,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);
|
info = Base::pivotL(jj, m_diagpivotthresh, m_perm_r.indices(), iperm_c.indices(), pivrow, m_glu);
|
||||||
if ( info )
|
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;
|
std::ostringstream returnInfo;
|
||||||
|
returnInfo << " ... ZERO COLUMN AT ";
|
||||||
returnInfo << info;
|
returnInfo << info;
|
||||||
m_lastError += returnInfo.str();
|
m_lastError += returnInfo.str();
|
||||||
|
#endif
|
||||||
m_info = NumericalIssue;
|
m_info = NumericalIssue;
|
||||||
m_factorizationIsOk = false;
|
m_factorizationIsOk = false;
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user