summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-03 13:26:02 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-03 13:26:02 -0300
commit60e0f9b63c9825a265a93a278bf018d301063ea2 (patch)
treef3d832a897ca52b7801af67df73f8c9bd818d996
parent91ede51679851cb4793b7f4274f13ce071376343 (diff)
downloadcode-60e0f9b63c9825a265a93a278bf018d301063ea2.tar.gz
code-60e0f9b63c9825a265a93a278bf018d301063ea2.tar.bz2
code-60e0f9b63c9825a265a93a278bf018d301063ea2.zip
Don't process empty files
-rw-r--r--get_energy.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/get_energy.cpp b/get_energy.cpp
index 857c1c4..6164a6d 100644
--- a/get_energy.cpp
+++ b/get_energy.cpp
@@ -135,6 +135,7 @@ int main(int argc, char* argv[]) {
std::string file_end = std::to_string(p) + "_" + std::to_string(s) + "_" + std::to_string(λ) + "_" + std::to_string(τ₀) + "_" + std::to_string(y) + "_" + std::to_string(log2n) + "_" + std::to_string(τₘₐₓ) + ".dat";
std::ifstream cfile("C_"+file_end, std::ios::binary);
+ if (cfile.is_open()) {
cfile.read((char*)(C.data()), C.size() * sizeof(Real));
cfile.close();
std::ifstream rfile("R_"+file_end, std::ios::binary);
@@ -150,6 +151,7 @@ int main(int argc, char* argv[]) {
std::vector<Complex> Ct = fft.fourier(C);
std::cout << y << " " << energy << " " << Ct[0].real() << std::endl;
+ }
}
return 0;