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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 60 of file dgrmatrix-io.hpp.

References dgrmatrix::a, i(), dgrmatrix::ia, dgrmatrix::ja, dgrmatrix::m, and dgrmatrix::n.

61 {CPPL_VERBOSE_REPORT;
62  for(CPPL_INT i=0; i<mat.m; i++){
63  int k_beg =mat.ia[i]-1;
64  int k_end =mat.ia[i+1]-1;
65  int j =0;
66  for(int k=k_beg; k<k_end; k++){
67  if(j<mat.ja[k]-1){
68  for(; j<mat.ja[k]-1; j++){
69  s << " x";
70  }
71  }
72  s << " " << mat.a[k];
73  j++;
74  }
75  for(; j<mat.n; j++){
76  s << " x";
77  }
78  s << std::endl;
79  }
80 
81  return s;
82 }
std::vector< double > a
matrix component values
Definition: dgrmatrix.hpp:11
std::vector< CPPL_INT > ia
rowIndex (NOT zero-based BUT one-based indexing)
Definition: dgrmatrix.hpp:12
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: dgrmatrix.hpp:10
CPPL_INT m
matrix row size
Definition: dgrmatrix.hpp:9
std::vector< CPPL_INT > ja
columns (NOT zero-based BUT one-based indexing)
Definition: dgrmatrix.hpp:13