File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 66
77inline void write_data (std::ofstream& ofs, const double & data)
88{
9- ofs << " " << std::fixed << std::scientific << std::setprecision ( 8 ) << data;
9+ ofs << " " << data;
1010}
1111inline void write_data (std::ofstream& ofs, const std::complex <double >& data)
1212{
13- ofs << " (" << std::fixed << std::scientific << std::setprecision (8 ) << data.real () << " ,"
14- << std::fixed << std::scientific << std::setprecision (8 ) << data.imag () << " )" ;
13+ ofs << " (" << data.real () << " ," << data.imag () << " )" ;
1514}
1615
1716template <typename T>
@@ -68,7 +67,8 @@ void ModuleIO::output_single_R(std::ofstream& ofs,
6867
6968 if (!reduce || GlobalV::DRANK == 0 )
7069 {
71- int nonzeros_count = 0 ;
70+ long long nonzeros_count = 0 ;
71+ ofs << std::fixed << std::scientific << std::setprecision (8 );
7272 for (int col = 0 ; col < PARAM.globalv .nlocal ; ++col)
7373 {
7474 if (std::abs (line[col]) > sparse_threshold)
@@ -106,7 +106,7 @@ void ModuleIO::output_single_R(std::ofstream& ofs,
106106 ifs_tem1.close ();
107107 for (auto &i : indptr)
108108 {
109- ofs.write (reinterpret_cast <char *>(&i), sizeof (int ));
109+ ofs.write (reinterpret_cast <char *>(&i), sizeof (long long ));
110110 }
111111 }
112112 else
You can’t perform that action at this time.
0 commit comments