6 std::cerr <<
"# [MARK] _dssmatrix::operator()(const long&, const long&) const"
11 if( i<0 || j<0 ||
M<=i ||
N<=j ){
12 std::cerr <<
"[ERROR] _dssmatrix::operator()(long, long)" << std::endl
13 <<
"The required component is out of the matrix size."
15 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
20 for(
long c=0; c<
VOL; c++){
32 inline std::ostream& operator<<(std::ostream& s,
const _dssmatrix& mat)
35 std::cerr <<
"# [MARK] operator<<(std::ostream&, const _dssmatrix&)"
40 for(
long i=0; i<mat.
M; i++){
41 for(
long j=0; j<mat.
N; j++){
44 if(mat.
Indx[c]==i && mat.
Jndx[c]==j){
break; }
47 if(c!=mat.
VOL){ s << mat.
Array[c] <<
" "; }
62 inline void _dssmatrix::write(
const char* filename)
const
65 std::cerr <<
"# [MARK] _dssmatrix::write(const char*) const"
69 std::ofstream s(filename, std::ios::trunc);
71 s <<
"_dssmatrix" <<
" " <<
M <<
" " <<
N <<
" " <<
CAP << std::endl;
72 for(
long c=0; c<
VOL; c++){
73 s <<
Indx[c] <<
" " <<
Jndx[c] <<
" " <<
Array[c] << std::endl;
(DO NOT USE) Smart-temporary Real Double-precision Sparse Matrix Class
Definition: _dssmatrix.hpp:3
long M
matrix row size
Definition: _dssmatrix.hpp:7
long CAP
the length of data arrays
Definition: _dssmatrix.hpp:9
long * Indx
1D array to store the i-index of non-zero matrix components
Definition: _dssmatrix.hpp:12
double * Array
1D array to store non-zero matrix data
Definition: _dssmatrix.hpp:11
long VOL
the number of non-zero components
Definition: _dssmatrix.hpp:10
long * Jndx
1D array to store the j-index of non-zero matrix components
Definition: _dssmatrix.hpp:13
long N
matrix column size
Definition: _dssmatrix.hpp:8
void destroy() const
Definition: _dssmatrix-misc.hpp:3
double operator()(const long &, const long &) const
Definition: _dssmatrix-io.hpp:3