Collapsed revision (based on pull request PR-325)

* Support compiling without IO streams

Add the preprocessor definition EIGEN_NO_IO which, if defined,
disables all use of the IO streams part of the standard library.
This commit is contained in:
Christian von Schultz 2018-10-22 21:14:40 +02:00
parent 14054e217f
commit 4a40b3785d
2 changed files with 8 additions and 2 deletions

View File

@ -72,7 +72,9 @@
#include <cmath>
#include <cassert>
#include <functional>
#include <iosfwd>
#ifndef EIGEN_NO_IO
#include <iosfwd>
#endif
#include <cstring>
#include <string>
#include <limits>
@ -224,7 +226,9 @@ using std::ptrdiff_t;
#include "src/Core/util/IndexedViewHelper.h"
#include "src/Core/util/ReshapedHelper.h"
#include "src/Core/ArithmeticSequence.h"
#include "src/Core/IO.h"
#ifndef EIGEN_NO_IO
#include "src/Core/IO.h"
#endif
#include "src/Core/DenseCoeffsBase.h"
#include "src/Core/DenseBase.h"
#include "src/Core/MatrixBase.h"

View File

@ -607,10 +607,12 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half (max)(const half& a, const half& b) {
#endif
}
#ifndef EIGEN_NO_IO
EIGEN_ALWAYS_INLINE std::ostream& operator << (std::ostream& os, const half& v) {
os << static_cast<float>(v);
return os;
}
#endif
} // end namespace half_impl