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 29 of file _dgsmatrix-io.hpp.

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

30 {CPPL_VERBOSE_REPORT;
31  for(CPPL_INT i=0; i<mat.m; i++){
32  for(CPPL_INT j=0; j<mat.n; j++){
33  std::vector<CPPL_INT>::iterator q;
34  const std::vector<CPPL_INT>::iterator mat_rows_i_end =mat.rows[i].end();
35  for(q=mat.rows[i].begin(); q!=mat_rows_i_end; q++){
36  if(mat.data[*q].j==j){ break; }
37  }
38  if(q!=mat_rows_i_end){ s << " " << mat.data[*q].v; }
39  else{ s << " x"; }
40  }
41  s << std::endl;
42  }
43 
44  mat.destroy();
45  return s;
46 }
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 n
matrix column size
Definition: _dgsmatrix.hpp:10
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT m
matrix row size
Definition: _dgsmatrix.hpp:9
void destroy() const
std::vector< dcomponent > data
matrix data
Definition: _dgsmatrix.hpp:11