Vector.cc File Reference
#include "Vector.h"
#include "SmallVector.h"
#include "ExtendedMath.h"

Functions

std::ostream & operator<< (std::ostream &os, const Vec3D &a)
 
std::istream & operator>> (std::istream &is, Vec3D &a)
 

Function Documentation

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const Vec3D a 
)

Adds all elements of the vector to an output stream. NB: this is a global function and a friend of the Vec3D class!

Parameters
[in]osthe output stream,
[in]aThe vector of interest
Returns
the output stream with vector elements added
381 {
382  os << a.X << ' ' << a.Y << ' ' << a.Z;
383  return os;
384 }
const Scalar * a
Definition: level2_cplx_impl.h:32

◆ operator>>()

std::istream& operator>> ( std::istream &  is,
Vec3D a 
)

Reads all elements of a given vector from an input stream. NB: this is a global function and a friend of the Vec3D class!

Parameters
[in,out]isthe input stream
[in,out]athe vector to be read in
Returns
the input stream from which the vector elements were read
394 {
395  is >> a.X;
396  is >> a.Y;
397  is >> a.Z;
398  //TW: clearing the stream avoids the nasty problem on ARM processors that the failbit is set to true if numbers below DBL_MIN=1e-308 are read.
399  #if defined(__arm__) || defined(__aarch64__)
400  if (is.fail()) {
402  logger(VERBOSE, "Read in subnormal number %", a);
403  is.clear();
404  }
405  }
406  #endif
407  return is;
408 }
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:36
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
#define min(a, b)
Definition: datatypes.h:22
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117