Skip to content

Commit 9b7a77b

Browse files
committed
Update test_ultraspherical.jl
1 parent dea4504 commit 9b7a77b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

test/test_ultraspherical.jl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,24 @@ using ClassicalOrthogonalPolynomials: grammatrix, OrthonormalWeighted
214214
Q = Normalized(Legendre()) \ (JacobiWeight(1,1) .* Normalized(Jacobi(2,2)))
215215
@test Q[1:12,1:10]'Q[1:12,1:10] I
216216

217+
X = jacobimatrix(Normalized(Legendre()))
218+
@test Q[1:10,1:10] -qr(I - X^2).Q[1:10,1:10]
219+
217220
c = sqrt.(2*(5:2:∞) ./ ((3:∞) .* (4:∞) ))
218221
s = sqrt.(((1:∞) .* (2:∞)) ./ ((3:∞) .* (4:∞) ))
219222

220-
@test (c.^2 + s.^2)[1:10] ones(10)
221-
G₁
223+
n = 10
224+
@test (c.^2 + s.^2)[1:n] ones(n)
225+
G = [Matrix(1.0I,n,n) for k=1:n-2]
226+
for k = 1:n-2
227+
G[k][[k,k+2],[k,k+2]] = [c[k] s[k]; -s[k] c[k]]
228+
end
229+
230+
@test Q[1:n,1:n-2] *(G...)[:,1:n-2]
231+
232+
@test qr(I - X^2).τ[1:10] c[1:10] .+ 1
233+
@test qr(I - X^2).factors[band(-2)][1:10] -(s ./ (c .+ 1))[1:10]
222234

223-
235+
MatrixFactorizations.QRPackedQ(BandedMatrix(-2 => -(s ./ (c .+ 1))), c .+ 1)[1:10,1:10]
224236
end
225237
end

0 commit comments

Comments
 (0)