diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-05-10 16:54:21 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-05-10 16:54:21 -0300 |
commit | ed91704b302cbe3500378810aac6acad342e0cc9 (patch) | |
tree | 69717fabbdd931033df7f6cb6c7a72058ee87a3a | |
parent | bb2341c97a01ee74d972db2f9e59a1e8bcfb7e2a (diff) | |
download | code-ed91704b302cbe3500378810aac6acad342e0cc9.tar.gz code-ed91704b302cbe3500378810aac6acad342e0cc9.tar.bz2 code-ed91704b302cbe3500378810aac6acad342e0cc9.zip |
Enforce monotony of R
-rw-r--r-- | log-fourier_integrator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/log-fourier_integrator.cpp b/log-fourier_integrator.cpp index 2359c80..e127fc1 100644 --- a/log-fourier_integrator.cpp +++ b/log-fourier_integrator.cpp @@ -147,6 +147,13 @@ int main(int argc, char* argv[]) { Real C₀ = Cₜ₊₁[0]; + + Real Rmax = 0; + for (unsigned i = 0; i < N; i++) { + if (Rₜ₊₁[N-1-i] > Rmax) Rmax = Rₜ₊₁[N-1-i]; + Rₜ₊₁[N-1-i] = Rmax; + } + bool trigger0 = false; bool trigger1 = false; for (unsigned i = 0; i < N; i++) { |