summaryrefslogtreecommitdiff
path: root/fourier_integrator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fourier_integrator.cpp')
-rw-r--r--fourier_integrator.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/fourier_integrator.cpp b/fourier_integrator.cpp
index 24a7f1d..7669ca0 100644
--- a/fourier_integrator.cpp
+++ b/fourier_integrator.cpp
@@ -94,10 +94,13 @@ int main(int argc, char* argv[]) {
Rt = fft.fourier(R);
} else {
std::ifstream cfile(fourierFile("C", p, s, λ, τ₀, y, log2n, τₘₐₓ), std::ios::binary);
- cfile.read((char*)(C.data()), C.size() * sizeof(Real));
+ cfile.read((char*)(C.data()), (C.size() / 2) * sizeof(Real));
cfile.close();
+ for (unsigned i = 1; i < n; i++) {
+ C[2 * n - i] = C[i];
+ }
std::ifstream rfile(fourierFile("R", p, s, λ, τ₀, y, log2n, τₘₐₓ), std::ios::binary);
- rfile.read((char*)(R.data()), R.size() * sizeof(Real));
+ rfile.read((char*)(R.data()), (R.size() / 2) * sizeof(Real));
rfile.close();
Ct = fft.fourier(C);
@@ -165,11 +168,11 @@ int main(int argc, char* argv[]) {
std::cerr << "y " << y << " " << e << " " << z << std::endl;
std::ofstream outfile(fourierFile("C", p, s, λ, τ₀, y, log2n, τₘₐₓ), std::ios::out | std::ios::binary);
- outfile.write((const char*)(C.data()), C.size() * sizeof(Real));
+ outfile.write((const char*)(C.data()), (C.size() / 2) * sizeof(Real));
outfile.close();
std::ofstream outfileR(fourierFile("R", p, s, λ, τ₀, y, log2n, τₘₐₓ), std::ios::out | std::ios::binary);
- outfileR.write((const char*)(R.data()), R.size() * sizeof(Real));
+ outfileR.write((const char*)(R.data()), (R.size() / 2) * sizeof(Real));
outfileR.close();
}