@@ -10,7 +10,6 @@ void output::printrm(std::ofstream &ofs,const std::string &s, const ModuleBase::
1010 if (b1*b2 == 0 ) return ;
1111 for (int i = 0 ;i < b1;i++)
1212 {
13- // ofs<<"\n row = "<<i;
1413 for (int j = 0 ;j < b2;j++)
1514 {
1615 if (j % 8 == 0 ) ofs << " \n " ;
@@ -41,182 +40,16 @@ void output::printrm(const std::string &s, const ModuleBase::matrix &m, const do
4140 // std::cout << "\n row=" << i;
4241 for (int j = 0 ;j < b2;j++)
4342 {
44- // if (j % 4 == 0) std::cout << "\n ";
4543 if (j % 8 == 0 ) std::cout << " \n " ;
46- // if (std::abs(m(i,j)) > limit) std::cout << std::setprecision(15) << std::setw(20) << m(i,j);
4744 if (std::abs (m (i,j)) > limit) std::cout << std::setprecision (6 ) << std::setw (12 ) << m (i,j);
48- // else std::cout<<std::setw(20)<<"0";
4945 else std::cout<<std::setw (12 )<<" 0" ;
5046 }
51- // std::cout << "\n";
5247 }
5348
5449 std::cout << std::endl;
5550 return ;
5651}
5752
58- /*
59- void output::printcm_norm(std::ofstream &ofs, const std::string &s, const ModuleBase::ComplexMatrix &m, const double &limit)
60- {
61- const int b1 = m.nr;
62- const int b2 = m.nc;
63- ofs << "\n" << s << " nr=" << b1 << " nc=" << b2 ;
64-
65- if (b1*b2 == 0) return;
66- for (int i = 0;i < b1;i++)
67- {
68- for (int j = 0;j < b2;j++)
69- {
70- if (j % 8 == 0) ofs << "\n ";
71- double norm = ( conj( m(i, j) ) * m(i, j) ).real();
72- if (std::abs(norm) > limit) ofs<< std::setw(12) << sqrt(norm);
73- else ofs<<std::setw(12)<<"0";
74- }
75- }
76- return;
77- }
78- */
79-
80- /*
81- void output::printcm_norm(const std::string &s, const ModuleBase::ComplexMatrix &m, const double &limit)
82- {
83- const int b1 = m.nr;
84- const int b2 = m.nc;
85- std::cout << "\n" << s << " nr=" << b1 << " nc=" << b2 ;
86-
87- if (b1*b2 == 0) return;
88- for (int i = 0;i < b1;i++)
89- {
90- for (int j = 0;j < b2;j++)
91- {
92- if (j % 8 == 0) std::cout << "\n ";
93- double norm = ( conj( m(i, j) ) * m(i, j) ).real();
94- if (std::abs(norm) > limit) std::cout<< std::setw(12) << sqrt(norm);
95- else std::cout<<std::setw(12)<<"0";
96- }
97- }
98- return;
99- }
100- */
101-
102-
103- /*
104- void output::printcm(std::ofstream &ofs, const std::string &s, const ModuleBase::ComplexMatrix &m)
105- {
106- const int b1 = m.nr;
107- const int b2 = m.nc;
108- ofs << "\n" << s << " " << b1 << " " << b2 ;
109-
110- if (b1*b2 == 0) return;
111-
112- ofs.setf(std::ios::scientific, std::ios::floatfield);
113- for (int i = 0;i < b1;i++)
114- {
115- for (int j = 0;j < b2;j++)
116- {
117- if (j%2 == 0) ofs << "\n ";
118- ofs << std::setw(20) << m(i, j).real() << std::setw(20) << m(i, j).imag();
119- }
120- }
121- ofs.unsetf(std::ios::scientific);
122- return;
123- }//end print cm
124- */
125-
126- /*
127- void output::printcm(const std::string &s, const ModuleBase::ComplexMatrix &m)
128- {
129- const int b1 = m.nr;
130- const int b2 = m.nc;
131- std::cout << "\n" << s << " nr = " << b1 << " nc = " << b2 ;
132-
133- if (b1*b2 == 0) return;
134-
135- for (int i = 0;i < b1;i++)
136- {
137- for (int j = 0;j < b2;j++)
138- {
139- if (j % 4 == 0) std::cout << "\n ";
140- std::cout << std::setw(18) << m(i, j);
141- }
142- }
143- return;
144- }
145- */
146-
147- /*
148- void output::printcm_real_limit_hermit(const std::string &s, const ModuleBase::ComplexMatrix &m,const double &limit)
149- {
150- const int b1 = m.nr;
151- const int b2 = m.nc;
152- std::cout << "\n" << s << " nr = " << b1 << " nc = " << b2 ;
153-
154- if (b1*b2 == 0) return;
155-
156- for (int i = 0;i < b1;i++)
157- {
158- for (int j = 0;j < b2;j++)
159- {
160- if (j % 8 == 0) std::cout << "\n ";
161- const double x = m(i,j).real();
162- if (std::abs(x) < limit || i < j) std::cout<<std::setw(12)<<"0";
163- else std::cout << std::setw(12) << x;
164- }
165- }
166- return;
167- }
168- */
169-
170- /*
171- void output::printcm_real(const std::string &s, const ModuleBase::ComplexMatrix &m,const double &limit)
172- {
173- const int b1 = m.nr;
174- const int b2 = m.nc;
175- std::cout << "\n " << s << " nr = " << b1 << " nc = " << b2 ;
176-
177- if (b1*b2 == 0) return;
178-
179- for (int i = 0;i < b1;i++)
180- {
181- for (int j = 0;j < b2;j++)
182- {
183- if (j % 8 == 0) std::cout << "\n ";
184- const double x = m(i,j).real();
185- if (std::abs(x) < limit ) std::cout<<std::setw(12)<<"0";
186- else std::cout << std::setw(12) << x;
187- }
188- }
189- return;
190- }
191- */
192-
193-
194- /*
195- void output::printcm_imag(const std::string &s, const ModuleBase::ComplexMatrix &m,const double &limit)
196- {
197- const int b1 = m.nr;
198- const int b2 = m.nc;
199- std::cout << "\n " << s << " nr = " << b1 << " nc = " << b2 ;
200-
201- if (b1*b2 == 0) return;
202-
203- for (int i = 0;i < b1;i++)
204- {
205- for (int j = 0;j < b2;j++)
206- {
207- if (j % 8 == 0) std::cout << "\n ";
208- const double x = m(i,j).imag();
209- if (std::abs(x) < limit ) std::cout<<std::setw(12)<<"0";
210- else std::cout << std::setw(12) << x;
211- }
212- }
213- return;
214- }
215- */
216-
217-
218-
219-
22053
22154void output::printr3_d (std::ofstream &ofs, const std::string &s,const ModuleBase::realArray &u)
22255{
@@ -241,31 +74,6 @@ void output::printr3_d(std::ofstream &ofs, const std::string &s,const ModuleBase
24174 return ;
24275}// end printr3_d
24376
244- /*
245- void output::printr4_d(std::ofstream &ofs, const std::string &s,const ModuleBase::realArray &u)
246- {
247- const int b1 = u.getBound1();
248- const int b2 = u.getBound2();
249- const int b3 = u.getBound3();
250- const int b4 = u.getBound4();
251- ofs << "\n\n " << s << " b1 = " << b1 << " b2 = " << b2
252- << " b3 = " << b3 << " b4 = " << b4;
253-
254- if (u.getSize() == 0) return;
255-
256- for (int i = 0;i < b1;i++)
257- for (int j = 0;j < b2;j++)
258- for (int k = 0;k < b3;k++)
259- for (int m = 0;m < b4;m++)
260- {
261- if (m % 4 == 0)
262- {
263- ofs << "\n";
264- }
265- ofs << std::setw(15) << u(i, j, k, m);
266- }
267- }//end print4_d
268- */
26977
27078void output::printM3 (std::ofstream &ofs,const std::string &description, const ModuleBase::Matrix3 &m)
27179{
0 commit comments