@@ -96,9 +96,15 @@ void compute_ekb(const Parallel_Orbitals* pv,
9696 {
9797 bb = 0.0 ;
9898 }
99- if (aa > 0.0 || bb > 0.0 )
99+ if (std::abs (aa) > 0.0 || std::abs (bb) > 0.0 )
100100 {
101- ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
101+ std::streamsize original_precision = ofs_running.precision ();
102+ ofs_running << std::fixed << std::setprecision (8 );
103+ ofs_running << " i = " << std::setw (2 ) << i << " , j = " << std::setw (2 ) << j
104+ << " , Eij = " << std::setw (12 ) << aa << " + " << std::setw (12 ) << bb << " i"
105+ << std::endl;
106+ ofs_running.unsetf (std::ios_base::fixed);
107+ ofs_running.precision (original_precision);
102108 }
103109 }
104110 }
@@ -233,9 +239,15 @@ void compute_ekb_tensor(const Parallel_Orbitals* pv,
233239 {
234240 bb = 0.0 ;
235241 }
236- if (aa > 0.0 || bb > 0.0 )
242+ if (std::abs (aa) > 0.0 || std::abs (bb) > 0.0 )
237243 {
238- ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
244+ std::streamsize original_precision = ofs_running.precision ();
245+ ofs_running << std::fixed << std::setprecision (8 );
246+ ofs_running << " i = " << std::setw (2 ) << i << " , j = " << std::setw (2 ) << j
247+ << " , Eij = " << std::setw (12 ) << aa << " + " << std::setw (12 ) << bb << " i"
248+ << std::endl;
249+ ofs_running.unsetf (std::ios_base::fixed);
250+ ofs_running.precision (original_precision);
239251 }
240252 }
241253 }
@@ -371,9 +383,15 @@ void compute_ekb_tensor_lapack(const Parallel_Orbitals* pv,
371383 {
372384 bb = 0.0 ;
373385 }
374- if (aa > 0.0 || bb > 0.0 )
386+ if (std::abs (aa) > 0.0 || std::abs (bb) > 0.0 )
375387 {
376- ofs_running << i << " " << j << " " << aa << " +" << bb << " i " << std::endl;
388+ std::streamsize original_precision = ofs_running.precision ();
389+ ofs_running << std::fixed << std::setprecision (8 );
390+ ofs_running << " i = " << std::setw (2 ) << i << " , j = " << std::setw (2 ) << j
391+ << " , Eij = " << std::setw (12 ) << aa << " + " << std::setw (12 ) << bb << " i"
392+ << std::endl;
393+ ofs_running.unsetf (std::ios_base::fixed);
394+ ofs_running.precision (original_precision);
377395 }
378396 }
379397 }
0 commit comments