summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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];