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

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

194 {CPPL_VERBOSE_REPORT;
195  for(CPPL_INT i=0; i<mat.m; i++){
196  const std::vector<CPPL_INT>::const_iterator mat_rows_i_end =mat.rows[i].end();
197  for(CPPL_INT j=0; j<mat.n; j++){
198  std::vector<CPPL_INT>::const_iterator q;
199  for(q=mat.rows[i].begin(); q!=mat_rows_i_end; q++){
200  if(mat.data[*q].j==j){ break; }
201  }
202  if(q!=mat_rows_i_end){ s << " " << mat.data[*q].v; }
203  else{ s << " x"; }
204  }
205  s << std::endl;
206  }
207 
208  return s;
209 }
std::vector< dcomponent > data
matrix data
Definition: dgsmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: dgsmatrix.hpp:10
_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: dgsmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: dgsmatrix.hpp:9