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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 200 of file zgsmatrix-io.hpp.

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

201 {CPPL_VERBOSE_REPORT;
202  for(CPPL_INT i=0; i<mat.m; i++){
203  const std::vector<CPPL_INT>::const_iterator mat_rows_i_end =mat.rows[i].end();
204  for(CPPL_INT j=0; j<mat.n; j++){
205  std::vector<CPPL_INT>::const_iterator q;
206  for(q=mat.rows[i].begin(); q!=mat_rows_i_end; q++){
207  if(mat.data[*q].j==j){ break; }
208  }
209  if(q!=mat_rows_i_end){ s << " " << mat.data[*q].v; }
210  else{ s << " x"; }
211  }
212  s << std::endl;
213  }
214 
215  return s;
216 }
_dgematrix i(const _dgbmatrix &mat)
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
Definition: zgsmatrix.hpp:12
std::vector< zcomponent > data
matrix data
Definition: zgsmatrix.hpp:11
CPPL_INT m
matrix row size
Definition: zgsmatrix.hpp:9
CPPL_INT n
matrix column size
Definition: zgsmatrix.hpp:10