48 #ifndef _MIRA_NUMERICAL_STREAM_H_ 49 #define _MIRA_NUMERICAL_STREAM_H_ 132 template <
typename T>
133 inline void fpOutput(
const T& value)
135 if(boost::math::isnan(value))
137 else if(boost::math::isinf(value)) {
197 template <
typename T>
233 template <
typename T>
234 inline void fpInput(T& value)
243 std::streamoff p0 =
in.tellg();
256 if(sign==
'-' &&
in.tellg()==p0) {
262 char buf[3] = {0,0,0};
266 if(buf[0]==
'n' && buf[1]==
'a' && buf[2]==
'n') {
267 value = std::numeric_limits<T>::quiet_NaN();
272 if(buf[0]==
'i' && buf[1]==
'n' && buf[2]==
'f') {
274 value = -std::numeric_limits<T>::infinity();
276 value = std::numeric_limits<T>::infinity();
285 while(((std::streamoff)
in.tellg()) > p0)
289 in.setstate(std::ios::badbit);
Numerical stream adapter that can be assigned to any output stream and allows streaming of numerical ...
Definition: NumericalStream.h:85
NumericalOstream & operator<<(const T &val)
Definition: NumericalStream.h:97
std::ostream & out
The underlying output stream.
Definition: NumericalStream.h:127
Includes often needed math headers and methods and provides additional constants. ...
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
NumericalOstream & operator<<(std::ostream &(*pf)(std::ostream &))
Definition: NumericalStream.h:103
Numerical stream adapter that can be assigned to any input stream and allows streaming of numerical v...
Definition: NumericalStream.h:186
NumericalIstream & operator>>(T &val)
Definition: NumericalStream.h:198
NumericalIstream & operator>>(std::istream &(*pf)(std::istream &))
Definition: NumericalStream.h:204
NumericalOstream(std::ostream &s)
Constructs a NumericalOstream around the specified existing std::ostream.
Definition: NumericalStream.h:94
NumericalIstream(std::istream &s)
Constructs a NumericalIstream around the specified existing istream.
Definition: NumericalStream.h:195
std::istream & in
The underlying input stream.
Definition: NumericalStream.h:228