summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-04-25 16:42:00 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2020-04-25 16:42:00 +0200
commit8df7a7e494d734ae4c82a229a89e88eaf69288e9 (patch)
tree26e275f57ecd5192a8e3a2dcf4bfdba76c96543a
parentdeffe8cc304de95204fa9192e8d1a12f4a1d26e1 (diff)
Small code clean-up in powermap.cc
-rw-r--r--src/powermap.cc5
1 files 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];