From 1683ef8768ba04bba77ac6330eff61ae4e6e7911 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 12 Nov 2021 16:53:19 +0100 Subject: Fixed a bug in parameter pack expansion. --- collectStokesData.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/collectStokesData.hpp b/collectStokesData.hpp index b32ccf0..eae81fd 100644 --- a/collectStokesData.hpp +++ b/collectStokesData.hpp @@ -6,7 +6,6 @@ using Complex = std::complex; template void collectStokesData(std::string tag, unsigned N, Generator& r, double ε, double δz, bool minimum, T... μs) { - std::ofstream file("stokes_info_" + tag + ".dat"); unsigned nGs = 8; unsigned nTs = 32; Real newSaddleThres = 1e-4; @@ -55,6 +54,11 @@ void collectStokesData(std::string tag, unsigned N, Generator& r, double ε, dou M *= exp(Complex(0, φ)); + Cord c(M, zMin, zSaddle, nGs); + c.relaxNewton(nTs, 1, 1e-10, 1e3); + + std::ofstream file("stokes_info_" + tag + ".dat"); + file.precision(15); file << N << std::endl; @@ -63,7 +67,7 @@ void collectStokesData(std::string tag, unsigned N, Generator& r, double ε, dou std::ofstream tensorFile("stokes_tensor_" + tag + ".dat", std::ios::out | std::ios::binary | std::ios::trunc); std::apply([&tensorFile](const Tensor&... Js) -> void { - std::make_tuple(tensorFile.write(Js.data(), Js.size() * sizeof(Complex))...); + (tensorFile.write((char*)Js.data(), Js.size() * sizeof(Real)), ...); } , ReM.Js); file << xMin.transpose() << std::endl; @@ -74,9 +78,6 @@ void collectStokesData(std::string tag, unsigned N, Generator& r, double ε, dou file << eigenSz.eigenvalues().transpose() << std::endl; file << φ << " " << (xMin - zSaddle).norm() << std::endl; - Cord c(M, zMin, zSaddle, nGs); - c.relaxNewton(nTs, 1, 1e-10, 1e3); - Real reConstraintError = 0; Real imConstraintError = 0; Real imEnergyError = 0; -- cgit v1.2.3-70-g09d2