6 std::cerr <<
"# [MARK] dgematrix::operator()(const long&, const long&)"
11 if( i<0 || j<0 || M<=i || N<=j ){
12 std::cerr <<
"[ERROR] dgematrix::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] dgematrix::operator()(const long&, const long&) const"
34 if( i<0 || j<0 || M<=i || N<=j ){
35 std::cerr <<
"[ERROR] dgematrix::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 dgematrix::set(
const long& i,
const long& j,
const double& v)
const
56 std::cerr <<
"# [MARK] dgematrix::set(const long&, const long&, const double&) const"
61 if( i<0 || j<0 || M<=i || N<=j ){
62 std::cerr <<
"[ERROR] dgematrix::set(long&, long&, 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 dgematrix& mat)
83 std::cerr <<
"# [MARK] operator<<(std::ostream&, const dgematrix&)"
87 for(
long i=0; i<mat.M; i++){
88 for(
long j=0; j<mat.N; j++){
101 inline void dgematrix::write(
const char* filename)
const
104 std::cerr <<
"# [MARK] dgematrix::write(const char*) const"
108 std::ofstream s(filename, std::ios::trunc);
110 s <<
"dgematrix" <<
" " << M <<
" " << N << std::endl;
111 for(
long i=0;
i<M;
i++){
112 for(
long j=0; j<N; j++ ){
122 inline void dgematrix::read(
const char* filename)
125 std::cerr <<
"# [MARK] dgematrix::read(const char*)"
129 std::ifstream s( filename );
131 std::cerr <<
"[ERROR] dgematrix::read(const char*) " << std::endl
132 <<
"The file \"" << filename <<
"\" can not be opened."
139 if(
id !=
"dgematrix" ){
140 std::cerr <<
"[ERROR] dgematrix::read(const char*) " << std::endl
141 <<
"The type name of the file \"" << filename
142 <<
"\" is not dgematrix." << 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] dgematrix::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: dgematrix-misc.hpp:126
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
void set(const long &, const long &, const double &) const
Definition: dgematrix-io.hpp:53
friend _dgematrix i(const dgematrix &)
Definition: dgematrix-calc.hpp:21
double & operator()(const long &, const long &)
Definition: dgematrix-io.hpp:3