CPPLapack
 All Classes Files Functions Variables Friends Pages
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.

66 {CPPL_VERBOSE_REPORT;
67  for(CPPL_INT i=0; i<mat.n; i++){
68  for(CPPL_INT j=0; j<mat.n; j++){
69  if(i>j){ s << " " << mat(i,j) << " "; }
70  else if(i==j){ s << " " << std::real(mat(i,i)) << " "; }
71  else{ s << "{" << std::conj(mat(j,i)) << "} "; }
72  }
73  s << std::endl;
74 
75 #ifdef CPPL_DEBUG
76  if(std::fabs(std::imag(mat(i,i))) > DBL_MIN){
77  WARNING_REPORT;
78  std::cerr << "The " << i << "th diagonal component of the zhematrix is not a real number." << std::endl;
79  }
80 #endif//CPPL_DEBUG
81  }
82 
83  return s;
84 }
_dgematrix i(const _dgbmatrix &mat)
_zcovector conj(const _zcovector &vec)
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
dcovec3 imag(const dquater &q)