def calc_bspline(order, knots, index, x): """ compute value of B-Spline function at x order(Int) : B-Spline order (k in paper) knots( [(double,Int)]) : knot location and multiplicity index(Int) : index of B-Spline (0 origin) x(double) : """ ts = make_ts(knots) xs = np.array([x]) ys = calc_bspline_xs(order, ts, index, xs) return ys[0]
def psi(self, cs, xs): ys_list = np.array([c*calc_bspline_xs(self.order, self.ts, u.index, xs) for (c, u) in zip(cs, self.basis)]) return np.sum(ys_list, axis=0)
def basis_psi(self, xs): return np.array([calc_bspline_xs(self.order, self.ts, u.index, xs) for u in self.basis])
def one_basis(i): non0 = non0_q_list(order, self.knots, i) val = calc_bspline_xs(order, ts, i, xs) deriv = calc_deriv_bspline_xs(order, ts, i, xs) return BSpline(i, non0, val, deriv)