6 std::cerr <<
"# [MARK] dsymatrix::operator()(const long&, const long&)"
11 if( i<0 || j<0 || N<=i || N<=j ){
12 std::cerr <<
"[ERROR] dsymatrix::operator()(long, long)" << std::endl
13 <<
"The required component is out of the matrix size."
15 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
34 std::cerr <<
"# [MARK] dsymatrix::operator()(const long&, const long&) const"
39 if( i<0 || j<0 || N<=i || N<=j ){
40 std::cerr <<
"[ERROR] dsymatrix::operator()(long, long)" << std::endl
41 <<
"The required component is out of the matrix size."
43 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
63 inline void dsymatrix::set(
const long& i,
const long& j,
const double& v)
const
66 std::cerr <<
"# [MARK] dsymatrix::set(const long&, const long&, const double&) const"
71 if( i<0 || j<0 || N<=i || N<=j ){
72 std::cerr <<
"[ERROR] dsymatrix::set(long&, long&, double&) const"
74 <<
"The required component is out of the matrix size."
76 <<
"Your input was (" << i <<
"," << j <<
")." << std::endl;
95 inline std::ostream& operator<<(std::ostream& s,
const dsymatrix& mat)
98 std::cerr <<
"# [MARK] operator<<(std::ostream&, const dsymatrix&)"
102 for(
long i=0; i<mat.N; i++){
103 for(
long j=0; j<mat.N; j++){
105 s <<
" " << mat(i,j) <<
" ";
107 s <<
"{" << mat(i,j) <<
"} ";
120 inline void dsymatrix::write(
const char* filename)
const
123 std::cerr <<
"# [MARK] dsymatrix::write(const char*) const"
127 std::ofstream s(filename, std::ios::trunc);
129 s <<
"dsymatrix" <<
" " << N << std::endl;
130 for(
long i=0;
i<N;
i++){
131 for(
long j=0; j<=
i; j++ ){
141 inline void dsymatrix::read(
const char* filename)
144 std::cerr <<
"# [MARK] dsymatrix::read(const char*)"
148 std::ifstream s(filename);
150 std::cerr <<
"[ERROR] dsymatrix::read(const char*) " << std::endl
151 <<
"The file \"" << filename <<
"\" can not be opened."
158 if(
id !=
"dsymatrix" ){
159 std::cerr <<
"[ERROR] dsymatrix::read(const char*) " << std::endl
160 <<
"The type name of the file \"" << filename
161 <<
"\" is not dsymatrix." << std::endl
162 <<
"Its type name was " <<
id <<
" ." << std::endl;
168 for(
long i=0;
i<N;
i++){
169 for(
long j=0; j<=
i; j++ ){
174 std::cerr <<
"[ERROR] dsymatrix::read(const char*) " << std::endl
175 <<
"There is something is wrong with the file \""
176 << filename <<
" ." << std::endl
177 <<
"Most likely, there is not enough data components, "
178 <<
"or a linefeed code or space code is missing "
179 <<
"at the end of the last line." << std::endl;
friend _dgematrix i(const dsymatrix &)
Definition: dsymatrix-calc.hpp:22
void set(const long &, const long &, const double &) const
Definition: dsymatrix-io.hpp:63
Real Double-precision Symmetric Matrix Class [L-type (UPLO=L) Strage].
Definition: dsymatrix.hpp:3
double & operator()(const long &, const long &)
Definition: dsymatrix-io.hpp:3
void resize(const long &)
Definition: dsymatrix-misc.hpp:130