You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We compute the Chebyshev series for the degree-$k\le n$ modified polynomial and its values at the Chebyshev points:
30
30
q = k ->lmul!(P1, lmul!(P, [zeros(k); 1.0; zeros(n-k)]))
31
-
qvals = k->ichebyshevtransform(q(k))
31
+
qvals = k->ichebyshevtransform(q(k))
32
32
33
33
# With the symmetric Jacobi matrix for $P_n^{(\alpha, \beta)}(x)$ and the modified plan, we may compute the modified Jacobi matrix and the corresponding roots (as eigenvalues):
34
34
x =Fun(x->x, NormalizedJacobi(β, α))
35
-
XP =SymTridiagonal(Symmetric(Multiplication(x, space(x))[1:n, 1:n]))
35
+
XP =SymTridiagonal(Symmetric(Multiplication(x, space(x))[1:n+1, 1:n+1]))
# A faster method now exists via the `GramMatrix` architecture and its associated displacement equation. We compute `U`:
69
+
U =Symmetric(Multiplication(u, space(u))[1:n+1, 1:n+1])
70
+
71
+
# Then we form a `GramMatrix` together with the Jacobi matrix:
72
+
G =GramMatrix(U, XP)
73
+
74
+
# And compute its cholesky factorization. The upper-triangular Cholesky factor represents the connection between original Jacobi and semi-classical Jacobi as ${\bf P}^{(\alpha,\beta)}(x) = {\bf Q}(x) R$.
75
+
R =cholesky(G).U
76
+
77
+
# Every else works almost as before, including evaluation on a Chebyshev grid:
78
+
q = k ->lmul!(P1, ldiv!(R, [zeros(k); 1.0; zeros(n-k)]))
0 commit comments