CPPLapack
 All Classes Files Functions Variables Friends
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 32 of file _zhsmatrix-io.hpp.

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

{VERBOSE_REPORT;
  for(long i=0; i<mat.n; i++){
    for(long j=0; j<mat.n; j++){
      if( i >= j ){
        std::vector<uint32_t>::iterator q;
        for(q=mat.line[i].begin(); q!=mat.line[i].end(); q++){
          if( long(mat.data[*q].j)==j ){ break; }
        }
        if(q!=mat.line[i].end()){ s << " " << mat.data[*q].v << " "; }
        else{ s << " x "; }
      }
      else{//i<j
        std::vector<uint32_t>::iterator q;
        for(q=mat.line[i].begin(); q!=mat.line[i].end(); q++){
          if( long(mat.data[*q].j)==j ){ break; }
        }
        if(q!=mat.line[i].end()){ s << "{" << mat.data[*q].v << "}"; }
        else{ s << "{x}"; }
      }
    }
    s << std::endl;
  }
  
  mat.destroy();
  return s;
}
 All Classes Files Functions Variables Friends