Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/source_io/single_R_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@

inline void write_data(std::ofstream& ofs, const double& data)
{
ofs << " " << std::fixed << std::scientific << std::setprecision(8) << data;
ofs << " " << data;
}
inline void write_data(std::ofstream& ofs, const std::complex<double>& data)
{
ofs << " (" << std::fixed << std::scientific << std::setprecision(8) << data.real() << ","
<< std::fixed << std::scientific << std::setprecision(8) << data.imag() << ")";
ofs << " (" << data.real() << "," << data.imag() << ")";
}

template<typename T>
Expand Down Expand Up @@ -68,7 +67,8 @@ void ModuleIO::output_single_R(std::ofstream& ofs,

if (!reduce || GlobalV::DRANK == 0)
{
int nonzeros_count = 0;
long long nonzeros_count = 0;
ofs << std::fixed << std::scientific << std::setprecision(8);
for (int col = 0; col < PARAM.globalv.nlocal; ++col)
{
if (std::abs(line[col]) > sparse_threshold)
Expand Down Expand Up @@ -106,7 +106,7 @@ void ModuleIO::output_single_R(std::ofstream& ofs,
ifs_tem1.close();
for (auto &i : indptr)
{
ofs.write(reinterpret_cast<char *>(&i), sizeof(int));
ofs.write(reinterpret_cast<char *>(&i), sizeof(long long));
}
}
else
Expand Down
Loading