summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--log-fourier_integrator.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/log-fourier_integrator.cpp b/log-fourier_integrator.cpp
index 1402678..dc7240a 100644
--- a/log-fourier_integrator.cpp
+++ b/log-fourier_integrator.cpp
@@ -124,7 +124,9 @@ int main(int argc, char* argv[]) {
Ȓₜ₋₁[n] = (Real)1.0 / (μ₀ + II * fft.ν(n));
}
} else {
- logFourierLoad(Cₜ₋₁, Rₜ₋₁, Ĉₜ₋₁, Ȓₜ₋₁, p, s, λ, τ₀, β₀, log2n, Δτ, logShift);
+ if (!logFourierLoad(Cₜ₋₁, Rₜ₋₁, Ĉₜ₋₁, Ȓₜ₋₁, p, s, λ, τ₀, β₀, log2n, Δτ, logShift)) {
+ return 1;
+ }
μₜ₋₁ = estimateZ(fft, Cₜ₋₁, Ĉₜ₋₁, Rₜ₋₁, Ȓₜ₋₁, p, s, λ, τ₀, β₀);
}
@@ -190,12 +192,9 @@ int main(int argc, char* argv[]) {
Ȓₜ[i] += γ * (Ȓₜ₊₁[i] - Ȓₜ[i]);
}
- if (ΔCₜ > ΔCₜ₋₁ * 5) {
+ if (ΔCₜ > ΔCₜ₋₁ * 5 && ΔCₜ < 1e-9) {
γ = std::max(γ / 2, (Real)1e-2);
}
- if (ΔCₜ < ΔCₜ₋₁) {
- γ = std::min(1.001 * γ, (Real)1);
- }
ΔCₜ₋₁ = ΔCₜ;