Commit 61465770 authored by Jorn Baayen's avatar Jorn Baayen

Create a casadi Function for spline unit test. Speedup of factor 10.

parent 0c4d2dfb
......@@ -25,9 +25,11 @@ class TestBSpline1DFit(TestCase):
y_list = np.empty(self.num_test_points - 1)
tck = rtctools.data.interpolation.bspline1d.BSpline1D.fit(
self.x, self.y, monotonicity=monotonicity, curvature=curvature)
x = SX.sym('x')
f = Function('f', [x], [rtctools.data.interpolation.bspline1d.BSpline1D(
*tck)(x)])
for xi in range(self.num_test_points - 1):
y_list[xi] = rtctools.data.interpolation.bspline1d.BSpline1D(
*tck)(self.testpoints[xi])
y_list[xi] = f(self.testpoints[xi])[0]
return y_list
def test_monotonicity(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment