def test_blind1(): # see whether we get segfaults or not. x = numpy.arange(0, 1, 0.1) y = numpy.random.normal(0, 1, len(x)) d = numpy.zeros(len(x), float) spline_construct(x, y, d) x_new = numpy.random.uniform(-1, 2, 50) y_new = numpy.zeros(len(x_new), float) spline_eval(x, y, d, x_new, y_new) yint = numpy.zeros(len(y), float) spline_cumul_int(x, y, d, yint)
def test_blind2(): # see whether we get segfaults or not. x = numpy.arange(0, 1.005, 0.1) * numpy.pi * 2 y = numpy.sin(x) d = numpy.zeros(len(x), float) spline_construct(x, y, d) x_new = numpy.arange(0, 1.0005, 0.01) * numpy.pi * 2 y_new = numpy.zeros(len(x_new), float) spline_eval(x, y, d, x_new, y_new) yint_spline = numpy.zeros(len(y), float) spline_cumul_int(x, y, d, yint_spline)
def __call__(self, x): y = numpy.zeros(len(x), float) spline_eval(self.x,self.y,self.d,x,y) return y