QMCPACK
printTinyVector< TinyVector< T, D > > Struct Template Reference

template functor for Vector<TinyVector<T,D> streamn output 0 equivalent values are output as 0. More...

+ Collaboration diagram for printTinyVector< TinyVector< T, D > >:

Static Public Member Functions

static void print (std::ostream &os, const TinyVector< T, D > &r)
 

Detailed Description

template<class T, unsigned D>
struct qmcplusplus::printTinyVector< TinyVector< T, D > >

template functor for Vector<TinyVector<T,D> streamn output 0 equivalent values are output as 0.

In the case of complex or integer type T's this can be added if needed. But now you don't pay for this if unless T is actually real.

Definition at line 229 of file TinyVector.h.

Member Function Documentation

◆ print()

static void print ( std::ostream &  os,
const TinyVector< T, D > &  r 
)
inlinestatic

Definition at line 231 of file TinyVector.h.

232  {
233  for (int d = 0; d < D; d++)
234  if constexpr(IsComplex_t<T>::value)
235  os << std::setw(18) << std::setprecision(10) << r[d];
236  else if constexpr(IsReal_t<T>::value)
237  if (FP_ZERO == std::fpclassify(r[d]))
238  os << std::setw(18) << std::setprecision(10) << 0;
239  else
240  os << std::setw(18) << std::setprecision(10) << r[d];
241  else
242  os << r[d];
243  }

The documentation for this struct was generated from the following file: