From 8df7a7e494d734ae4c82a229a89e88eaf69288e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sat, 25 Apr 2020 16:42:00 +0200 Subject: Small code clean-up in powermap.cc --- src/powermap.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/powermap.cc b/src/powermap.cc index dff604f..2dd5df4 100644 --- a/src/powermap.cc +++ b/src/powermap.cc @@ -217,8 +217,9 @@ void Powermap::updateSpline() // } // soft change to enforce monotonicity - if (a2b2 >= 4.5) { - auto const l = std::min(1., (a2b2-4.5)/4.5); + Power threshold = 4.5; // must be >= 0 and < 9. + if (a2b2 >= threshold) { + auto const l = std::min(1., (a2b2-threshold)/(9.-threshold)); auto const tau = 3./sqrt(a2b2); m[i] = (1-l)*m[i] + l*tau*alpha*deltas[i]; m[i+1] = (1-l)*m[i+1] + l*tau*alpha*deltas[i]; -- cgit v1.2.3