def __init__(self, x, y):
    (self.b, self.c, self.d, self.w) = ([], [], [], [])
    self.x = x
    self.y = y
    self.nx = len(x)
    h = np.diff(x)
    self.a = [iy for iy in y]
    A = self.__calc_A(h)
    B = self.__calc_B(h)
    self.c = np.linalg.solve(A, B)
    for i in range((self.nx - 1)):
        self.d.append(((self.c[(i + 1)] - self.c[i]) / (3.0 * h[i])))
        tb = (((self.a[(i + 1)] - self.a[i]) / h[i]) - ((h[i] * (self.c[(i + 1)] + (2.0 * self.c[i]))) / 3.0))
        self.b.append(tb)
def __init__(self, x, y):
    (self.b, self.c, self.d, self.w) = ([], [], [], [])
    self.x = x
    self.y = y
    self.nx = len(x)
    h = np.diff(x)
    self.a = [iy for iy in y]
    A = self.__calc_A(h)
    B = self.__calc_B(h)
    self.c = np.linalg.solve(A, B)
    for i in range((self.nx - 1)):
        self.d.append(((self.c[(i + 1)] - self.c[i]) / (3.0 * h[i])))
        tb = (((self.a[(i + 1)] - self.a[i]) / h[i]) - ((h[i] * (self.c[(i + 1)] + (2.0 * self.c[i]))) / 3.0))
        self.b.append(tb)