Skip to content

Commit 647c199

Browse files
committed
Update test_lanczos.jl
1 parent 09169f0 commit 647c199

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/test_lanczos.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using ClassicalOrthogonalPolynomials, BandedMatrices, ArrayLayouts, Test
2-
import ClassicalOrthogonalPolynomials: recurrencecoefficients, PaddedLayout, orthogonalityweight
2+
import ClassicalOrthogonalPolynomials: recurrencecoefficients, PaddedLayout, orthogonalityweight, golubwelsch
33

44
@testset "Lanczos" begin
55
@testset "Legendre" begin
@@ -220,4 +220,16 @@ import ClassicalOrthogonalPolynomials: recurrencecoefficients, PaddedLayout, ort
220220
@test X.dv[3:∞][1:5] X.dv[3:7]
221221
@test X.dv[3:∞][2:∞][1:5] X.dv[4:8]
222222
end
223+
224+
@testset "golubwelsch" begin
225+
x = axes(Legendre(),1)
226+
Q = LanczosPolynomial( @.(inv(1+x^2)))
227+
x,w = golubwelsch(Q[:,Base.OneTo(10)])
228+
@test sum(w) π/2
229+
@test sum(x.^2 .* w) 2 - π/2
230+
231+
= Inclusion(-1..1)
232+
= LanczosPolynomial( @.(inv(1+^2)))
233+
@test all((x,w) .≈ golubwelsch(Q̃[:,Base.OneTo(10)]))
234+
end
223235
end

0 commit comments

Comments
 (0)