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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 180 of file dgsmatrix-io.hpp.

References dgsmatrix::data, i(), dgsmatrix::m, dgsmatrix::n, and dgsmatrix::rows.

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