CPPLapack
 All Classes Files Functions Variables Friends
Functions
zhematrix-io.hpp File Reference

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &s, const zhematrix &mat)

Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const zhematrix mat 
) [inline]

Definition at line 65 of file zhematrix-io.hpp.

References conj(), i(), imag(), and zhematrix::n.

{VERBOSE_REPORT;
  for(long i=0; i<mat.n; i++){
    for(long j=0; j<mat.n; j++){ 
      if(i>j){ s << " " << mat(i,j) << " "; }
      else if(i==j){ s << " " << std::real(mat(i,i)) << " "; }
      else{ s << "{" << std::conj(mat(j,i)) << "} "; }
    }
    s << std::endl;
    
#ifdef  CPPL_DEBUG
    if(std::fabs(std::imag(mat(i,i))) > DBL_MIN){
      WARNING_REPORT;
      std::cerr << "The " << i << "th diagonal component of the zhematrix is not a real number." << std::endl;
    }
#endif//CPPL_DEBUG
  }
  
  return s;
}
 All Classes Files Functions Variables Friends