def test_eval(t, ref, tol=1.0e-14):
n = 5
p0, a, b, c = orthopy.line.recurrence_coefficients.legendre(
n, 'monic', symbolic=True
)
value = orthopy.line.evaluate_orthogonal_polynomial(t, p0, a, b, c)
assert value == ref
# Evaluating the Legendre polynomial in this way is rather unstable, so
# don't go too far with n.
approx_ref = numpy.polyval(legendre(n, monic=True), t)
assert abs(value - approx_ref) < tol
return
评论列表
文章目录