summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-05-10 18:14:03 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-05-10 18:14:03 -0300
commit75dc30ef643a62c1864435c8655b505da05a4bcb (patch)
treece6adb1d983987ddfc255982d71af7f0c8ad4df2
parent66e3dec599fc66376f7940e10b5b07276928e453 (diff)
downloadcode-75dc30ef643a62c1864435c8655b505da05a4bcb.tar.gz
code-75dc30ef643a62c1864435c8655b505da05a4bcb.tar.bz2
code-75dc30ef643a62c1864435c8655b505da05a4bcb.zip
Make sure things stop on nan
-rw-r--r--log-fourier_integrator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/log-fourier_integrator.cpp b/log-fourier_integrator.cpp
index 12a3516..627f49e 100644
--- a/log-fourier_integrator.cpp
+++ b/log-fourier_integrator.cpp
@@ -147,6 +147,8 @@ int main(int argc, char* argv[]) {
Real C₀ = Cₜ₊₁[0];
+ if (!std::isnan(Cₜ₊₁[0])) {
+
bool trigger0 = false;
bool trigger1 = false;
for (unsigned i = 0; i < N; i++) {
@@ -189,6 +191,7 @@ int main(int argc, char* argv[]) {
if (Cₜ₊₁[N-1-i] > Cmax) Cmax = Cₜ₊₁[N-1-i];
Cₜ₊₁[N-1-i] = Cmax;
}
+ }
μₜ *= pow(tanh(C₀-1)+1, x);