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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 34 of file _zhsmatrix-io.hpp.

References _zhsmatrix::data, _zhsmatrix::destroy(), i(), _zhsmatrix::line, and _zhsmatrix::n.

35 {CPPL_VERBOSE_REPORT;
36  for(CPPL_INT i=0; i<mat.n; i++){
37  for(CPPL_INT j=0; j<mat.n; j++){
38  if( i >= j ){
39  std::vector<CPPL_INT>::iterator q;
40  const std::vector<CPPL_INT>::iterator mat_line_i_end =mat.line[i].end();
41  for(q=mat.line[i].begin(); q!=mat_line_i_end; q++){
42  if( mat.data[*q].j==j ){ break; }
43  }
44  if(q!=mat_line_i_end){ s << " " << mat.data[*q].v << " "; }
45  else{ s << " x "; }
46  }
47  else{//i<j
48  std::vector<CPPL_INT>::iterator q;
49  const std::vector<CPPL_INT>::iterator mat_line_i_end =mat.line[i].end();
50  for(q=mat.line[i].begin(); q!=mat_line_i_end; q++){
51  if( mat.data[*q].j==j ){ break; }
52  }
53  if(q!=mat_line_i_end){ s << "{" << mat.data[*q].v << "}"; }
54  else{ s << "{x}"; }
55  }
56  }
57  s << std::endl;
58  }
59 
60  mat.destroy();
61  return s;
62 }
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
void destroy() const
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _zhsmatrix.hpp:13