From 291149306dd3920e810ed22ca87bc055176781ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Mon, 20 Apr 2020 00:14:45 +0200 Subject: Add stub for unit test and fix a bug in Powermap. --- src/powermap.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/powermap.cc b/src/powermap.cc index 00365af..a400cf9 100644 --- a/src/powermap.cc +++ b/src/powermap.cc @@ -48,7 +48,7 @@ Power computeValue( auto const y0 = P0.out; auto const y1 = P1.out; auto const dx = x1 - x0; - auto const x_prime = (x - x1)/dx; + auto const x_prime = (x - x0)/dx; return h00(x_prime)*y0 + h10(x_prime)*dx*m0 + h01(x_prime)*y1 + h11(x_prime)*dx*m1; } @@ -131,6 +131,7 @@ void Powermap::updateSpline() assert(0. <= fixed[0].out && fixed[0].out <= fixed[1].out && fixed[1].out <= fixed[2].out && fixed[2].out <= 1.); + // TODO: What to do if fixed[0] is (0,0) or fixed[2] is (1,1)?? Powers X = shelf ? Powers{fixed[0].in, fixed[1].in, fixed[2].in} : Powers{0., fixed[0].in, fixed[1].in, fixed[2].in, 1.}; Powers P = shelf ? Powers{fixed[0].out, fixed[1].out, fixed[2].out} -- cgit v1.2.3