@@ -76,7 +76,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata!
76
76
# Comparison with Lanczos
77
77
@test Jchol[1 : 500 ,1 : 500 ] ≈ Jlanc[1 : 500 ,1 : 500 ]
78
78
end
79
-
79
+
80
80
@testset " w(x) = (1-x)*exp(x)" begin
81
81
P = Normalized (Legendre ()[affine (0 .. 1 ,Inclusion (- 1 .. 1 )),:])
82
82
x = axes (P,1 )
@@ -89,7 +89,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata!
89
89
# Comparison with Lanczos
90
90
@test Jchol[1 : 500 ,1 : 500 ] ≈ Jlanc[1 : 500 ,1 : 500 ]
91
91
end
92
-
92
+
93
93
@testset " w(x) = (1-x^2)*exp(x^2)" begin
94
94
P = Normalized (legendre (0 .. 1 ))
95
95
x = axes (P,1 )
@@ -102,7 +102,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata!
102
102
# Comparison with Lanczos
103
103
@test Jchol[1 : 500 ,1 : 500 ] ≈ Jlanc[1 : 500 ,1 : 500 ]
104
104
end
105
-
105
+
106
106
@testset " w(x) = x*(1-x^2)*exp(-x^2)" begin
107
107
P = Normalized (Legendre ()[affine (0 .. 1 ,Inclusion (- 1 .. 1 )),:])
108
108
x = axes (P,1 )
@@ -227,7 +227,7 @@ import LazyArrays: AbstractCachedMatrix, resizedata!
227
227
@test Q ≠ P
228
228
@test Q == Q̃
229
229
@test Q̃ == Q
230
-
230
+
231
231
@test Q[0.1 ,1 ] ≈ _p0 (Q) ≈ 1 / sqrt (2 )
232
232
@test Q[0.1 ,1 : 10 ] ≈ Q̃[0.1 ,1 : 10 ]
233
233
@test Q[0.1 ,10_000 ] ≈ Q̃[0.1 ,10_000 ]
@@ -247,11 +247,20 @@ import LazyArrays: AbstractCachedMatrix, resizedata!
247
247
U = ChebyshevU ()
248
248
Q = orthogonalpolynomial (x -> (1 + x^ 2 )* sqrt (1 - x^ 2 ), U)
249
249
x = axes (U,1 )
250
-
250
+
251
251
@test Q[0.1 ,1 ] ≈ _p0 (Q) ≈ 1 / sqrt (sum (expand (Weighted (U),x -> (1 + x^ 2 )* sqrt (1 - x^ 2 ))))
252
252
@test bandwidths (Q\ U) == (0 ,2 )
253
253
254
254
Q̃ = OrthogonalPolynomial (x -> (1 + x^ 2 )* sqrt (1 - x^ 2 ), U)
255
255
@test jacobimatrix (Q)[1 : 10 ,1 : 10 ] == jacobimatrix (Q̃)[1 : 10 ,1 : 10 ]
256
256
end
257
+
258
+ @testset " diff" begin
259
+ P = Legendre ()
260
+ x = axes (P,1 )
261
+ Q = OrthogonalPolynomial (1 .- x)
262
+ Q̃ = Normalized (Jacobi (1 ,0 ))
263
+ @test_skip diff (Q)[0.1 ,1 : 5 ] ≈ diff (Q̃)[0.1 ,1 : 5 ] # broken due to lazy array issues
264
+ @test [diff (Q)[0.1 ,k] for k= 1 : 5 ] ≈ diff (Q̃)[0.1 ,1 : 5 ]
265
+ end
257
266
end
0 commit comments