6 std::cerr <<
"# [MARK] zgematrix::operator()(const long&, const long&)"
11 if( i<0 || j<0 || M<=i || N<=j ){
12 std::cerr <<
"[ERROR] zgematrix::operator()(long, long)" << std::endl
13 <<
"The required component is out of the matrix size."
15 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
29 std::cerr <<
"# [MARK] zgematrix::operator()(const long&, const long&) const"
34 if( i<0 || j<0 || M<=i || N<=j ){
35 std::cerr <<
"[ERROR] zgematrix::operator()(long, long)" << std::endl
36 <<
"The required component is out of the matrix size."
38 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
53 inline void zgematrix::set(
const long& i,
const long& j,
const std::complex<double>& v)
const
56 std::cerr <<
"# [MARK] zgematrix::set(const long&, const long&, const std::complex<double>&) const"
61 if( i<0 || j<0 || M<=i || N<=j ){
62 std::cerr <<
"[ERROR] zgematrix::set(long&, long&, std::complex<double>&) const"
64 <<
"The required component is out of the matrix size."
66 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
80 inline std::ostream& operator<<(std::ostream& s,
const zgematrix& mat)
83 std::cerr <<
"# [MARK] operator<<(std::ostream&, const zgematrix&)"
87 for(
long i=0; i<mat.M; i++){
88 for(
long j=0; j<mat.N; j++){
101 inline void zgematrix::write(
const char* filename)
const
104 std::cerr <<
"# [MARK] zgematrix::write(const char*) const"
108 std::ofstream s(filename, std::ios::trunc);
110 s <<
"zgematrix" <<
" " << M <<
" " << N << std::endl;
111 for(
long i=0;
i<M;
i++){
112 for(
long j=0; j<N; j++ ){
122 inline void zgematrix::read(
const char* filename)
125 std::cerr <<
"# [MARK] zgematrix::read(const char*)"
129 std::ifstream s( filename );
131 std::cerr <<
"[ERROR] zgematrix::read(const char*) " << std::endl
132 <<
"The file \"" << filename <<
"\" can not be opened."
139 if(
id !=
"zgematrix" ){
140 std::cerr <<
"[ERROR] zgematrix::read(const char*) " << std::endl
141 <<
"The type name of the file \"" << filename
142 <<
"\" is not zgematrix." << std::endl
143 <<
"Its type name was " <<
id <<
" ." << std::endl;
149 for(
long i=0;
i<M;
i++){
150 for(
long j=0; j<N; j++ ){
155 std::cerr <<
"[ERROR] zgematrix::read(const char*) " << std::endl
156 <<
"There is something is wrong with the file \""
157 << filename <<
" ." << std::endl
158 <<
"Most likely, there is not enough data components, "
159 <<
"or a linefeed code or space code is missing "
160 <<
"at the end of the last line." << std::endl;
void resize(const long &, const long &)
Definition: zgematrix-misc.hpp:126
friend _zgematrix i(const zgematrix &)
Definition: zgematrix-calc.hpp:21
Complex Double-precision General Dence Matrix Class.
Definition: zgematrix.hpp:3
std::complex< double > & operator()(const long &, const long &)
Definition: zgematrix-io.hpp:3
void set(const long &, const long &, const std::complex< double > &) const
Definition: zgematrix-io.hpp:53