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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 31 of file _dssmatrix-io.hpp.

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

32 {CPPL_VERBOSE_REPORT;
33  for(CPPL_INT i=0; i<mat.n; i++){
34  for(CPPL_INT j=0; j<mat.n; j++){
35  if( i >= j ){
36  std::vector<CPPL_INT>::iterator q;
37  const std::vector<CPPL_INT>::iterator mat_line_i_end =mat.line[i].end();
38  for(q=mat.line[i].begin(); q!=mat_line_i_end; q++){
39  if(mat.data[*q].j==j){ break; }
40  }
41  if(q!=mat_line_i_end){ s << " " << mat.data[*q].v << " "; }
42  else{ s << " x "; }
43  }
44  else{//i<j
45  std::vector<CPPL_INT>::iterator q;
46  const std::vector<CPPL_INT>::iterator mat_line_i_end =mat.line[i].end();
47  for(q=mat.line[i].begin(); q!=mat_line_i_end; q++){
48  if(mat.data[*q].j==j){ break; }
49  }
50  if(q!=mat_line_i_end){ s << "{" << mat.data[*q].v << "}"; }
51  else{ s << "{x}"; }
52  }
53  }
54  s << std::endl;
55  }
56 
57  mat.destroy();
58  return s;
59 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13
void destroy() const