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 23 of file _zhematrix-io.hpp.

References conj(), _zhematrix::darray, _zhematrix::destroy(), i(), imag(), and _zhematrix::n.

24 {CPPL_VERBOSE_REPORT;
25  for(CPPL_INT i=0; i<mat.n; i++){
26  for(CPPL_INT j=0; j<mat.n; j++){
27  if(i>j){
28  s << " " << mat(i,j) << " ";
29  }
30  else if(i==j){
31  s << " " << std::real(mat(i,i)) << " ";
32  }
33  else{
34  s << "{" << std::conj(mat.darray[i][j]) << "} ";
35  }
36  }
37  s << std::endl;
38 
39 #ifdef CPPL_DEBUG
40  if(std::fabs(std::imag(mat(i,i))) > DBL_MIN){
41  WARNING_REPORT;
42  std::cerr << "The " << i << "th diagonal component of the zhematrix is not a real number." << std::endl;
43  }
44 #endif//CPPL_DEBUG
45  }
46 
47  mat.destroy();
48  return s;
49 }
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
_dgematrix i(const _dgbmatrix &mat)
_zcovector conj(const _zcovector &vec)
void destroy() const
dcovec3 imag(const dquater &q)
comple ** darray
array of pointers of column head addresses
Definition: _zhematrix.hpp:13